com.atlassian.bamboo.repository
Interface RepositoryConfigurationService

All Known Implementing Classes:
RepositoryConfigurationServiceImpl

public interface RepositoryConfigurationService


Nested Class Summary
static class RepositoryConfigurationService.LinkedRepositoryAccess
           
 
Method Summary
 RepositoryDefinition attachGlobalRepositoryToPlan(Plan plan, long selectedGlobalRepositoryId, boolean buildTrigger)
          Creates relationship between global repository and a plan
 RepositoryData createGlobalRepository(String repositoryName, String pluginKey, String webRepositoryKey, org.apache.commons.configuration.HierarchicalConfiguration configuration, boolean buildTrigger, com.atlassian.user.User user)
          Creates new global repository
 RepositoryData createGlobalRepository(String repositoryName, String pluginKey, String webRepositoryKey, org.apache.commons.configuration.HierarchicalConfiguration configuration, boolean buildTrigger, com.atlassian.user.User user, RepositoryConfigurationService.LinkedRepositoryAccess accessOption)
          Creates new global repository
 RepositoryDefinition createRepository(Plan plan, String repositoryName, String pluginKey, String webRepositoryKey, org.apache.commons.configuration.HierarchicalConfiguration configuration, boolean buildTrigger)
          Creates new repository and adds it to the plan configuration
 void deleteGlobalRepository(long repositoryId)
          Removes global repository
 void deleteRepository(Plan plan, long repositoryId)
          Removes repository definition for plan
 void deleteRepository(Plan plan, long repositoryId, long replacementRepositoryId)
          Removes repository definition for plan
 RepositoryData editGlobalRepository(String repositoryName, String pluginKey, String webRepositoryKey, RepositoryData repositoryData, org.apache.commons.configuration.HierarchicalConfiguration configuration)
          Changes definition of a global repository.
 RepositoryDefinition editRepository(Plan plan, String repositoryName, String selectedRepositoryKey, String webRepositoryKey, RepositoryDefinition repositoryDefinition, org.apache.commons.configuration.HierarchicalConfiguration configuration)
          Changes (replaces) repository definition.
 Map<ImmutableJob,List<TaskDefinition>> getRelevantJobsForRepositoryIdChange(ImmutablePlan plan, long repositoryId)
          Returns mapping between Job and TaskDefinition for tasks using repository by given repository id
 void moveRepository(PlanKey planKey, long repositoryId, long beforePosition, long afterPosition)
          Changes position of repository in the repository list.
 void shareRepository(Plan plan, RepositoryData repositoryData, String repositoryName, String userDescription, com.atlassian.user.User user)
          Converts existing Plan repository to Shared Repository.
 boolean validateGlobalRepositoryName(String name, RepositoryData repositoryData)
          Checks if name of global repository is unique.
 boolean validateRepositoryName(ImmutablePlan plan, String name, RepositoryDefinition repositoryDefinition)
          Checks if provided name for repository is unique in the Plan
 boolean validateRestartableStatus(ResultsSummary resultSummary)
           
 

Method Detail

createRepository

RepositoryDefinition createRepository(@NotNull
                                      Plan plan,
                                      @NotNull
                                      String repositoryName,
                                      @NotNull
                                      String pluginKey,
                                      @Nullable
                                      String webRepositoryKey,
                                      @NotNull
                                      org.apache.commons.configuration.HierarchicalConfiguration configuration,
                                      boolean buildTrigger)
                                      throws IllegalArgumentException
Creates new repository and adds it to the plan configuration

Parameters:
plan -
repositoryName - repository name presented to the user, must be unique in plan
pluginKey - pluginKey of repository
webRepositoryKey - plugin key of web repository viewer
configuration - xml configuration of repository
buildTrigger - flag indicating if repository is taking part in change detection
Returns:
Throws:
IllegalArgumentException

editRepository

RepositoryDefinition editRepository(@NotNull
                                    Plan plan,
                                    @NotNull
                                    String repositoryName,
                                    @NotNull
                                    String selectedRepositoryKey,
                                    @Nullable
                                    String webRepositoryKey,
                                    @NotNull
                                    RepositoryDefinition repositoryDefinition,
                                    @NotNull
                                    org.apache.commons.configuration.HierarchicalConfiguration configuration)
                                    throws IllegalArgumentException,
                                           IllegalStateException
Changes (replaces) repository definition. Build trigger can not be changed in this method.

Parameters:
plan -
repositoryName - repository name presented to the user, must be unique in plan
selectedRepositoryKey - plugin key of repository or id of a global repository
webRepositoryKey - plugin key of web repository viewer
configuration - xml configuration of repository
Returns:
Throws:
IllegalArgumentException
IllegalStateException

deleteRepository

void deleteRepository(@NotNull
                      Plan plan,
                      long repositoryId)
                      throws IllegalArgumentException,
                             IllegalStateException
Removes repository definition for plan

Parameters:
plan -
repositoryId -
Throws:
IllegalArgumentException
IllegalStateException

deleteRepository

void deleteRepository(@NotNull
                      Plan plan,
                      long repositoryId,
                      long replacementRepositoryId)
                      throws IllegalArgumentException,
                             IllegalStateException
