Package com.atlassian.bamboo.project
Interface ProjectConfigurationService
-
- All Known Implementing Classes:
ProjectConfigurationServiceImpl
public interface ProjectConfigurationService
Utility service for seamless configuration ofprojects
.- Since:
- 6.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default @NotNull Project
createProject(@NotNull String projectKey, @NotNull String projectName, @Nullable String projectDescription)
Deprecated.since 6.9.0.@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
.
-
-
-
Method Detail
-
validateProjectForCreation
@NotNull @NotNull ErrorCollection validateProjectForCreation(@Nullable @Nullable String projectKey, @Nullable @Nullable String projectName, @Nullable @Nullable String projectDescription)
Perform validation of data for creation of a newProject
.- Parameters:
projectKey
- key of the projectprojectName
- project nameprojectDescription
- project description- Returns:
- collection of all validation errors, empty if validation was successful
-
validateProjectForCreation
@NotNull @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)
Perform validation of data for creation of a newProject
.This is a more specific version of
validateProjectForCreation(String, String, String)
, allowing configuration of field names to generate more accurateErrorCollection
.- 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 @Deprecated default @NotNull Project createProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String projectName, @Nullable @Nullable String projectDescription) throws WebValidationException
Deprecated.since 6.9.0. UsecreateProject(String, String, String, boolean)
Creates and persists a newProject
, throwing an exception on invalid data. Prior to calling this method data should be validated by callingvalidateProjectForCreation(String, String, String)
.- Parameters:
projectKey
- key of the projectprojectName
- project nameprojectDescription
- project description- Returns:
- new instance of the project, after persisting it to the database
- Throws:
WebValidationException
- in case of validation errors
-
createProject
@NotNull @NotNull Project createProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String projectName, @Nullable @Nullable String projectDescription, boolean grantAllUsersReadAccess) throws WebValidationException
Creates and persists a newProject
, throwing an exception on invalid data. Prior to calling this method data should be validated by callingvalidateProjectForCreation(String, String, String)
.- 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 @NotNull ErrorCollection validateProjectForUpdate(@NotNull @NotNull String projectKey, @Nullable @Nullable String projectName, @Nullable @Nullable String projectDescription)
Perform validation of data for updating details of an existingProject
.- 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 @NotNull ErrorCollection validateProjectForUpdate(@NotNull @NotNull String projectKey, @NotNull @NotNull String projectNameField, @Nullable @Nullable String projectName, @NotNull @NotNull String projectDescriptionField, @Nullable @Nullable String projectDescription)
Perform validation of data for updating details of an existingProject
.This is a more specific version of
validateProjectForUpdate(String, String, String)
, allowing configuration of field names to generate more accurateErrorCollection
.- 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
void updateProject(@NotNull @NotNull Project project, @NotNull @NotNull String projectName, @Nullable @Nullable String projectDescription) throws WebValidationException
Updates and persists changes for an existingProject
, throwing exception on invalid data. Prior to calling this method data should be validated by callingvalidateProjectForUpdate(String, String, String)
.- Parameters:
project
- project to updateprojectName
- new project nameprojectDescription
- new project description- Throws:
WebValidationException
- in case of validation errors
-
markProjectForDeletion
void markProjectForDeletion(@NotNull @NotNull Project project) throws IllegalStateException
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).- Parameters:
project
- project to delete- Throws:
IllegalStateException
- in case of illegal state of the project
-
-