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

    Modifier and Type
    Method
    Description
    @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties
    Converts data from a YAML document to project properties.
    @NotNull com.atlassian.bamboo.specs.api.model.permission.ProjectPermissionsProperties
    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).

    Methods inherited from class java.lang.Object

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

    • ProjectImportServiceImpl

      public ProjectImportServiceImpl()
  • Method Details

    • 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 interface ProjectImportService
      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 interface ProjectImportService
      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 interface ProjectImportService
      Parameters:
      projectProperties - project properties to import
      user - user invoking the import
      rssPermissions - projects which are allowed for modification
      Returns:
      saved project entity
      Throws:
      com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException - if data validation failed
      RssPermissionException - if RSS doesn't have access to the project
      UnauthorisedException - 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 interface ProjectImportService
      Parameters:
      projectProperties - project properties to import
      user - user invoking the import
      rssPermissions - projects which are allowed for modification
      Returns:
      saved project entity
      Throws:
      com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException - if data validation failed
      RssPermissionException - if RSS doesn't have access to the project
      UnauthorisedException - 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 interface ProjectImportService
      Parameters:
      yaml - YAML String containing definition of project permissions
      Returns:
      project permissions properties
      Throws:
      YamlValidationException - if the format of the YAML file is invalid
      com.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 interface ProjectImportService
      Parameters:
      permissionsProperties - project permissions properties to import
      rssPermissions - projects which are allowed for modification
      Throws:
      com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException - if data validation failed
      UnauthorisedException - if any other type of permission is missing