Class ProjectImportServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.configuration.external.ProjectImportServiceImpl
-
- All Implemented Interfaces:
ProjectImportService
public class ProjectImportServiceImpl extends Object implements ProjectImportService
-
-
Constructor Summary
Constructors Constructor Description ProjectImportServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties
convertYamlToProject(@NotNull String yaml)
Converts data from a YAML document to project properties.@NotNull com.atlassian.bamboo.specs.api.model.permission.ProjectPermissionsProperties
convertYamlToProjectPermissions(@NotNull String yaml)
Converts data from a YAML document to project permissions properties.@NotNull Project
importProject(@NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties projectProperties, @Nullable com.atlassian.user.User user, @NotNull RssPermissions rssPermissions)
Validates project properties within Bamboo context and imports the projects into the database.@NotNull Project
importProject(@NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties projectProperties, @Nullable com.atlassian.user.User user, @NotNull RssPermissions rssPermissions, boolean noChangesInProperties)
Validates project properties within Bamboo context and imports the project into the database.void
importProjectPermissions(@NotNull com.atlassian.bamboo.specs.api.model.permission.ProjectPermissionsProperties permissionsProperties, @NotNull RssPermissions rssPermissions)
Imports the project permissions properties.void
validateProjectProperties(@NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties projectProperties)
Validates project properties without Bamboo context (no database integrity is verified).
-
-
-
Method Detail
-
convertYamlToProject
@NotNull public @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties convertYamlToProject(@NotNull @NotNull String yaml) throws YamlValidationException
Description copied from interface:ProjectImportService
Converts data from a YAML document to project properties.- Specified by:
convertYamlToProject
in interfaceProjectImportService
- Parameters:
yaml
- YAML String containing definition of a project- Returns:
- project properties
- Throws:
YamlValidationException
- if the format of the YAML file is invalid
-
validateProjectProperties
public void validateProjectProperties(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties projectProperties) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
Description copied from interface:ProjectImportService
Validates project properties without Bamboo context (no database integrity is verified).- Specified by:
validateProjectProperties
in interfaceProjectImportService
- Parameters:
projectProperties
- project properties to import- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if the imported properties were not valid
-
importProject
@NotNull public @NotNull Project importProject(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties projectProperties, @Nullable @Nullable com.atlassian.user.User user, @NotNull @NotNull RssPermissions rssPermissions) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, RssPermissionException, UnauthorisedException
Description copied from interface:ProjectImportService
Validates project properties within Bamboo context and imports the projects into the database.- Specified by:
importProject
in interfaceProjectImportService
- Parameters:
projectProperties
- project properties to importuser
- user invoking the importrssPermissions
- projects which are allowed for modification- Returns:
- saved project entity
- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if data validation failedRssPermissionException
- if RSS doesn't have access to the projectUnauthorisedException
- if any other type of permission is missing
-
importProject
@NotNull public @NotNull Project importProject(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties projectProperties, @Nullable @Nullable com.atlassian.user.User user, @NotNull @NotNull RssPermissions rssPermissions, boolean noChangesInProperties) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, RssPermissionException, UnauthorisedException
Description copied from interface:ProjectImportService
Validates project properties within Bamboo context and imports the project into the database.- Specified by:
importProject
in interfaceProjectImportService
- Parameters:
projectProperties
- project properties to importuser
- user invoking the importrssPermissions
- projects which are allowed for modification- Returns:
- saved project entity
- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if data validation failedRssPermissionException
- if RSS doesn't have access to the projectUnauthorisedException
- if any other type of permission is missing
-
convertYamlToProjectPermissions
@NotNull public @NotNull com.atlassian.bamboo.specs.api.model.permission.ProjectPermissionsProperties convertYamlToProjectPermissions(@NotNull @NotNull String yaml) throws YamlValidationException, com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
Description copied from interface:ProjectImportService
Converts data from a YAML document to project permissions properties.- Specified by:
convertYamlToProjectPermissions
in interfaceProjectImportService
- Parameters:
yaml
- YAML String containing definition of project permissions- Returns:
- project permissions properties
- Throws:
YamlValidationException
- if the format of the YAML file is invalidcom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if data validation failed
-
importProjectPermissions
public void importProjectPermissions(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.permission.ProjectPermissionsProperties permissionsProperties, @NotNull @NotNull RssPermissions rssPermissions) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, UnauthorisedException
Description copied from interface:ProjectImportService
Imports the project permissions properties.- Specified by:
importProjectPermissions
in interfaceProjectImportService
- Parameters:
permissionsProperties
- project permissions properties to importrssPermissions
- projects which are allowed for modification- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if data validation failedUnauthorisedException
- if any other type of permission is missing
-
-