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>
  • Constructor Details

    • HungBuildPlanConfigurationPlugin

      public HungBuildPlanConfigurationPlugin()
  • Method Details

    • 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 interface PlanConfigurationUiPlugin
      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 class BaseBuildConfigurationAwarePlugin
    • populateContextForView

      protected void populateContextForView(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull Plan plan)
      Overrides:
      populateContextForView in class BaseBuildConfigurationAwarePlugin
    • 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 interface BuildConfigurationAwarePlugin
      Overrides:
      prepareConfigObject in class BaseBuildConfigurationAwarePlugin
      Parameters:
      buildConfiguration - -
    • addDefaultValues

      public void addDefaultValues(@NotNull @NotNull BuildConfiguration buildConfiguration)
      Description copied from interface: BuildConfigurationAwarePlugin
      Specified by:
      addDefaultValues in interface BuildConfigurationAwarePlugin
      Overrides:
      addDefaultValues in class BaseBuildConfigurationAwarePlugin
      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 interface BuildConfigurationAwarePlugin
      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's BuildConfiguration.

      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 interface ImportExportAwarePlugin<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 interface ImportExportAwarePlugin<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 interface ImportExportAwarePlugin<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 interface ImportExportAwarePlugin<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 interface ImportExportAwarePlugin<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.