Interface AsyncPolledBuildTrigger
-
- All Known Implementing Classes:
BaseAsyncPolledBuildTrigger
public interface AsyncPolledBuildTrigger
Represents an asynchronous build trigger. Implementations may use as much time as necessary to check for an update and should inherit fromBaseAsyncPolledBuildTrigger
base class for future API compatibility. To create a build triggering policy for an asynchronous build trigger useAsyncPolledBuildTriggerFactory
- Since:
- 10.0
- Author:
- vbedrosova
- See Also:
BaseAsyncPolledBuildTrigger
,AsyncPolledBuildTriggerFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
getPollInterval(PolledTriggerContext context)
Returns the trigger minimal poll interval (time between invocations) in seconds.default java.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, or when the build configuration is unpaused.java.lang.String
triggerBuild(java.lang.String previousValue, PolledTriggerContext context)
Called periodically by the 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.
-
-
-
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 methodcontext
- 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
-
triggerActivated
void triggerActivated(@NotNull PolledTriggerContext context) throws BuildTriggerException
Called when the build trigger is added to a build configuration, enabled, or when the build configuration is unpaused.- Parameters:
context
- current trigger context- Throws:
BuildTriggerException
-
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)
-
-