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
     
  • Method Summary

    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
    Converts data from a YAML document to deployment permissions properties.
    @NotNull com.atlassian.bamboo.specs.api.model.permission.EnvironmentPermissionsProperties
    Converts data from a YAML document to environment permissions properties.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeploymentImportServiceImpl

      public DeploymentImportServiceImpl()
  • Method Details

    • 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 interface DeploymentImportService
      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 valid
      YamlValidationException - 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 interface DeploymentImportService
      Parameters:
      deploymentProperties - deployment properties to import
      rssPermissions - 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 interface DeploymentImportService
      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 valid
      YamlValidationException - 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 interface DeploymentImportService
      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 interface DeploymentImportService
      Parameters:
      deploymentProperties - deployment properties to import
      user - user invoking the import
      rssPermissions - 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 interface DeploymentImportService
      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 interface DeploymentImportService
      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 interface DeploymentImportService
      Parameters:
      deploymentName - name of the deployment project
      deploymentOid - oid name of the deployment project
      defaultEnvironmentPermissions - default environment permission will be used for all environments if they not specified at #environmentPermissions argument
      environmentPermissions - environment permissions
      rssPermissions - repository permissions