com.atlassian.bamboo.build.expiry.plugin
Class BuildExpiryPerPlanPlugin

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
      extended by com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
          extended by com.atlassian.bamboo.build.expiry.plugin.BuildExpiryPerPlanPlugin
All Implemented Interfaces:
InitablePluginModule, CustomBuildDefinitionTransformer, BambooPluginModule, BuildConfigurationAwarePlugin, ConfigurablePlugin, BuildConfigurationUIPlugin, MiscellaneousBuildConfigurationPlugin, RenderableBuildConfiguration

public class BuildExpiryPerPlanPlugin
extends BaseConfigurablePlugin
implements MiscellaneousBuildConfigurationPlugin

A plugin class that allows you to have build expiry occur per build


Field Summary
static java.lang.String BUILD_EXPIRY_CONFIG_CONSTANT
           
protected  com.opensymphony.xwork.TextProvider textProvider
           
 
Fields inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
moduleDescriptor, templateRenderer
 
Constructor Summary
BuildExpiryPerPlanPlugin()
           
 
Method Summary
 boolean isApplicableTo(Plan plan)
          Checks if the plugin is applicable to a plan.
protected  void populateContextForEdit(java.util.Map<java.lang.String,java.lang.Object> context, BuildConfiguration buildConfiguration, Plan plan)
           
protected  void populateContextForView(java.util.Map<java.lang.String,java.lang.Object> context, Plan plan)
           
 void setTextProvider(com.opensymphony.xwork.TextProvider textProvider)
           
 void transformBuildDefinition(java.util.Map<java.lang.String,java.lang.Object> configObjects, java.util.Map<java.lang.String,java.lang.String> configParameters, BuildDefinition buildDefinition)
          Implementors can add their custom objects to the configObjects map.
 ErrorCollection validate(BuildConfiguration config)
          Validates the properties in the BuildConfiguration object.
 
Methods inherited from class com.atlassian.bamboo.v2.build.BaseConfigurablePlugin
customizeBuildRequirements, customizeBuildRequirements, removeBuildRequirements, removeBuildRequirements
 
Methods inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
addDefaultValues, getEditHtml, getViewHtml, init, isConfigurationMissing, prepareConfigObject, setTemplateRenderer
 
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.v2.build.configuration.BuildConfigurationUIPlugin
isConfigurationMissing
 
Methods inherited from interface com.atlassian.bamboo.v2.build.BuildConfigurationAwarePlugin
addDefaultValues, prepareConfigObject
 
Methods inherited from interface com.atlassian.bamboo.plugin.InitablePluginModule
init
 
Methods inherited from interface com.atlassian.bamboo.v2.build.RenderableBuildConfiguration
getEditHtml, getViewHtml
 

Field Detail

BUILD_EXPIRY_CONFIG_CONSTANT

public static final java.lang.String BUILD_EXPIRY_CONFIG_CONSTANT
See Also:
Constant Field Values

textProvider

protected com.opensymphony.xwork.TextProvider textProvider
Constructor Detail

BuildExpiryPerPlanPlugin

public BuildExpiryPerPlanPlugin()
Method Detail

isApplicableTo

public boolean isApplicableTo(@NotNull
                              Plan plan)
Description copied from interface: BuildConfigurationUIPlugin
Checks if the plugin is applicable to a plan. Typical implementation is to check plan's type (chain, build, job).

Specified by:
isApplicableTo in interface BuildConfigurationUIPlugin
Parameters:
plan - Plan to be verified
Returns:
true if particular configuration is applicable to input plan

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        BuildConfiguration config)
Description copied from interface: BuildConfigurationAwarePlugin
Validates the properties in the BuildConfiguration object. The name of the properties match those passed in through the form fragments in RenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan) template.

Specified by:
validate in interface BuildConfigurationAwarePlugin
Overrides:
validate in class BaseBuildConfigurationAwarePlugin
Parameters:
config - - @NotNull
Returns:
ErrorCollection keyed by the field name. @NotNull

populateContextForEdit

protected void populateContextForEdit(@NotNull
                                      java.util.Map<java.lang.String,java.lang.Object> context,
                                      @NotNull
                                      BuildConfiguration buildConfiguration,
                                      @NotNull
                                      Plan plan)
Overrides:
populateContextForEdit in class BaseBuildConfigurationAwarePlugin

populateContextForView

protected void populateContextForView(@NotNull
                                      java.util.Map<java.lang.String,java.lang.Object> context,
                                      @NotNull
                                      Plan plan)
Overrides:
populateContextForView in class BaseBuildConfigurationAwarePlugin

transformBuildDefinition

public void transformBuildDefinition(@NotNull
                                     java.util.Map<java.lang.String,java.lang.Object> configObjects,
                                     @NotNull
                                     java.util.Map<java.lang.String,java.lang.String> configParameters,
                                     @NotNull
                                     BuildDefinition buildDefinition)
Description copied from interface: CustomBuildDefinitionTransformer
Implementors can add their custom objects to the configObjects map. The key should be unique to plugin... It's better to be descriptive. It is possible to also update the buildDefinition directly, but it's not recommended.

Specified by:
transformBuildDefinition in interface CustomBuildDefinitionTransformer
Parameters:
configObjects - - Map - string key, object value. A map to put custom objects into. @NotNull
configParameters - - Map - String key, string value. These are taken from all fields that begin with "custom."
buildDefinition - - the fully constructed BuildDefinition @NotNull

setTextProvider

public void setTextProvider(com.opensymphony.xwork.TextProvider textProvider)


Copyright © 2011 Atlassian. All Rights Reserved.