Class HungBuildPlanConfigurationPlugin
- java.lang.Object
-
- com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
-
- com.atlassian.bamboo.build.monitoring.HungBuildPlanConfigurationPlugin
-
- All Implemented Interfaces:
MiscellaneousPlanConfigurationPlugin
,PlanConfigurationUiPlugin
,InitablePluginModule
,BambooPluginModule
,BuildConfigurationAwarePlugin
,ImportExportAwarePlugin<com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild,com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties>
,RenderableBuildConfiguration
public class HungBuildPlanConfigurationPlugin extends BaseBuildConfigurationAwarePlugin implements MiscellaneousPlanConfigurationPlugin, ImportExportAwarePlugin<com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild,com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
HungBuildPlanConfigurationPlugin.Config
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
moduleDescriptor, templateRenderer
-
-
Constructor Summary
Constructors Constructor Description HungBuildPlanConfigurationPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefaultValues(@NotNull BuildConfiguration buildConfiguration)
Extension point for adding default values to the form forRenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
void
addToBuildConfiguration(@NotNull com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties specsProperties, @NotNull org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
Validate and add data from specs properties to passed build configuration.@Nullable com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild
fromYaml(Node node)
Import configuration of this plugin from YAML node to Bamboo Specs entity.@NotNull Set<String>
getConfigurationKeys()
Return all property keys related to this plugin module which may exist in a plan'sBuildConfiguration
.boolean
isApplicableTo(@NotNull ImmutablePlan plan)
Checks if the plugin is applicable to a plan.boolean
isConfigurationMissing(@NotNull org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
Checks if HierarchicalConfiguration objects contains plugin's configuration values.protected void
populateContextForEdit(@NotNull Map<String,Object> context, @NotNull BuildConfiguration buildConfiguration, @Nullable Plan plan)
protected void
populateContextForView(@NotNull Map<String,Object> context, @NotNull Plan plan)
void
prepareConfigObject(@NotNull BuildConfiguration buildConfiguration)
Do any preprocessing work before validation occurs.@NotNull com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild
toSpecsEntity(@NotNull org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
Export configuration of this plugin to Bamboo Specs entity.@Nullable Node
toYaml(@NotNull com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties specsProperties)
Convert configuration of this plugin from Bamboo Specs to YAML structure.-
Methods inherited from class com.atlassian.bamboo.v2.build.BaseBuildConfigurationAwarePlugin
getEditHtml, getTemplateRenderer, getViewHtml, init, setTemplateRenderer, validate
-
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.BuildConfigurationAwarePlugin
validate
-
Methods inherited from interface com.atlassian.bamboo.plugin.InitablePluginModule
init
-
Methods inherited from interface com.atlassian.bamboo.v2.build.RenderableBuildConfiguration
getEditHtml, getViewHtml
-
-
-
-
Method Detail
-
isApplicableTo
public boolean isApplicableTo(@NotNull @NotNull ImmutablePlan plan)
Description copied from interface:PlanConfigurationUiPlugin
Checks if the plugin is applicable to a plan. Typical implementation is to check plan's type (chain, build, job).- Specified by:
isApplicableTo
in interfacePlanConfigurationUiPlugin
- Parameters:
plan
- Plan to be verified- Returns:
- true if particular configuration is applicable to input plan
-
populateContextForEdit
protected void populateContextForEdit(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull BuildConfiguration buildConfiguration, @Nullable @Nullable Plan plan)
- Overrides:
populateContextForEdit
in classBaseBuildConfigurationAwarePlugin
-
populateContextForView
protected void populateContextForView(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull Plan plan)
- Overrides:
populateContextForView
in classBaseBuildConfigurationAwarePlugin
-
prepareConfigObject
public void prepareConfigObject(@NotNull @NotNull BuildConfiguration buildConfiguration)
Description copied from interface:BuildConfigurationAwarePlugin
Do any preprocessing work before validation occurs. For repository, builder and web repository plugins this will only be called if the plugin is select by the user.- Specified by:
prepareConfigObject
in interfaceBuildConfigurationAwarePlugin
- Overrides:
prepareConfigObject
in classBaseBuildConfigurationAwarePlugin
- Parameters:
buildConfiguration
- -
-
addDefaultValues
public void addDefaultValues(@NotNull @NotNull BuildConfiguration buildConfiguration)
Description copied from interface:BuildConfigurationAwarePlugin
Extension point for adding default values to the form forRenderableBuildConfiguration.getEditHtml(com.atlassian.bamboo.ww2.actions.build.admin.create.BuildConfiguration, com.atlassian.bamboo.plan.Plan)
- Specified by:
addDefaultValues
in interfaceBuildConfigurationAwarePlugin
- Overrides:
addDefaultValues
in classBaseBuildConfigurationAwarePlugin
- Parameters:
buildConfiguration
- -
-
isConfigurationMissing
public boolean isConfigurationMissing(@NotNull @NotNull org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
Description copied from interface:BuildConfigurationAwarePlugin
Checks if HierarchicalConfiguration objects contains plugin's configuration values. Should return true if call to addDefaultValues() is necessary to initialize HierarchicalConfiguration.- Specified by:
isConfigurationMissing
in interfaceBuildConfigurationAwarePlugin
- Parameters:
buildConfiguration
- HierarchicalConfiguration object- Returns:
- true if configuration is not present in HierarchicalConfiguration and should be set to defaults
-
getConfigurationKeys
@NotNull public @NotNull Set<String> getConfigurationKeys()
Description copied from interface:ImportExportAwarePlugin
Return all property keys related to this plugin module which may exist in a plan'sBuildConfiguration
.The returned set may be immutable. If a plugin module doesn't have configuration, then an empty set should be returned.
- Specified by:
getConfigurationKeys
in interfaceImportExportAwarePlugin<com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild,com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties>
-
toSpecsEntity
@NotNull public @NotNull com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild toSpecsEntity(@NotNull @NotNull org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
Description copied from interface:ImportExportAwarePlugin
Export configuration of this plugin to Bamboo Specs entity.- Specified by:
toSpecsEntity
in interfaceImportExportAwarePlugin<com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild,com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties>
-
addToBuildConfiguration
public void addToBuildConfiguration(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties specsProperties, @NotNull @NotNull org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
Description copied from interface:ImportExportAwarePlugin
Validate and add data from specs properties to passed build configuration.- Specified by:
addToBuildConfiguration
in interfaceImportExportAwarePlugin<com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild,com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties>
-
fromYaml
@Nullable public @Nullable com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild fromYaml(Node node) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
Description copied from interface:ImportExportAwarePlugin
Import configuration of this plugin from YAML node to Bamboo Specs entity.- Specified by:
fromYaml
in interfaceImportExportAwarePlugin<com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild,com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties>
- Parameters:
node
- yaml node- Returns:
- Bamboo Specs entity for plugin settings.
- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if configuration is wrong.
-
toYaml
@Nullable public @Nullable Node toYaml(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties specsProperties)
Description copied from interface:ImportExportAwarePlugin
Convert configuration of this plugin from Bamboo Specs to YAML structure.- Specified by:
toYaml
in interfaceImportExportAwarePlugin<com.atlassian.bamboo.specs.api.builders.plan.configuration.ForceStopBuild,com.atlassian.bamboo.specs.api.model.plan.configuration.ForceStopBuildProperties>
- Returns:
- YAML
Node
containing representation of Bamboo Specs entity.
-
-