Class DeploymentImportServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.configuration.external.DeploymentImportServiceImpl
-
- All Implemented Interfaces:
DeploymentImportService
public class DeploymentImportServiceImpl extends Object implements DeploymentImportService
-
-
Constructor Summary
Constructors Constructor Description DeploymentImportServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull com.atlassian.bamboo.specs.api.model.deployment.DeploymentProperties
convertYamlToDeployment(@NotNull String yaml, @NotNull RssPermissions rssPermissions)
Converts data from a YAML document to deployment properties.@NotNull com.atlassian.bamboo.specs.api.model.permission.DeploymentPermissionsProperties
convertYamlToDeploymentPermissions(String yaml)
Converts data from a YAML document to deployment permissions properties.@NotNull com.atlassian.bamboo.specs.api.model.permission.EnvironmentPermissionsProperties
convertYamlToEnvironmentPermissions(String yaml)
Converts data from a YAML document to environment permissions properties.@NotNull DeploymentProject
importDeployment(@NotNull com.atlassian.bamboo.specs.api.model.deployment.DeploymentProperties deploymentProperties, @Nullable com.atlassian.user.User user, @NotNull RssPermissions rssPermissions, boolean noChangesInProperties)
Validates exported deployment properties within Bamboo context (e.g.void
importDeploymentEnvironmentPermissions(@NotNull com.atlassian.bamboo.specs.api.model.permission.EnvironmentPermissionsProperties environmentPermission, @NotNull RssPermissions rssPermissions)
Import permissions for deployment environment.void
importDeploymentPermissions(@NotNull com.atlassian.bamboo.specs.api.model.permission.DeploymentPermissionsProperties deploymentPermission, @NotNull RssPermissions rssPermissions)
Import permissions for deployment project.void
importDeploymentPermissions(@Nullable String deploymentName, @Nullable com.atlassian.bamboo.specs.api.model.BambooOidProperties deploymentOid, @NotNull com.atlassian.bamboo.specs.api.model.permission.PermissionsProperties defaultEnvironmentPermissions, @NotNull List<com.atlassian.bamboo.specs.api.model.permission.EnvironmentPermissionsProperties> environmentPermissions, @NotNull RssPermissions rssPermissions)
Import environments permissions in a bulk.void
validate(com.atlassian.bamboo.specs.api.model.deployment.DeploymentProperties deploymentProperties, @NotNull RssPermissions rssPermissions)
Validates exported deployment properties within Bamboo context (e.g.
-
-
-
Method Detail
-
convertYamlToDeployment
@NotNull public @NotNull com.atlassian.bamboo.specs.api.model.deployment.DeploymentProperties convertYamlToDeployment(@NotNull @NotNull String yaml, @NotNull @NotNull RssPermissions rssPermissions) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, YamlValidationException
Description copied from interface:DeploymentImportService
Converts data from a YAML document to deployment properties.This method performs validation of YAML types and of the properties without Bamboo context (e.g. no database integrity is verified).
- Specified by:
convertYamlToDeployment
in interfaceDeploymentImportService
- Parameters:
yaml
- YAML String containing definition of deployment- Returns:
- deployment properties after contextless validation
- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if the imported properties were not validYamlValidationException
- if the format of the YAML file is invalid
-
validate
public void validate(com.atlassian.bamboo.specs.api.model.deployment.DeploymentProperties deploymentProperties, @NotNull @NotNull RssPermissions rssPermissions) throws YamlValidationException
Description copied from interface:DeploymentImportService
Validates exported deployment properties within Bamboo context (e.g. verifying database integrity).- Specified by:
validate
in interfaceDeploymentImportService
- Parameters:
deploymentProperties
- deployment properties to importrssPermissions
- deployment projects which are allowed for modification; since 6.2- Throws:
YamlValidationException
- if validation failed
-
convertYamlToDeploymentPermissions
@NotNull public @NotNull com.atlassian.bamboo.specs.api.model.permission.DeploymentPermissionsProperties convertYamlToDeploymentPermissions(String yaml) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException, YamlValidationException
Description copied from interface:DeploymentImportService
Converts data from a YAML document to deployment permissions properties.This method performs validation of YAML types and of the properties without Bamboo context (e.g. no database integrity is verified).
- Specified by:
convertYamlToDeploymentPermissions
in interfaceDeploymentImportService
- Parameters:
yaml
- YAML String containing definition of deployment permissions- Returns:
- deployment permissions properties after contextless validation
- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if the imported properties were not validYamlValidationException
- if the format of the YAML file is invalid
-
convertYamlToEnvironmentPermissions
@NotNull public @NotNull com.atlassian.bamboo.specs.api.model.permission.EnvironmentPermissionsProperties convertYamlToEnvironmentPermissions(String yaml) throws YamlValidationException
Description copied from interface:DeploymentImportService
Converts data from a YAML document to environment permissions properties.This method performs validation of YAML types and of the properties without Bamboo context (e.g. no database integrity is verified).
- Specified by:
convertYamlToEnvironmentPermissions
in interfaceDeploymentImportService
- Parameters:
yaml
- YAML String containing definition of environment permissions- Returns:
- environment permissions properties after contextless validation
- Throws:
YamlValidationException
- if the format of the YAML file is invalid
-
importDeployment
@NotNull public @NotNull DeploymentProject importDeployment(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.deployment.DeploymentProperties deploymentProperties, @Nullable @Nullable com.atlassian.user.User user, @NotNull @NotNull RssPermissions rssPermissions, boolean noChangesInProperties) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
Description copied from interface:DeploymentImportService
Validates exported deployment properties within Bamboo context (e.g. verifying database integrity), then imports the data into the database.- Specified by:
importDeployment
in interfaceDeploymentImportService
- Parameters:
deploymentProperties
- deployment properties to importuser
- user invoking the importrssPermissions
- deployment projects which are allowed for modification; since 6.2- Returns:
- saved deployment entity
- Throws:
com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
- if data validation fails
-
importDeploymentPermissions
public void importDeploymentPermissions(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.permission.DeploymentPermissionsProperties deploymentPermission, @NotNull @NotNull RssPermissions rssPermissions)
Description copied from interface:DeploymentImportService
Import permissions for deployment project.- Specified by:
importDeploymentPermissions
in interfaceDeploymentImportService
- Parameters:
deploymentPermission
- deployment permissions to import
-
importDeploymentEnvironmentPermissions
public void importDeploymentEnvironmentPermissions(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.permission.EnvironmentPermissionsProperties environmentPermission, @NotNull @NotNull RssPermissions rssPermissions)
Description copied from interface:DeploymentImportService
Import permissions for deployment environment.- Specified by:
importDeploymentEnvironmentPermissions
in interfaceDeploymentImportService
- Parameters:
environmentPermission
- environment permissions to import.
-
importDeploymentPermissions
public void importDeploymentPermissions(@Nullable @Nullable String deploymentName, @Nullable @Nullable com.atlassian.bamboo.specs.api.model.BambooOidProperties deploymentOid, @NotNull @NotNull com.atlassian.bamboo.specs.api.model.permission.PermissionsProperties defaultEnvironmentPermissions, @NotNull @NotNull List<com.atlassian.bamboo.specs.api.model.permission.EnvironmentPermissionsProperties> environmentPermissions, @NotNull @NotNull RssPermissions rssPermissions)
Description copied from interface:DeploymentImportService
Import environments permissions in a bulk.- Specified by:
importDeploymentPermissions
in interfaceDeploymentImportService
- Parameters:
deploymentName
- name of the deployment projectdeploymentOid
- oid name of the deployment projectdefaultEnvironmentPermissions
- default environment permission will be used for all environments if they not specified at #environmentPermissions argumentenvironmentPermissions
- environment permissionsrssPermissions
- repository permissions
-
-