Class PlanValidationServiceImpl

java.lang.Object
com.atlassian.bamboo.build.creation.PlanValidationServiceImpl
All Implemented Interfaces:
PlanValidationService

public class PlanValidationServiceImpl extends Object implements PlanValidationService
  • Field Details

  • Constructor Details

  • Method Details

    • validateKey

      public void validateKey(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String key)
      Description copied from interface: PlanValidationService
      Validate any String against Bamboo's generic rules for keys.
      Specified by:
      validateKey in interface PlanValidationService
      Parameters:
      validationAware - - the object to add errors to if any are found
      fieldName - - the name of the field to add the errors to
      errorPrefix - - the prefix to put in front of the standardised error keys. (e.g. "plan", "chain")
      key - - the actual string to validate
    • validateName

      public void validateName(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String name)
      Description copied from interface: PlanValidationService
      Validate any String against Bamboo's generic rules for names.
      Specified by:
      validateName in interface PlanValidationService
      Parameters:
      validationAware - - the object to add errors to if any are found
      fieldName - - the name of the field to add the errors to
      errorPrefix - - the prefix to put in front of the standardised error keys. (e.g. "plan", "chain")
      name - - the actual string to validate
    • validateDescription

      public void validateDescription(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String description)
      Description copied from interface: PlanValidationService
      Validate the description field of any object. All it really does is check length
      Specified by:
      validateDescription in interface PlanValidationService
      Parameters:
      validationAware - - the object to add errors to if any are found
      fieldName - - the name of the field to add the errors to
      description - - the actual text to validate
    • validatePlanToCloneExists

      public void validatePlanToCloneExists(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable @Nullable String buildKeyToClone)
      Description copied from interface: PlanValidationService
      Validate that the plan t clone exists
      Specified by:
      validatePlanToCloneExists in interface PlanValidationService
      Parameters:
      validationAware - - object to add errors to if any are found
      buildKeyToClone - - the key of the plan to clone
    • validateNewPlanDetails

      public void validateNewPlanDetails(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String buildKey, String buildName)
      Description copied from interface: PlanValidationService
      Ensure that the build key and name are valid
      Specified by:
      validateNewPlanDetails in interface PlanValidationService
      Parameters:
      validationAware - - object to add errors to if any are found
      buildKey - - the key for the plan
      buildName - - the name for the plan
    • validateNewJobForExistingChain

      public void validateNewJobForExistingChain(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull @NotNull Chain existingChain, @NotNull @NotNull String buildKey, @Nullable @Nullable String buildName)
      Specified by:
      validateNewJobForExistingChain in interface PlanValidationService
      Parameters:
      validationAware - - object to add errors to if any are found
      existingChain - - the chain the new job will be added to
      buildKey - - the key for the job
      buildName - - the name for the job.
    • validateNewChainForExistingProject

      public void validateNewChainForExistingProject(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String existingProjectKey, String buildKey, String buildName)
      Description copied from interface: PlanValidationService
      Validate that new chain name and key is unique within the project
      Specified by:
      validateNewChainForExistingProject in interface PlanValidationService
      Parameters:
      validationAware - - object to add errors to if any are found
      existingProjectKey - - the key of an existing project
      buildKey - - the key for the new chain
      buildName - - the name of the new chain
    • validateNewChainForExistingProject

      public void validateNewChainForExistingProject(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull @NotNull String existingProjectKey, @NotNull @NotNull String buildName)
      Description copied from interface: PlanValidationService
      Validate that new chain name (only) is unique within the project
      Specified by:
      validateNewChainForExistingProject in interface PlanValidationService
      Parameters:
      validationAware - - object to add errors to if any are found
      existingProjectKey - - the key of an existing project
      buildName - - the name of the new chain
    • validateNewPlanBranchForMaster

      public void validateNewPlanBranchForMaster(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull @NotNull ImmutableChain masterChain, @NotNull @NotNull String branchName)
      Description copied from interface: PlanValidationService
      Validate that new plan branch name (only) is unique within a set of branches with a common master
      Specified by:
      validateNewPlanBranchForMaster in interface PlanValidationService
      Parameters:
      validationAware - object to add errors to if any are found
      masterChain - the master chain
      branchName - the name of the new chain
    • validateNewProjectDetails

      public void validateNewProjectDetails(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String projectName, String projectKey)
      Description copied from interface: PlanValidationService
      Validate that the new project details are valid
      Specified by:
      validateNewProjectDetails in interface PlanValidationService
      Parameters:
      validationAware - object to add errors to if any are found
      projectName - name of the project to validate
      projectKey - key of the project to validate
    • validateNewProjectDetails

      public void validateNewProjectDetails(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable @Nullable String projectName, @Nullable @Nullable String projectKey, @Nullable @Nullable String projectDescription)
      Description copied from interface: PlanValidationService
      Validate that the new project details are valid
      Specified by:
      validateNewProjectDetails in interface PlanValidationService
      Parameters:
      validationAware - object to add errors to if any are found
      projectName - name of the project to validate
      projectKey - key of the project to validate
      projectDescription - description of the project to validate
    • validateNewStageForChain

      public void validateNewStageForChain(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull @NotNull Chain chain, @Nullable @Nullable String stageName)
      Description copied from interface: PlanValidationService
      Validate the the new stage can be added to the given chain
      Specified by:
      validateNewStageForChain in interface PlanValidationService
      Parameters:
      validationAware - - to add any errors to
      chain - - the chain the stage will be added to
      stageName - - the stage to be added
    • validateStageExistsForChain

      public void validateStageExistsForChain(com.atlassian.struts.ValidationAware validationAware, Chain chain, String stageName)
      Description copied from interface: PlanValidationService
      Ensures that the stage currently exists for a chain
      Specified by:
      validateStageExistsForChain in interface PlanValidationService
      Parameters:
      validationAware - - to add the errors to
      chain - - the chain the stage should exist in
      stageName - - the stage to check for