Class 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).
    • Constructor Detail

      • ProjectImportServiceImpl

        public ProjectImportServiceImpl()
    • Method Detail

      • 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