Package com.atlassian.bamboo.project
Class ProjectConfigurationServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.project.ProjectConfigurationServiceImpl
-
- All Implemented Interfaces:
ProjectConfigurationService
public class ProjectConfigurationServiceImpl extends Object implements ProjectConfigurationService
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROJECT_DESCRIPTION_FIELD
static String
PROJECT_KEY_FIELD
static String
PROJECT_NAME_FIELD
-
Constructor Summary
Constructors Constructor Description ProjectConfigurationServiceImpl(PlanManager planManager, ProjectManager projectManager, com.atlassian.struts.TextProvider textProvider, ValidationService validationService, AuditLogService auditLogService, com.atlassian.event.api.EventPublisher eventPublisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Project
createProject(@NotNull String projectKey, @NotNull String projectName, @Nullable String projectDescription, boolean grantAllUsersReadAccess)
Creates and persists a newProject
, throwing an exception on invalid data.void
markProjectForDeletion(@NotNull Project project)
Marks a project for deletion.void
updateProject(@NotNull Project project, @NotNull String projectName, @Nullable String projectDescription)
Updates and persists changes for an existingProject
, throwing exception on invalid data.@NotNull ErrorCollection
validateProjectForCreation(@NotNull String projectKeyField, @Nullable String projectKey, @NotNull String projectNameField, @Nullable String projectName, @NotNull String projectDescriptionField, @Nullable String projectDescription)
Perform validation of data for creation of a newProject
.@NotNull ErrorCollection
validateProjectForCreation(@Nullable String projectKey, @Nullable String projectName, @Nullable String projectDescription)
Perform validation of data for creation of a newProject
.@NotNull ErrorCollection
validateProjectForUpdate(@NotNull String projectKey, @NotNull String projectNameField, @Nullable String projectName, @NotNull String projectDescriptionField, @Nullable String projectDescription)
Perform validation of data for updating details of an existingProject
.@NotNull ErrorCollection
validateProjectForUpdate(@NotNull String projectKey, @Nullable String projectName, @Nullable String projectDescription)
Perform validation of data for updating details of an existingProject
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.project.ProjectConfigurationService
createProject
-
-
-
-
Constructor Detail
-
ProjectConfigurationServiceImpl
@Autowired public ProjectConfigurationServiceImpl(PlanManager planManager, ProjectManager projectManager, com.atlassian.struts.TextProvider textProvider, ValidationService validationService, AuditLogService auditLogService, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Detail
-
validateProjectForCreation
@NotNull public @NotNull ErrorCollection validateProjectForCreation(@Nullable @Nullable String projectKey, @Nullable @Nullable String projectName, @Nullable @Nullable String projectDescription)
Description copied from interface:ProjectConfigurationService
Perform validation of data for creation of a newProject
.- Specified by:
validateProjectForCreation
in interfaceProjectConfigurationService
- Parameters:
projectKey
- key of the projectprojectName
- project nameprojectDescription
- project description- Returns:
- collection of all validation errors, empty if validation was successful
-
validateProjectForCreation
@NotNull public @NotNull ErrorCollection validateProjectForCreation(@NotNull @NotNull String projectKeyField, @Nullable @Nullable String projectKey, @NotNull @NotNull String projectNameField, @Nullable @Nullable String projectName, @NotNull @NotNull String projectDescriptionField, @Nullable @Nullable String projectDescription)
Description copied from interface:ProjectConfigurationService
Perform validation of data for creation of a newProject
.This is a more specific version of
ProjectConfigurationService.validateProjectForCreation(String, String, String)
, allowing configuration of field names to generate more accurateErrorCollection
.- Specified by:
validateProjectForCreation
in interfaceProjectConfigurationService
- Parameters:
projectKeyField
- field used to configure project keyprojectKey
- key of the projectprojectNameField
- field used to configure project nameprojectName
- project nameprojectDescriptionField
- field used to configure project descriptionprojectDescription
- project description- Returns:
- collection of all validation errors, empty if validation was successful
-
createProject
@NotNull public @NotNull Project createProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String projectName, @Nullable @Nullable String projectDescription, boolean grantAllUsersReadAccess) throws WebValidationException
Description copied from interface:ProjectConfigurationService
Creates and persists a newProject
, throwing an exception on invalid data. Prior to calling this method data should be validated by callingProjectConfigurationService.validateProjectForCreation(String, String, String)
.- Specified by:
createProject
in interfaceProjectConfigurationService
- Parameters:
projectKey
- key of the projectprojectName
- project nameprojectDescription
- project descriptiongrantAllUsersReadAccess
- grant anonymous and logged-in users READ permissions- Returns:
- new instance of the project, after persisting it to the database
- Throws:
WebValidationException
- in case of validation errors
-
validateProjectForUpdate
@NotNull public @NotNull ErrorCollection validateProjectForUpdate(@NotNull @NotNull String projectKey, @Nullable @Nullable String projectName, @Nullable @Nullable String projectDescription)
Description copied from interface:ProjectConfigurationService
Perform validation of data for updating details of an existingProject
.- Specified by:
validateProjectForUpdate
in interfaceProjectConfigurationService
- Parameters:
projectKey
- key of the projectprojectName
- new project nameprojectDescription
- new project description- Returns:
- collection of all validation errors, empty if validation was successful
-
validateProjectForUpdate
@NotNull public @NotNull ErrorCollection validateProjectForUpdate(@NotNull @NotNull String projectKey, @NotNull @NotNull String projectNameField, @Nullable @Nullable String projectName, @NotNull @NotNull String projectDescriptionField, @Nullable @Nullable String projectDescription)
Description copied from interface:ProjectConfigurationService
Perform validation of data for updating details of an existingProject
.This is a more specific version of
ProjectConfigurationService.validateProjectForUpdate(String, String, String)
, allowing configuration of field names to generate more accurateErrorCollection
.- Specified by:
validateProjectForUpdate
in interfaceProjectConfigurationService
- Parameters:
projectKey
- key of the projectprojectNameField
- field used to configure project nameprojectName
- new project nameprojectDescriptionField
- field used to configure project descriptionprojectDescription
- new project description- Returns:
- collection of all validation errors, empty if validation was successful
-
updateProject
public void updateProject(@NotNull @NotNull Project project, @NotNull @NotNull String projectName, @Nullable @Nullable String projectDescription) throws WebValidationException
Description copied from interface:ProjectConfigurationService
Updates and persists changes for an existingProject
, throwing exception on invalid data. Prior to calling this method data should be validated by callingProjectConfigurationService.validateProjectForUpdate(String, String, String)
.- Specified by:
updateProject
in interfaceProjectConfigurationService
- Parameters:
project
- project to updateprojectName
- new project nameprojectDescription
- new project description- Throws:
WebValidationException
- in case of validation errors
-
markProjectForDeletion
public void markProjectForDeletion(@NotNull @NotNull Project project)
Description copied from interface:ProjectConfigurationService
Marks a project for deletion. Project will be deleted from the database according to background deletion schedule. Project must be empty prior to calling this method (there can't be any plans within the project that are not marked for deletion).- Specified by:
markProjectForDeletion
in interfaceProjectConfigurationService
- Parameters:
project
- project to delete
-
-