com.atlassian.bamboo.build.strategy
Class PollingBuildStrategy

java.lang.Object
  extended by com.atlassian.bamboo.build.strategy.AbstractBuildStrategy
      extended by com.atlassian.bamboo.build.strategy.AbstractQuartzStrategy
          extended by com.atlassian.bamboo.build.strategy.PollingBuildStrategy
All Implemented Interfaces:
BuildStrategy, QuartzStrategy, RepositoryAwareBuildStrategy, BambooIdProvider, ConvertibleFromConfig, java.io.Serializable

public class PollingBuildStrategy
extends AbstractQuartzStrategy
implements QuartzStrategy, RepositoryAwareBuildStrategy

This class defines the build, only if the build has changed strategy. This is the normal case for continuous integration.

See Also:
Serialized Form

Nested Class Summary
static class PollingBuildStrategy.PollingStrategy
           
 
Field Summary
static int DEFAULT_POLLING_PERIOD
           
 
Fields inherited from class com.atlassian.bamboo.build.strategy.AbstractQuartzStrategy
scheduler
 
Fields inherited from interface com.atlassian.bamboo.build.strategy.QuartzStrategy
BUILD_STRATEGY, REPOSITORY_CHANGE_JOB, TRIGGER_CONDITIONS_CONFIGURATION, TRIGGER_ID, TRIGGERED_OBJECT_ID, TRIGGERING_REPOSITORIES
 
Constructor Summary
PollingBuildStrategy()
           
 
Method Summary
 void addDefaultValues(BuildConfiguration buildConfiguration)
           
 boolean canTrigger(java.lang.Class<? extends Triggerable> triggerableType)
          Default implementation: trigger only works for Chains
 java.lang.String getDescription()
           
 java.lang.String getKey()
          A lowercase string key to identify the build strategy
 java.lang.String getName()
          Returns the display name of the strategy type.
 java.lang.String getPollingCronExpression()
           
 int getPollingPeriod()
           
 java.lang.String getPollingStrategy()
           
protected  java.lang.Class<? extends org.quartz.Job> getStrategyJob()
           
protected  org.quartz.Trigger getTrigger(Triggerable triggerable)
           
 java.util.Set<java.lang.Long> getTriggeringRepositories()
          Return a list of repository ids this trigger is configured for.
 void populateFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
          Update the current object with data in the HierarchicalConfiguration
protected  void populateFromConfigInternal(org.apache.commons.configuration.HierarchicalConfiguration config)
           
 void setPollingCronExpression(java.lang.String pollingCronExpression)
           
 void setPollingPeriod(int pollingPeriod)
           
 void setPollingStrategy(java.lang.String pollingStrategy)
           
 void setTriggeringRepositories(java.util.Set<java.lang.Long> triggeringRepositories)
          Set list of repository ids this trigger is configured for.
 org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
          Generate a HierarchicalConfiguration from the current state of the object
 ErrorCollection validate(BuildConfiguration buildConfiguration)
          Takes in a BuildConfiguration and returns any errors possible
 
Methods inherited from class com.atlassian.bamboo.build.strategy.AbstractQuartzStrategy
getScheduler, getUniqueId, init, initialiseJob, removeJob, setScheduler
 
Methods inherited from class com.atlassian.bamboo.build.strategy.AbstractBuildStrategy
getBuildStrategyManager, getId, getTextProvider, getTriggerConditionsConfiguration, getUserDescription, setId, setUserDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.build.strategy.QuartzStrategy
initialiseJob, removeJob
 
Methods inherited from interface com.atlassian.bamboo.build.strategy.BuildStrategy
getTriggerConditionsConfiguration, getUserDescription, init, setId, setUserDescription
 
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
 

Field Detail

DEFAULT_POLLING_PERIOD

public static final int DEFAULT_POLLING_PERIOD
See Also:
Constant Field Values
Constructor Detail

PollingBuildStrategy

