Class AsyncPolledBuildTriggeringPolicyImpl
- java.lang.Object
-
- jetbrains.buildServer.buildTriggers.PolledBuildTrigger
-
- jetbrains.buildServer.buildTriggers.async.AsyncPolledBuildTriggeringPolicyImpl
-
- All Implemented Interfaces:
BuildTriggeringPolicy
public class AsyncPolledBuildTriggeringPolicyImpl extends PolledBuildTrigger
- Author:
- vbedrosova
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAsyncPolledBuildTriggeringPolicyImpl.Job
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.buildTriggers.PolledBuildTrigger
DEFAULT_POLL_TRIGGER_INTERVAL
-
-
Constructor Summary
Constructors Constructor Description AsyncPolledBuildTriggeringPolicyImpl(AsyncPolledBuildTrigger trigger, ExecutorService executorService, Logger logger, EventDispatcher<BuildServerListener> eventDispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncPolledBuildTriggeringPolicyImpl.JobgetJob(PolledTriggerContext context)intgetPollInterval(PolledTriggerContext context)Returns trigger poll interval in secondsMap<String,String>getTriggerStateProperties(PolledTriggerContext context)voidtriggerActivated(PolledTriggerContext context)Called when the build trigger is added to a build configuration, enabled, changed or when build configuration is unpaused.voidtriggerBuild(PolledTriggerContext context)Called periodically by TeamCity.voidtriggerDeactivated(PolledTriggerContext context)Called when the build trigger is removed from a build configuration, disabled or when the build configuration is paused or deleted.
-
-
-
Constructor Detail
-
AsyncPolledBuildTriggeringPolicyImpl
public AsyncPolledBuildTriggeringPolicyImpl(@NotNull AsyncPolledBuildTrigger trigger, @NotNull ExecutorService executorService, @NotNull Logger logger, @NotNull EventDispatcher<BuildServerListener> eventDispatcher)
-
-
Method Detail
-
triggerBuild
public void triggerBuild(@NotNull PolledTriggerContext context) throws BuildTriggerExceptionDescription copied from class:PolledBuildTriggerCalled periodically by TeamCity. Trigger should either trigger a build or skip to the next call of the method.- Specified by:
triggerBuildin classPolledBuildTrigger- Parameters:
context- - the trigger invocation context- Throws:
BuildTriggerException- if exception occurred during the process of build triggering
-
triggerActivated
public void triggerActivated(@NotNull PolledTriggerContext context) throws BuildTriggerExceptionDescription copied from class:PolledBuildTriggerCalled when the build trigger is added to a build configuration, enabled, changed or when build configuration is unpaused.- Overrides:
triggerActivatedin classPolledBuildTrigger- Parameters:
context- current context- Throws:
BuildTriggerException
-
triggerDeactivated
public void triggerDeactivated(@NotNull PolledTriggerContext context) throws BuildTriggerExceptionDescription copied from class:PolledBuildTriggerCalled when the build trigger is removed from a build configuration, disabled or when the build configuration is paused or deleted.- Overrides:
triggerDeactivatedin classPolledBuildTrigger- Parameters:
context- current context- Throws:
BuildTriggerException
-
getTriggerStateProperties
@Nullable public Map<String,String> getTriggerStateProperties(@NotNull PolledTriggerContext context)
- Overrides:
getTriggerStatePropertiesin classPolledBuildTrigger- Parameters:
context- state properties can be based on trigger own properties, or on some build type settings; context object allows accessing both of them- 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.
-
getPollInterval
public int getPollInterval(@NotNull PolledTriggerContext context)Description copied from class:PolledBuildTriggerReturns trigger poll interval in seconds- Overrides:
getPollIntervalin classPolledBuildTrigger- Parameters:
context- - the trigger invocation context- Returns:
- poll interval
-
getJob
@Nullable public AsyncPolledBuildTriggeringPolicyImpl.Job getJob(@NotNull PolledTriggerContext context)
-
-