Class PolledBuildTrigger
- java.lang.Object
-
- jetbrains.buildServer.buildTriggers.PolledBuildTrigger
-
- All Implemented Interfaces:
BuildTriggeringPolicy
public abstract class PolledBuildTrigger extends java.lang.Object implements BuildTriggeringPolicy
Trigger using this policy will be periodically polled by TeamCity. Note that because all of the triggers are processed sequentially, each trigger should work as fast as possible.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_POLL_TRIGGER_INTERVAL
-
Constructor Summary
Constructors Constructor Description PolledBuildTrigger()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
getPollInterval(PolledTriggerContext context)
Returns trigger poll interval in secondsjava.util.Map<java.lang.String,java.lang.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.abstract 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.
-
-
-
Field Detail
-
DEFAULT_POLL_TRIGGER_INTERVAL
public static final int DEFAULT_POLL_TRIGGER_INTERVAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPollInterval
public int getPollInterval(@NotNull PolledTriggerContext context)
Returns trigger poll interval in seconds- Parameters:
context
- - the trigger invocation context- Returns:
- poll interval
-
triggerBuild
public abstract void triggerBuild(@NotNull PolledTriggerContext context) throws BuildTriggerException
Called periodically by TeamCity. Trigger should either trigger a build or skip to the next call of the method.- 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
Called when the build trigger is added to a build configuration, enabled, changed or when build configuration is unpaused.- Parameters:
context
- current context- Throws:
BuildTriggerException
-
triggerDeactivated
public 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 public java.util.Map<java.lang.String,java.lang.String> getTriggerStateProperties(@NotNull PolledTriggerContext context)
- 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.
- Since:
- 2019.1.2
-
-