public PollingBuildStrategy()
Method Detail

getKey

public java.lang.String getKey()
Description copied from interface: BuildStrategy
A lowercase string key to identify the build strategy

Specified by:
getKey in interface BuildStrategy
Returns:
String must not be null

getName

public java.lang.String getName()
Description copied from interface: BuildStrategy
Returns the display name of the strategy type.

Specified by:
getName in interface BuildStrategy
Returns:
String must not be null

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface BuildStrategy
Overrides:
getDescription in class AbstractBuildStrategy

addDefaultValues

public void addDefaultValues(BuildConfiguration buildConfiguration)
Specified by:
addDefaultValues in interface BuildStrategy
Overrides:
addDefaultValues in class AbstractBuildStrategy

toConfiguration

@NotNull
public org.apache.commons.configuration.HierarchicalConfiguration toConfiguration()
Description copied from interface: ConvertibleFromConfig
Generate a HierarchicalConfiguration from the current state of the object

Specified by:
toConfiguration in interface ConvertibleFromConfig
Overrides:
toConfiguration in class AbstractBuildStrategy
Returns:
Always returns an HierarchicalConfiguration. Never null

populateFromConfig

public void populateFromConfig(@NotNull
                               org.apache.commons.configuration.HierarchicalConfiguration config)
Description copied from interface: ConvertibleFromConfig
Update the current object with data in the HierarchicalConfiguration

Specified by:
populateFromConfig in interface ConvertibleFromConfig
Overrides:
populateFromConfig in class AbstractBuildStrategy

populateFromConfigInternal

protected void populateFromConfigInternal(@NotNull
                                          org.apache.commons.configuration.HierarchicalConfiguration config)

validate

public ErrorCollection validate(BuildConfiguration buildConfiguration)
Description copied from interface: BuildStrategy
Takes in a BuildConfiguration and returns any errors possible

Specified by:
validate in interface BuildStrategy
Overrides:
validate in class AbstractBuildStrategy
Parameters:
buildConfiguration - not null
Returns:
ErrorCollection. must not be null

getStrategyJob

@NotNull
protected java.lang.Class<? extends org.quartz.Job> getStrategyJob()
Specified by:
getStrategyJob in class AbstractQuartzStrategy

getTrigger

@Nullable
protected org.quartz.Trigger getTrigger(@NotNull
                                                 Triggerable triggerable)
Specified by:
getTrigger in class AbstractQuartzStrategy

getPollingPeriod

public int getPollingPeriod()

setPollingPeriod

public void setPollingPeriod(int pollingPeriod)

getPollingStrategy

public java.lang.String getPollingStrategy()

setPollingStrategy

public void setPollingStrategy(java.lang.String pollingStrategy)

getPollingCronExpression

public java.lang.String getPollingCronExpression()

setPollingCronExpression

public void setPollingCronExpression(java.lang.String pollingCronExpression)

getTriggeringRepositories

public java.util.Set<java.lang.Long> getTriggeringRepositories()
Description copied from interface: RepositoryAwareBuildStrategy
Return a list of repository ids this trigger is configured for.

Specified by:
getTriggeringRepositories in interface RepositoryAwareBuildStrategy
Returns:
Set of Long

setTriggeringRepositories

public void setTriggeringRepositories(java.util.Set<java.lang.Long> triggeringRepositories)
Description copied from interface: RepositoryAwareBuildStrategy
Set list of repository ids this trigger is configured for.

Specified by:
setTriggeringRepositories in interface RepositoryAwareBuildStrategy

canTrigger

public boolean canTrigger(@NotNull
                          java.lang.Class<? extends Triggerable> triggerableType)
Description copied from class: AbstractBuildStrategy
Default implementation: trigger only works for Chains

Specified by:
canTrigger in interface BuildStrategy
Overrides:
canTrigger in class AbstractQuartzStrategy
Returns:
true iff build strategy is applicable to a Triggerable type


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.