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 class
AsyncPolledBuildTriggeringPolicyImpl.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.Job
getJob(PolledTriggerContext context)
int
getPollInterval(PolledTriggerContext context)
Returns trigger poll interval in secondsMap<String,String>
getTriggerStateProperties(PolledTriggerContext context)
void
triggerActivated(PolledTriggerContext context)
Called when the build trigger is added to a build configuration, enabled, changed or when build configuration is unpaused.void
triggerBuild(PolledTriggerContext context)
Called periodically by TeamCity.void
triggerDeactivated(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 BuildTriggerException
Description copied from class:PolledBuildTrigger
Called periodically by TeamCity. Trigger should either trigger a build or skip to the next call of the method.- Specified by:
triggerBuild
in 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 BuildTriggerException
Description copied from class:PolledBuildTrigger
Called when the build trigger is added to a build configuration, enabled, changed or when build configuration is unpaused.- Overrides:
triggerActivated
in classPolledBuildTrigger
- Parameters:
context
- current context- Throws:
BuildTriggerException
-
triggerDeactivated
public void triggerDeactivated(@NotNull PolledTriggerContext context) throws BuildTriggerException
Description copied from class:PolledBuildTrigger
Called when the build trigger is removed from a build configuration, disabled or when the build configuration is paused or deleted.- Overrides:
triggerDeactivated
in classPolledBuildTrigger
- Parameters:
context
- current context- Throws:
BuildTriggerException
-
getTriggerStateProperties
@Nullable public Map<String,String> getTriggerStateProperties(@NotNull PolledTriggerContext context)
- Overrides:
getTriggerStateProperties
in 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:PolledBuildTrigger
Returns trigger poll interval in seconds- Overrides:
getPollInterval
in classPolledBuildTrigger
- Parameters:
context
- - the trigger invocation context- Returns:
- poll interval
-
getJob
@Nullable public AsyncPolledBuildTriggeringPolicyImpl.Job getJob(@NotNull PolledTriggerContext context)
-
-