com.atlassian.bamboo.build.creation
Interface PlanValidationService

All Known Implementing Classes:
PlanValidationServiceImpl

public interface PlanValidationService

A stateless, non-transactional service that provides common services for plan validation


Field Summary
static java.lang.String KEY_REGEXP
          Regular expression matching a valid key.
 
Method Summary
 PlanConfigHelper getBuilderConfigHelper()
           
 PlanConfigHelper getBuildStrategyConfigHelper()
           
 PlanConfigHelper getRepositoryConfigHelper()
           
 PlanConfigHelper getWebRepositoryConfigHelper()
           
 void validateDescription(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String fieldName, java.lang.String description)
          Validate the description field of any object.
 void validateKey(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String fieldName, java.lang.String errorPrefix, java.lang.String key)
          Validate any String against Bamboo's generic rules for keys.
 void validateName(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String fieldName, java.lang.String errorPrefix, java.lang.String name)
          Validate any String against Bamboo's generic rules for names.
 void validateNewBuildForExistingProject(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String existingProjectKey, java.lang.String buildKey, java.lang.String buildName)
          Validate that name new plan is unique within the project
 void validateNewChainForExistingProject(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String existingProjectKey, java.lang.String chainKey, java.lang.String chainName)
          Validate that name new chain is unique within the project
 void validateNewJobForExistingChain(com.opensymphony.xwork.ValidationAware validationAware, Chain existingChain, java.lang.String buildKey, java.lang.String buildName)
           
 void validateNewPlanDetails(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String buildKey, java.lang.String buildName)
          Ensure that the build key & name are valid
 void validateNewProjectDetails(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String projectName, java.lang.String projectKey)
          Validate that the new project details are valid
 void validateNewStageForChain(com.opensymphony.xwork.ValidationAware validationAware, Chain chain, java.lang.String stageName)
          Validate the the new stage can be added to the given chain
 void validatePlanToCloneExists(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String buildKeyToClone)
          Validate that the plan t clone exists
 void validateStageExistsForChain(com.opensymphony.xwork.ValidationAware validationAware, Chain chain, java.lang.String stageName)
          Ensures that the stage currently exists for a chain
 

Field Detail

KEY_REGEXP

static final java.lang.String KEY_REGEXP
Regular expression matching a valid key.

See Also:
Constant Field Values
Method Detail

validateKey

void validateKey(@NotNull
                 com.opensymphony.xwork.ValidationAware validationAware,
                 java.lang.String fieldName,
                 java.lang.String errorPrefix,
                 java.lang.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
                  com.opensymphony.xwork.ValidationAware validationAware,
                  java.lang.String fieldName,
                  java.lang.String errorPrefix,
                  java.lang.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
                         com.opensymphony.xwork.ValidationAware validationAware,
                         java.lang.String fieldName,
                         java.lang.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
                               com.opensymphony.xwork.ValidationAware validationAware,
                               @Nullable
                               java.lang.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
                            com.opensymphony.xwork.ValidationAware validationAware,
                            @Nullable
                            java.lang.String buildKey,
                            @Nullable
                            java.lang.String buildName)
Ensure that the build key & 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

validateNewBuildForExistingProject

void validateNewBuildForExistingProject(@NotNull
                                        com.opensymphony.xwork.ValidationAware validationAware,
                                        @Nullable
                                        java.lang.String existingProjectKey,
                                        @Nullable
                                        java.lang.String buildKey,
                                        @Nullable
                                        java.lang.String buildName)
Validate that name new plan is unique within the project

Parameters:
validationAware - - object to add errors to if any are found
existingProjectKey - - the key of an existing project
buildKey - - the key for the new plan
buildName - - the name of the new plan

validateNewJobForExistingChain

void validateNewJobForExistingChain(@NotNull
                                    com.opensymphony.xwork.ValidationAware validationAware,
                                    @NotNull
                                    Chain existingChain,
                                    @NotNull
                                    java.lang.String buildKey,
                                    @Nullable
                                    java.lang.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
                                        com.opensymphony.xwork.ValidationAware validationAware,
                                        java.lang.String existingProjectKey,
                                        java.lang.String chainKey,
                                        java.lang.String chainName)
Validate that name new chain 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

validateNewProjectDetails

void validateNewProjectDetails(@NotNull
                               com.opensymphony.xwork.ValidationAware validationAware,
                               @Nullable
                               java.lang.String projectName,
                               @Nullable
                               java.lang.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

validateNewStageForChain

void validateNewStageForChain(com.opensymphony.xwork.ValidationAware validationAware,
                              Chain chain,
                              java.lang.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.opensymphony.xwork.ValidationAware validationAware,
                                 Chain chain,
                                 java.lang.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

getRepositoryConfigHelper

PlanConfigHelper getRepositoryConfigHelper()
Returns:
Helper object to manipulate repository configuration

getBuildStrategyConfigHelper

PlanConfigHelper getBuildStrategyConfigHelper()
Returns:
Helper object to manipulate build strategy configuration

getBuilderConfigHelper

PlanConfigHelper getBuilderConfigHelper()
Returns:
Helper object to manipulate builder configuration

getWebRepositoryConfigHelper

PlanConfigHelper getWebRepositoryConfigHelper()
Returns:
Helper object to manipulate web repository configuration


Copyright © 2011 Atlassian. All Rights Reserved.