Interface AsyncPolledBuildTrigger

    • Method Detail

      • getPollInterval

        int getPollInterval​(@NotNull
                            PolledTriggerContext context)
        Returns the trigger minimal poll interval (time between invocations) in seconds.
        Parameters:
        context - trigger invocation context
        Returns:
        poll interval
      • triggerBuild

        @Nullable
        java.lang.String triggerBuild​(@Nullable
                                      java.lang.String previousValue,
                                      @NotNull
                                      PolledTriggerContext context)
                               throws BuildTriggerException
        Called periodically by the TeamCity. The trigger should either trigger a build (or builds) or skip to the next call of this method. The method can return a value and use it in the following calls for the state comparison.
        Parameters:
        previousValue - previous value returned by this method
        context - trigger invocation context
        Returns:
        new value that will override the previous one in the storage
        Throws:
        BuildTriggerException - if an exception occurred during the process of build triggering
      • triggerDeactivated

        void triggerDeactivated​(@NotNull
                                PolledTriggerContext context)
                         throws BuildTriggerException
        Called when the build trigger is removed from a build configuration, disabled, or when the build configuration is paused or deleted.
        Parameters:
        context - current context
        Throws:
        BuildTriggerException
      • getTriggerStateProperties

        @Nullable
        default java.util.Map<java.lang.String,​java.lang.String> getTriggerStateProperties​(@NotNull
                                                                                                 PolledTriggerContext context)
        Returns:
        map of properties whose changes should lead to triggerActivated call. By default triggerActivated is only called when trigger is enabled or added. But if this method returns not null value then server will call triggerActivated method once it sees that the returned map has changed.
        Since:
        2021.2
        See Also:
        PolledBuildTrigger.getTriggerStateProperties(PolledTriggerContext)