public class RepositoryConfigurationServiceImpl extends Object implements RepositoryConfigurationService
RepositoryConfigurationService.LinkedRepositoryAccess| Constructor and Description |
|---|
RepositoryConfigurationServiceImpl(PlanManager planManager,
RepositoryManager repositoryManager,
WebRepositoryViewerManager webRepositoryViewerManager,
RepositoryDefinitionManager repositoryDefinitionManager) |
| Modifier and Type | Method and Description |
|---|---|
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 replacementReposiotryId)
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 pluginKey,
String webRepositoryKey,
RepositoryDefinition repositoryDefinition,
org.apache.commons.configuration.HierarchicalConfiguration configuration)
AOP advice cannot handle
RepositoryDataEntity type so call to {@link
RepositoryDefinitionManager#saveRepositoryDefinition(RepositoryDataEntity) will be unadvised. |
static Map<String,String> |
extractChangeDetectionOptionFromConfiguration(org.apache.commons.configuration.HierarchicalConfiguration configuration) |
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) |
public RepositoryConfigurationServiceImpl(@NotNull
PlanManager planManager,
@NotNull
RepositoryManager repositoryManager,
@NotNull
WebRepositoryViewerManager webRepositoryViewerManager,
@NotNull
RepositoryDefinitionManager repositoryDefinitionManager)
public static Map<String,String> extractChangeDetectionOptionFromConfiguration(@NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration)
public 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
RepositoryConfigurationServicecreateRepository in interface RepositoryConfigurationServicerepositoryName - repository name presented to the user, must be unique in planpluginKey - pluginKey of repositorywebRepositoryKey - plugin key of web repository viewerconfiguration - xml configuration of repositorybuildTrigger - flag indicating if repository is taking part in change detectionIllegalArgumentExceptionpublic RepositoryDefinition editRepository(@NotNull Plan plan, @NotNull String repositoryName, @NotNull String pluginKey, @Nullable String webRepositoryKey, @NotNull RepositoryDefinition repositoryDefinition, @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration) throws IllegalArgumentException, IllegalStateException
RepositoryDataEntity type so call to {@link
RepositoryDefinitionManager#saveRepositoryDefinition(RepositoryDataEntity) will be unadvised. Therefore we need
to add @PlanConfigurationModification annotation hereeditRepository in interface RepositoryConfigurationServicerepositoryName - repository name presented to the user, must be unique in planpluginKey - plugin key of repository or id of a global repositorywebRepositoryKey - plugin key of web repository viewerconfiguration - xml configuration of repositoryIllegalArgumentExceptionIllegalStateExceptionpublic Map<ImmutableJob,List<TaskDefinition>> getRelevantJobsForRepositoryIdChange(@NotNull ImmutablePlan plan, long repositoryId)
RepositoryConfigurationServiceJob and TaskDefinition for tasks using repository by given repository idgetRelevantJobsForRepositoryIdChange in interface RepositoryConfigurationServicepublic void shareRepository(@NotNull
Plan plan,
@NotNull
RepositoryData repositoryData,
@NotNull
String repositoryName,
@Nullable
String userDescription,
@NotNull
com.atlassian.user.User user)
RepositoryConfigurationServiceshareRepository in interface RepositoryConfigurationServiceplan - plan that owns the repositoryrepositoryData - repository to sharerepositoryName - new name of the repositoryuserDescription - of the repositorypublic RepositoryData editGlobalRepository(@NotNull String repositoryName, @NotNull String pluginKey, @Nullable String webRepositoryKey, @NotNull RepositoryData repositoryData, @NotNull org.apache.commons.configuration.HierarchicalConfiguration configuration) throws IllegalArgumentException, IllegalStateException
RepositoryConfigurationServiceeditGlobalRepository in interface RepositoryConfigurationServiceIllegalArgumentExceptionIllegalStateExceptionpublic 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
RepositoryConfigurationServicecreateGlobalRepository in interface RepositoryConfigurationServiceIllegalArgumentExceptionpublic 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
RepositoryConfigurationServicecreateGlobalRepository in interface RepositoryConfigurationServiceIllegalArgumentExceptionpublic RepositoryDefinition attachGlobalRepositoryToPlan(Plan plan, long selectedGlobalRepositoryId, boolean buildTrigger)
RepositoryConfigurationServiceattachGlobalRepositoryToPlan in interface RepositoryConfigurationServicepublic void deleteGlobalRepository(long repositoryId)
throws IllegalArgumentException,
IllegalStateException
RepositoryConfigurationServicedeleteGlobalRepository in interface RepositoryConfigurationServiceIllegalArgumentExceptionIllegalStateExceptionpublic void deleteRepository(@NotNull
Plan plan,
long repositoryId)
throws IllegalArgumentException,
IllegalStateException
RepositoryConfigurationServicedeleteRepository in interface RepositoryConfigurationServiceIllegalArgumentExceptionIllegalStateExceptionpublic void deleteRepository(@NotNull
Plan plan,
long repositoryId,
long replacementReposiotryId)
throws IllegalArgumentException,
IllegalStateException
RepositoryConfigurationServicedeleteRepository in interface RepositoryConfigurationServicereplacementReposiotryId - repository id to replace removed one in tasks depending on itIllegalArgumentExceptionIllegalStateExceptionpublic void moveRepository(@NotNull
PlanKey planKey,
long repositoryId,
long beforePosition,
long afterPosition)
throws IllegalArgumentException,
IllegalStateException
RepositoryConfigurationServicemoveRepository in interface RepositoryConfigurationServicerepositoryId - the RepositoryDefinition to movebeforePosition - position of the RepositoryDefinition that will be before the moving Repository, -1 if the beginning of the listafterPosition - position of the RepositoryDefinition that will be after the moving Repository, -1 if the end of the listIllegalArgumentExceptionIllegalStateExceptionpublic boolean validateRepositoryName(@NotNull
ImmutablePlan plan,
@NotNull
String name,
@Nullable
RepositoryDefinition repositoryDefinition)
RepositoryConfigurationServicevalidateRepositoryName in interface RepositoryConfigurationServicename - new name for repositoryrepositoryDefinition - existing repository definition being edited on null when repository is createdpublic boolean validateGlobalRepositoryName(@NotNull
String name,
@Nullable
RepositoryData repositoryData)
RepositoryConfigurationServicevalidateGlobalRepositoryName in interface RepositoryConfigurationServicepublic boolean validateRestartableStatus(@NotNull
ResultsSummary resultSummary)
validateRestartableStatus in interface RepositoryConfigurationServiceCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.