Interface ProjectImportService

  • All Known Implementing Classes:
    ProjectImportServiceImpl

    @ExperimentalApi
    public interface ProjectImportService
    Service to import project configurations from human readable format.
    Since:
    8.2
    • Method Summary

      All Methods Instance Methods Abstract 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 projectPermissionsProperties, @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
        @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties convertYamlToProject​(@NotNull
                                                                                                     @NotNull String yaml)
                                                                                              throws YamlValidationException
        Converts data from a YAML document to project properties.
        Parameters:
        yaml - YAML String containing definition of a project
        Returns:
        project properties
        Throws:
        YamlValidationException - if the format of the YAML file is invalid
      • validateProjectProperties

        void validateProjectProperties​(@NotNull
                                       @NotNull com.atlassian.bamboo.specs.api.model.project.ProjectProperties projectProperties)
                                throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
        Validates project properties without Bamboo context (no database integrity is verified).
        Parameters:
        projectProperties - project properties to import
        Throws:
        com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException - if the imported properties were not valid
      • importProject

        @NotNull
        @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,
                                       UnauthorisedException,
                                       YamlValidationException
        Validates project properties within Bamboo context and imports the projects into the database.
        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
        YamlValidationException - if YAML validation of project resources failed
      • importProject

        @NotNull
        @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
        Validates project properties within Bamboo context and imports the project into the database.
        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
        @NotNull com.atlassian.bamboo.specs.api.model.permission.ProjectPermissionsProperties convertYamlToProjectPermissions​(@NotNull
                                                                                                                              @NotNull String yaml)
                                                                                                                       throws YamlValidationException,
                                                                                                                              com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
        Converts data from a YAML document to project permissions properties.
        Parameters:
        yaml - YAML String containing definition of project permissions
        Returns:
        project permissions properties
        Throws:
        com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException - if data validation failed
        YamlValidationException - if the format of the YAML file is invalid
      • importProjectPermissions

        void importProjectPermissions​(@NotNull
                                      @NotNull com.atlassian.bamboo.specs.api.model.permission.ProjectPermissionsProperties projectPermissionsProperties,
                                      @NotNull
                                      @NotNull RssPermissions rssPermissions)
                               throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException,
                                      UnauthorisedException
        Imports the project permissions properties.
        Parameters:
        projectPermissionsProperties - 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