jetbrains.buildServer.buildTriggers
Class PolledBuildTrigger

java.lang.Object
  extended by 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 sequentally, each trigger should work as fast as possible.


Field Summary
static int DEFAULT_POLL_TRIGGER_INTERVAL
           
 
Constructor Summary
PolledBuildTrigger()
           
 
Method Summary
 int getPollInterval(PolledTriggerContext context)
          Returns trigger poll interval in seconds
 void triggerActivated(PolledTriggerContext context)
          Called when build trigger added to build configuration, enabled, or when build configuration is unpaused.
abstract  void triggerBuild(PolledTriggerContext context)
          Called periodically by TeamCity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_POLL_TRIGGER_INTERVAL

public static final int DEFAULT_POLL_TRIGGER_INTERVAL
Constructor Detail

PolledBuildTrigger

public PolledBuildTrigger()
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 build trigger added to build configuration, enabled, or when build configuration is unpaused.

Parameters:
context - current context
Throws:
BuildTriggerException