Removes repository definition for plan

Parameters:
plan -
repositoryId -
replacementRepositoryId - repository id to replace removed one in tasks depending on it
Throws:
IllegalArgumentException
IllegalStateException

moveRepository

void moveRepository(@NotNull
                    PlanKey planKey,
                    long repositoryId,
                    long beforePosition,
                    long afterPosition)
                    throws IllegalArgumentException,
                           IllegalStateException
Changes position of repository in the repository list. Important for setting default repository

Parameters:
planKey -
repositoryId - the RepositoryDefinition to move
beforePosition - position of the RepositoryDefinition that will be before the moving Repository, -1 if the beginning of the list
afterPosition - position of the RepositoryDefinition that will be after the moving Repository, -1 if the end of the list
Throws:
IllegalArgumentException
IllegalStateException

validateRepositoryName

boolean validateRepositoryName(@NotNull
                               ImmutablePlan plan,
                               @NotNull
                               String name,
                               @Nullable
                               RepositoryDefinition repositoryDefinition)
Checks if provided name for repository is unique in the Plan

Parameters:
plan -
name - new name for repository
repositoryDefinition - existing repository definition being edited on null when repository is created
Returns:
true if name is unique or false when name already exists for other repository for the same plan

validateRestartableStatus

boolean validateRestartableStatus(@NotNull
                                  ResultsSummary resultSummary)

editGlobalRepository

RepositoryData editGlobalRepository(@NotNull
                                    String repositoryName,
                                    @NotNull
                                    String pluginKey,
                                    @Nullable
                                    String webRepositoryKey,
                                    @NotNull
                                    RepositoryData repositoryData,
                                    @NotNull
                                    org.apache.commons.configuration.HierarchicalConfiguration configuration)
                                    throws IllegalArgumentException,
                                           IllegalStateException
Changes definition of a global repository.

Parameters:
repositoryName -
pluginKey -
webRepositoryKey -
repositoryData -
configuration -
Returns:
Throws:
IllegalArgumentException
IllegalStateException

createGlobalRepository

RepositoryData createGlobalRepository(@NotNull
                                      String repositoryName,
                                      @NotNull
                                      String pluginKey,
                                      @Nullable
                                      String webRepositoryKey,
                                      @NotNull
                                      org.apache.commons.configuration.HierarchicalConfiguration configuration,
                                      boolean buildTrigger,
                                      @NotNull
                                      com.atlassian.user.User user,
                                      @NotNull
                                      RepositoryConfigurationService.LinkedRepositoryAccess accessOption)
                                      throws IllegalArgumentException
Creates new global repository

Parameters:
repositoryName -
pluginKey -
webRepositoryKey -
configuration -
buildTrigger -
Returns:
Throws:
IllegalArgumentException

createGlobalRepository

RepositoryData createGlobalRepository(@NotNull
                                      String repositoryName,
                                      @NotNull
                                      String pluginKey,
                                      @Nullable
                                      String webRepositoryKey,
                                      @NotNull
                                      org.apache.commons.configuration.HierarchicalConfiguration configuration,
                                      boolean buildTrigger,
                                      @NotNull
                                      com.atlassian.user.User user)
                                      throws IllegalArgumentException
Creates new global repository

Parameters:
repositoryName -
pluginKey -
webRepositoryKey -
configuration -
buildTrigger -
Returns:
Throws:
IllegalArgumentException

attachGlobalRepositoryToPlan

RepositoryDefinition attachGlobalRepositoryToPlan(Plan plan,
                                                  long selectedGlobalRepositoryId,
                                                  boolean buildTrigger)
                                                  throws IllegalArgumentException,
                                                         IllegalStateException
Creates relationship between global repository and a plan

Parameters:
plan -
selectedGlobalRepositoryId -
buildTrigger -
Returns:
Throws:
IllegalArgumentException
IllegalStateException

deleteGlobalRepository

void deleteGlobalRepository(long repositoryId)
                            throws IllegalArgumentException,
                                   IllegalStateException
Removes global repository

Parameters:
repositoryId -
Throws:
IllegalArgumentException
IllegalStateException

validateGlobalRepositoryName

boolean validateGlobalRepositoryName(@NotNull
                                     String name,
                                     @Nullable
                                     RepositoryData repositoryData)
Checks if name of global repository is unique.

Parameters:
name -
repositoryData -
Returns:

getRelevantJobsForRepositoryIdChange

Map<ImmutableJob,List<TaskDefinition>> getRelevantJobsForRepositoryIdChange(@NotNull
                                                                            ImmutablePlan plan,
                                                                            long repositoryId)
Returns mapping between Job and TaskDefinition for tasks using repository by given repository id

Parameters:
plan -
repositoryId -
Returns:

shareRepository

void shareRepository(@NotNull
                     Plan plan,
                     @NotNull
                     RepositoryData repositoryData,
                     @NotNull
                     String repositoryName,
                     @Nullable
                     String userDescription,
                     @NotNull
                     com.atlassian.user.User user)
Converts existing Plan repository to Shared Repository.

Parameters:
plan - plan that owns the repository
repositoryData - repository to share
repositoryName - new name of the repository
userDescription - of the repository
Since:
4.2


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.