Class PlanValidationServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.build.creation.PlanValidationServiceImpl
-
- All Implemented Interfaces:
PlanValidationService,PlanValidationServiceXWork1
public class PlanValidationServiceImpl extends Object implements PlanValidationService
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHAIN_PREFIXstatic StringJOB_PREFIXstatic PatternKEY_PATTERNstatic StringPLAN_PREFIXstatic StringPROJECT_PREFIXstatic StringSTAGE_PREFIX-
Fields inherited from interface com.atlassian.bamboo.build.creation.PlanValidationService
KEY_REGEXP
-
-
Constructor Summary
Constructors Constructor Description PlanValidationServiceImpl(ValidationService validationService, ProjectManager projectManager, PlanManager planManager, com.opensymphony.xwork2.TextProvider textProvider, ChainBranchManager chainBranchManager, ProjectConfigurationService projectConfigurationService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidateDescription(@NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String description)Validate the description field of any object.voidvalidateDescription(com.opensymphony.xwork.ValidationAware validationAware, String fieldName, String description)Validate the description field of any object.voidvalidateKey(@NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String key)Validate any String against Bamboo's generic rules for keys.voidvalidateKey(com.opensymphony.xwork.ValidationAware validationAware, String fieldName, String errorPrefix, String key)Validate any String against Bamboo's generic rules for keys.voidvalidateName(@NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String name)Validate any String against Bamboo's generic rules for names.voidvalidateName(com.opensymphony.xwork.ValidationAware validationAware, String fieldName, String errorPrefix, String name)Validate any String against Bamboo's generic rules for names.voidvalidateNewChainForExistingProject(@NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull String existingProjectKey, @NotNull String buildName)Validate that new chain name (only) is unique within the projectvoidvalidateNewChainForExistingProject(@NotNull com.atlassian.struts.ValidationAware validationAware, String existingProjectKey, String buildKey, String buildName)Validate that new chain name and key is unique within the projectvoidvalidateNewChainForExistingProject(com.opensymphony.xwork.ValidationAware validationAware, @NotNull String existingProjectKey, @NotNull String chainName)Validate that new chain name (only) is unique within the projectvoidvalidateNewChainForExistingProject(com.opensymphony.xwork.ValidationAware validationAware, String existingProjectKey, String chainKey, String chainName)Validate that new chain name and key is unique within the projectvoidvalidateNewJobForExistingChain(@NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull Chain existingChain, @NotNull String buildKey, @Nullable String buildName)voidvalidateNewJobForExistingChain(com.opensymphony.xwork.ValidationAware validationAware, @NotNull Chain existingChain, @NotNull String buildKey, @Nullable String buildName)voidvalidateNewPlanBranchForMaster(@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 mastervoidvalidateNewPlanBranchForMaster(com.opensymphony.xwork.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 mastervoidvalidateNewPlanDetails(@NotNull com.atlassian.struts.ValidationAware validationAware, String buildKey, String buildName)Ensure that the build key and name are validvoidvalidateNewPlanDetails(com.opensymphony.xwork.ValidationAware validationAware, @Nullable String buildKey, @Nullable String buildName)Ensure that the build key and name are validvoidvalidateNewProjectDetails(@NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable String projectName, @Nullable String projectKey, @Nullable String projectDescription)Validate that the new project details are validvoidvalidateNewProjectDetails(@NotNull com.atlassian.struts.ValidationAware validationAware, String projectName, String projectKey)Validate that the new project details are validvoidvalidateNewProjectDetails(com.opensymphony.xwork.ValidationAware validationAware, @Nullable String projectName, @Nullable String projectKey)Validate that the new project details are validvoidvalidateNewStageForChain(@NotNull com.atlassian.struts.ValidationAware validationAware, @NotNull Chain chain, @Nullable String stageName)Validate the the new stage can be added to the given chainvoidvalidateNewStageForChain(com.opensymphony.xwork.ValidationAware validationAware, Chain chain, String stageName)Validate the the new stage can be added to the given chainvoidvalidatePlanToCloneExists(@NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable String buildKeyToClone)Validate that the plan t clone existsvoidvalidatePlanToCloneExists(com.opensymphony.xwork.ValidationAware validationAware, @Nullable String buildKeyToClone)Validate that the plan t clone existsvoidvalidateStageExistsForChain(com.atlassian.struts.ValidationAware validationAware, Chain chain, String stageName)Ensures that the stage currently exists for a chainvoidvalidateStageExistsForChain(com.opensymphony.xwork.ValidationAware validationAware, Chain chain, String stageName)Ensures that the stage currently exists for a chain
-
-
-
Field Detail
-
KEY_PATTERN
public static final Pattern KEY_PATTERN
-
PLAN_PREFIX
public static final String PLAN_PREFIX
- See Also:
- Constant Field Values
-
PROJECT_PREFIX
public static final String PROJECT_PREFIX
- See Also:
- Constant Field Values
-
CHAIN_PREFIX
public static final String CHAIN_PREFIX
- See Also:
- Constant Field Values
-
JOB_PREFIX
public static final String JOB_PREFIX
- See Also:
- Constant Field Values
-
STAGE_PREFIX
public static final String STAGE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlanValidationServiceImpl
public PlanValidationServiceImpl(ValidationService validationService, ProjectManager projectManager, PlanManager planManager, com.opensymphony.xwork2.TextProvider textProvider, ChainBranchManager chainBranchManager, ProjectConfigurationService projectConfigurationService)
-
-
Method Detail
-
validateKey
public void validateKey(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, String fieldName, String errorPrefix, String key)Description copied from interface:PlanValidationServiceValidate any String against Bamboo's generic rules for keys.- Specified by:
validateKeyin interfacePlanValidationService- Parameters:
validationAware- - the object to add errors to if any are foundfieldName- - the name of the field to add the errors toerrorPrefix- - 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:PlanValidationServiceValidate any String against Bamboo's generic rules for names.- Specified by:
validateNamein interfacePlanValidationService- Parameters:
validationAware- - the object to add errors to if any are foundfieldName- - the name of the field to add the errors toerrorPrefix- - 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:PlanValidationServiceValidate the description field of any object. All it really does is check length- Specified by:
validateDescriptionin interfacePlanValidationService- Parameters:
validationAware- - the object to add errors to if any are foundfieldName- - the name of the field to add the errors todescription- - the actual text to validate
-
validatePlanToCloneExists
public void validatePlanToCloneExists(@NotNull @NotNull com.atlassian.struts.ValidationAware validationAware, @Nullable @Nullable String buildKeyToClone)Description copied from interface:PlanValidationServiceValidate that the plan t clone exists- Specified by:
validatePlanToCloneExistsin interfacePlanValidationService- Parameters:
validationAware- - object to add errors to if any are foundbuildKeyToClone- - 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:PlanValidationServiceEnsure that the build key and name are valid- Specified by:
validateNewPlanDetailsin interfacePlanValidationService- Parameters:
validationAware- - object to add errors to if any are foundbuildKey- - the key for the planbuildName- - 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:
validateNewJobForExistingChainin interfacePlanValidationService- Parameters:
validationAware- - object to add errors to if any are foundexistingChain- - the chain the new job will be added tobuildKey- - the key for the jobbuildName- - 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:PlanValidationServiceValidate that new chain name and key is unique within the project- Specified by:
validateNewChainForExistingProjectin interfacePlanValidationService- Parameters:
validationAware- - object to add errors to if any are foundexistingProjectKey- - the key of an existing projectbuildKey- - the key for the new chainbuildName- - 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:PlanValidationServiceValidate that new chain name (only) is unique within the project- Specified by:
validateNewChainForExistingProjectin interfacePlanValidationService- Parameters:
validationAware- - object to add errors to if any are foundexistingProjectKey- - the key of an existing projectbuildName- - 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:PlanValidationServiceValidate that new plan branch name (only) is unique within a set of branches with a common master- Specified by:
validateNewPlanBranchForMasterin interfacePlanValidationService- Parameters:
validationAware- object to add errors to if any are foundmasterChain- the master chainbranchName- 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:PlanValidationServiceValidate that the new project details are valid- Specified by:
validateNewProjectDetailsin interfacePlanValidationService- Parameters:
validationAware- object to add errors to if any are foundprojectName- name of the project to validateprojectKey- 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:PlanValidationServiceValidate that the new project details are valid- Specified by:
validateNewProjectDetailsin interfacePlanValidationService- Parameters:
validationAware- object to add errors to if any are foundprojectName- name of the project to validateprojectKey- key of the project to validateprojectDescription- 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:PlanValidationServiceValidate the the new stage can be added to the given chain- Specified by:
validateNewStageForChainin interfacePlanValidationService- Parameters:
validationAware- - to add any errors tochain- - the chain the stage will be added tostageName- - the stage to be added
-
validateStageExistsForChain
public void validateStageExistsForChain(com.atlassian.struts.ValidationAware validationAware, Chain chain, String stageName)Description copied from interface:PlanValidationServiceEnsures that the stage currently exists for a chain- Specified by:
validateStageExistsForChainin interfacePlanValidationService- Parameters:
validationAware- - to add the errors tochain- - the chain the stage should exist instageName- - the stage to check for
-
validateKey
public void validateKey(@NotNull com.opensymphony.xwork.ValidationAware validationAware, String fieldName, String errorPrefix, String key)Description copied from interface:PlanValidationServiceXWork1Validate any String against Bamboo's generic rules for keys.- Specified by:
validateKeyin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - the object to add errors to if any are foundfieldName- - the name of the field to add the errors toerrorPrefix- - 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 com.opensymphony.xwork.ValidationAware validationAware, String fieldName, String errorPrefix, String name)Description copied from interface:PlanValidationServiceXWork1Validate any String against Bamboo's generic rules for names.- Specified by:
validateNamein interfacePlanValidationServiceXWork1- Parameters:
validationAware- - the object to add errors to if any are foundfieldName- - the name of the field to add the errors toerrorPrefix- - 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 com.opensymphony.xwork.ValidationAware validationAware, String fieldName, String description)Description copied from interface:PlanValidationServiceXWork1Validate the description field of any object. All it really does is check length- Specified by:
validateDescriptionin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - the object to add errors to if any are foundfieldName- - the name of the field to add the errors todescription- - the actual text to validate
-
validatePlanToCloneExists
public void validatePlanToCloneExists(@NotNull com.opensymphony.xwork.ValidationAware validationAware, @Nullable @Nullable String buildKeyToClone)Description copied from interface:PlanValidationServiceXWork1Validate that the plan t clone exists- Specified by:
validatePlanToCloneExistsin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - object to add errors to if any are foundbuildKeyToClone- - the key of the plan to clone
-
validateNewPlanDetails
public void validateNewPlanDetails(@NotNull com.opensymphony.xwork.ValidationAware validationAware, @Nullable @Nullable String buildKey, @Nullable @Nullable String buildName)Description copied from interface:PlanValidationServiceXWork1Ensure that the build key and name are valid- Specified by:
validateNewPlanDetailsin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - object to add errors to if any are foundbuildKey- - the key for the planbuildName- - the name for the plan
-
validateNewJobForExistingChain
public void validateNewJobForExistingChain(@NotNull com.opensymphony.xwork.ValidationAware validationAware, @NotNull @NotNull Chain existingChain, @NotNull @NotNull String buildKey, @Nullable @Nullable String buildName)- Specified by:
validateNewJobForExistingChainin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - object to add errors to if any are foundexistingChain- - the chain the new job will be added tobuildKey- - the key for the jobbuildName- - the name for the job.
-
validateNewChainForExistingProject
public void validateNewChainForExistingProject(@NotNull com.opensymphony.xwork.ValidationAware validationAware, String existingProjectKey, String chainKey, String chainName)Description copied from interface:PlanValidationServiceXWork1Validate that new chain name and key is unique within the project- Specified by:
validateNewChainForExistingProjectin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - object to add errors to if any are foundexistingProjectKey- - the key of an existing projectchainKey- - the key for the new chainchainName- - the name of the new chain
-
validateNewChainForExistingProject
public void validateNewChainForExistingProject(@NotNull com.opensymphony.xwork.ValidationAware validationAware, @NotNull @NotNull String existingProjectKey, @NotNull @NotNull String chainName)Description copied from interface:PlanValidationServiceXWork1Validate that new chain name (only) is unique within the project- Specified by:
validateNewChainForExistingProjectin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - object to add errors to if any are foundexistingProjectKey- - the key of an existing projectchainName- - the name of the new chain
-
validateNewPlanBranchForMaster
public void validateNewPlanBranchForMaster(@NotNull com.opensymphony.xwork.ValidationAware validationAware, @NotNull @NotNull ImmutableChain masterChain, @NotNull @NotNull String branchName)Description copied from interface:PlanValidationServiceXWork1Validate that new plan branch name (only) is unique within a set of branches with a common master- Specified by:
validateNewPlanBranchForMasterin interfacePlanValidationServiceXWork1- Parameters:
validationAware- object to add errors to if any are foundmasterChain- the master chainbranchName- the name of the new chain
-
validateNewProjectDetails
public void validateNewProjectDetails(@NotNull com.opensymphony.xwork.ValidationAware validationAware, @Nullable @Nullable String projectName, @Nullable @Nullable String projectKey)Description copied from interface:PlanValidationServiceXWork1Validate that the new project details are valid- Specified by:
validateNewProjectDetailsin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - object to add errors to if any are foundprojectName- - name of the project to validateprojectKey- - key of the project to validate
-
validateNewStageForChain
public void validateNewStageForChain(com.opensymphony.xwork.ValidationAware validationAware, Chain chain, String stageName)Description copied from interface:PlanValidationServiceXWork1Validate the the new stage can be added to the given chain- Specified by:
validateNewStageForChainin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - to add any errors tochain- - the chain the stage will be added tostageName- - the stage to be added
-
validateStageExistsForChain
public void validateStageExistsForChain(com.opensymphony.xwork.ValidationAware validationAware, Chain chain, String stageName)Description copied from interface:PlanValidationServiceXWork1Ensures that the stage currently exists for a chain- Specified by:
validateStageExistsForChainin interfacePlanValidationServiceXWork1- Parameters:
validationAware- - to add the errors tochain- - the chain the stage should exist instageName- - the stage to check for
-
-