Interface PlanValidationService

All Known Implementing Classes:
PlanValidationServiceImpl

public interface PlanValidationService
A stateless, non-transactional service that provides common services for plan validation
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Regular expression matching a valid key.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    validateDescription(@NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String description)
    Validate the description field of any object.
    void
    validateKey(@NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String key)
    Validate any String against Bamboo's generic rules for keys.
    void
    validateName(@NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String name)
    Validate any String against Bamboo's generic rules for names.
    void
    validateNewChainForExistingProject(@NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull String existingProjectKey, @NotNull String chainName)
    Validate that new chain name (only) is unique within the project
    void
    validateNewChainForExistingProject(@NotNull com.atlassian.struts.ValidationAware validationAware, String existingProjectKey, String chainKey, String chainName)
    Validate that new chain name and key is unique within the project
    void
    validateNewJobForExistingChain(@NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull Chain existingChain, @NotNull String buildKey, @Nullable String buildName)
     
    void
    validateNewPlanBranchForMaster(@NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull ImmutableChain masterChain, @NotNull String branchName)
    Validate that new plan branch name (only) is unique within a set of branches with a common master
    void
    validateNewPlanDetails(@NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable String buildKey, @Nullable String buildName)
    Ensure that the build key and name are valid
    void
    validateNewProjectDetails(@NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable String projectName, @Nullable String projectKey)
    void
    validateNewProjectDetails(@NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable String projectName, @Nullable String projectKey, @Nullable String projectDescription)
    Validate that the new project details are valid
    void
    validateNewStageForChain(com.atlassian.struts.ValidationAware validationAware, Chain chain, String stageName)
    Validate the the new stage can be added to the given chain
    void
    validatePlanToCloneExists(@NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable String buildKeyToClone)
    Validate that the plan t clone exists
    void
    validateStageExistsForChain(com.atlassian.struts.ValidationAware validationAware, Chain chain, String stageName)
    Ensures that the stage currently exists for a chain
  • Field Details

  • Method Details

    • validateKey

      void validateKey(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String key)
      Validate any String against Bamboo's generic rules for keys.
      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

      void validateName(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String name)
      Validate any String against Bamboo's generic rules for names.
      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

      void validateDescription(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String description)
      Validate the description field of any object. All it really does is check length
      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

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

      void validateNewPlanDetails(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable @Nullable String buildKey, @Nullable @Nullable String buildName)
      Ensure that the build key and name are valid
      Parameters:
      validationAware - - object to add errors to if any are found
      buildKey - - the key for the plan
      buildName - - the name for the plan
    • validateNewJobForExistingChain

      void validateNewJobForExistingChain(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull @NotNull Chain existingChain, @NotNull @NotNull String buildKey, @Nullable @Nullable String buildName)
      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

      void validateNewChainForExistingProject(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String existingProjectKey, String chainKey, String chainName)
      Validate that new chain name and key is unique within the project
      Parameters:
      validationAware - - object to add errors to if any are found
      existingProjectKey - - the key of an existing project
      chainKey - - the key for the new chain
      chainName - - the name of the new chain
    • validateNewChainForExistingProject

      void validateNewChainForExistingProject(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull @NotNull String existingProjectKey, @NotNull @NotNull String chainName)
      Validate that new chain name (only) is unique within the project
      Parameters:
      validationAware - - object to add errors to if any are found
      existingProjectKey - - the key of an existing project
      chainName - - the name of the new chain
    • validateNewPlanBranchForMaster

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

      @Deprecated void validateNewProjectDetails(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable @Nullable String projectName, @Nullable @Nullable String projectKey)
      Validate that the new project details are valid
      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

      void validateNewProjectDetails(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable @Nullable String projectName, @Nullable @Nullable String projectKey, @Nullable @Nullable String projectDescription)
      Validate that the new project details are valid
      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

      void validateNewStageForChain(com.atlassian.struts.ValidationAware validationAware, Chain chain, String stageName)
      Validate the the new stage can be added to the given chain
      Parameters:
      validationAware - - to add any errors to
      chain - - the chain the stage will be added to
      stageName - - the stage to be added
    • validateStageExistsForChain

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