public class VcsRepositoryConfigurationServiceImpl extends Object implements VcsRepositoryConfigurationService
VcsRepositoryConfigurationService.LinkedRepositoryAccess, VcsRepositoryConfigurationService.RepositoryAccessLEGACY_VCS_PLUGINS_USED_BANDANA_KEY| Constructor and Description |
|---|
VcsRepositoryConfigurationServiceImpl(RepositoryDefinitionManager repositoryDefinitionManager,
AuditLogService auditLogService,
HibernateMutableAclService aclService,
RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter,
ScopedExclusionService scopedExclusionService,
TriggerConfigurationService triggerConfigurationService,
TaskConfigurationService taskConfigurationService,
ChainBranchManager chainBranchManager,
EnvironmentTaskService environmentTaskService,
BuildDefinitionManager buildDefinitionManager,
com.atlassian.event.api.EventPublisher eventPublisher,
BranchCreationFacade branchCreationFacade,
VcsRepositoryManager vcsRepositoryManager,
TransactionAndHibernateTemplate hibernateTemplate) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull ErrorCollection |
configureRssDetection(long repositoryId,
PartialVcsRepositoryData vcsRepositoryData,
boolean isEnabled)
Sets detection of Bamboo Specs for repository and saves new config.
|
PartialVcsRepositoryData |
convertToNewRepositoryConfiguration(@NotNull PartialVcsRepositoryData vcsRepositoryData)
If repository data represents a repository implemented in the old system and appropriate new plugin exists,
the data is converted to the new plugin.
|
@NotNull PartialVcsRepositoryData |
createLinkedRepository(@NotNull PartialVcsRepositoryData newVcsConfiguration,
@NotNull com.atlassian.user.User user,
@NotNull VcsRepositoryConfigurationService.RepositoryAccess accessOption)
Creates new linked repository
|
org.acegisecurity.acls.MutableAcl |
createNewSharedRepositoryDefaultAcl(@Nullable com.atlassian.user.User user,
long repositoryId,
VcsRepositoryConfigurationService.RepositoryAccess accessOption)
Creates a defualt Acl for a specific repository which has:
- READ permissions for the creator (if applicable)
- READ permission to logged in users if ALL_USERS option is specified
|
@NotNull PartialVcsRepositoryData |
createPlanRepository(@NotNull Plan plan,
@NotNull PartialVcsRepositoryData newVcsConfiguration)
Creates "plan local" repository and adds it to a plan.
|
@NotNull PartialVcsRepositoryData |
createProjectRepository(@NotNull PartialVcsRepositoryData newVcsConfiguration,
@Nullable com.atlassian.user.User user,
@NotNull VcsRepositoryConfigurationService.RepositoryAccess accessOption)
Creates new project repository
|
void |
deleteLinkedRepository(long repositoryId)
Removes linked repository.
|
void |
deleteProjectRepository(long repositoryId)
Removes project repository.
|
void |
deleteRepository(@NotNull Plan plan,
long repositoryId,
Long replacementRepositoryId)
Removes repository definition from a plan
|
@NotNull PartialVcsRepositoryData |
editLinkedRepository(long repositoryId,
@NotNull PartialVcsRepositoryData newVcsConfiguration)
Edits existing linked repository
|
@NotNull PartialVcsRepositoryData |
editProjectRepository(long repositoryId,
@NotNull PartialVcsRepositoryData newVcsConfiguration)
Edits existing project repository
|
@NotNull PartialVcsRepositoryData |
editRepository(@NotNull Plan plan,
long repositoryId,
@NotNull PartialVcsRepositoryData newVcsConfiguration)
Edits existing "plan local" repository.
|
protected @NotNull List<PlanRepositoryLink> |
getNewRepositoryList(@NotNull List<PlanRepositoryLink> originalRepositories,
@NotNull PlanRepositoryLink toMove,
long beforeId,
long afterId) |
Map<ImmutableJob,List<TaskDefinition>> |
getRelevantJobsForRepositoryIdChange(@NotNull ImmutablePlan plan,
long repositoryId)
Gets list of jobs using a repository.
|
@NotNull boolean |
hasProjectSharedCredentialsForRepository(PartialVcsRepositoryData vcsRepositoryData) |
@NotNull PartialVcsRepositoryData |
linkRepositoryToPlan(@NotNull Plan plan,
long selectedRepositoryId)
Connects a linked repository to a plan by creating a new repository that inherits all the data from the linked repository
and adding it to the plan.
|
PartialVcsRepositoryData |
mergeLinkedRepository(@NotNull PartialVcsRepositoryData vcsRepositoryData)
Merges the state of the given linked repository into the database.
|
void |
mergePlanRepositories(@NotNull Plan plan,
@NotNull List<PartialVcsRepositoryData> vcsRepositoryDataList)
Merges the state of the given plan repositories into the database.
|
PartialVcsRepositoryData |
mergeProjectRepository(@NotNull PartialVcsRepositoryData vcsRepositoryData)
Merges the state of the given project repository into the database.
|
void |
moveRepository(@NotNull Plan plan,
long repositoryId,
long beforePosition,
long afterPosition)
Changes position of repository in the repository list.
|
PartialVcsRepositoryData |
replaceRepositoryInPlan(@NotNull Plan plan,
@NotNull VcsRepositoryData parentRepository,
@NotNull PartialVcsRepositoryData oldRepository,
@NotNull PartialVcsRepositoryData newRepository)
Replaces uses of a repository with another one.
|
void |
setParentOfPlanRepository(@NotNull ImmutablePlan plan,
long repositoryId,
long parentRepositoryId)
Creates or changes parent-child relationship for a plan repository.
|
void |
shareRepository(@NotNull Plan plan,
@NotNull PartialVcsRepositoryData repositoryData,
@NotNull String repositoryName,
@Nullable String userDescription,
@NotNull com.atlassian.user.User user)
Converts existing Plan repository to Linked repository.
|
boolean |
validateContinuableStatus(@NotNull ResultsSummary resultSummary)
Checks that result is continuable and repositories referenced by a result still exists in Bamboo db.
|
void |
validateLinkedRepository(@NotNull PartialVcsRepositoryData vcsRepositoryData)
Validate linked repository before saving it in database.
|
boolean |
validateLinkedRepositoryName(@NotNull String repositoryName,
@Nullable BambooIdProvider vcsRepositoryData)
Checks if name of a linked repository is unique.
|
void |
validatePlanRepositoriesNamesAndOids(@NotNull Plan plan,
@NotNull List<PartialVcsRepositoryData> repositoryDataList)
Validate repository names checking if there are no duplicates.
|
void |
validatePlanRepository(@NotNull Plan plan,
@NotNull PartialVcsRepositoryData vcsRepositoryData)
Validate plan repository before saving it in database.
|
void |
validateProjectRepository(@NotNull PartialVcsRepositoryData vcsRepositoryData)
Validate project repository before saving it in database.
|
boolean |
validateProjectRepositoryName(@NotNull String repositoryName,
@NotNull Long projectId,
@Nullable BambooIdProvider vcsRepositoryData)
Checks if name of a project repository is unique in the project.
|
boolean |
validateRepositoryName(@NotNull ImmutablePlan immutablePlan,
@NotNull String repositoryName,
@Nullable BambooIdProvider repositoryDefinition)
Checks if provided name for repository is unique in the Plan
|
boolean |
validateRestartableStatus(@NotNull ResultsSummary resultSummary)
Checks that result is restartable and repositories referenced by a result still exists in Bamboo db.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateLinkedRepositorypublic VcsRepositoryConfigurationServiceImpl(RepositoryDefinitionManager repositoryDefinitionManager, AuditLogService auditLogService, HibernateMutableAclService aclService, RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter, ScopedExclusionService scopedExclusionService, TriggerConfigurationService triggerConfigurationService, TaskConfigurationService taskConfigurationService, ChainBranchManager chainBranchManager, EnvironmentTaskService environmentTaskService, BuildDefinitionManager buildDefinitionManager, com.atlassian.event.api.EventPublisher eventPublisher, BranchCreationFacade branchCreationFacade, VcsRepositoryManager vcsRepositoryManager, TransactionAndHibernateTemplate hibernateTemplate)
@NotNull public @NotNull PartialVcsRepositoryData createPlanRepository(@NotNull @NotNull Plan plan, @NotNull @NotNull PartialVcsRepositoryData newVcsConfiguration)
VcsRepositoryConfigurationServicecreatePlanRepository in interface VcsRepositoryConfigurationService@NotNull public @NotNull PartialVcsRepositoryData editRepository(@NotNull @NotNull Plan plan, long repositoryId, @NotNull @NotNull PartialVcsRepositoryData newVcsConfiguration)
VcsRepositoryConfigurationServiceeditRepository in interface VcsRepositoryConfigurationServicepublic void setParentOfPlanRepository(@NotNull
@NotNull ImmutablePlan plan,
long repositoryId,
long parentRepositoryId)
VcsRepositoryConfigurationServicesetParentOfPlanRepository in interface VcsRepositoryConfigurationServicepublic PartialVcsRepositoryData replaceRepositoryInPlan(@NotNull @NotNull Plan plan, @NotNull @NotNull VcsRepositoryData parentRepository, @NotNull @NotNull PartialVcsRepositoryData oldRepository, @NotNull @NotNull PartialVcsRepositoryData newRepository)
VcsRepositoryConfigurationServicereplaceRepositoryInPlan in interface VcsRepositoryConfigurationService@NotNull public @NotNull PartialVcsRepositoryData linkRepositoryToPlan(@NotNull @NotNull Plan plan, long selectedRepositoryId)
VcsRepositoryConfigurationServicelinkRepositoryToPlan in interface VcsRepositoryConfigurationService@NotNull public @NotNull PartialVcsRepositoryData createLinkedRepository(@NotNull @NotNull PartialVcsRepositoryData newVcsConfiguration, @NotNull @NotNull com.atlassian.user.User user, @NotNull @NotNull VcsRepositoryConfigurationService.RepositoryAccess accessOption)
VcsRepositoryConfigurationServicecreateLinkedRepository in interface VcsRepositoryConfigurationService@NotNull public @NotNull PartialVcsRepositoryData createProjectRepository(@NotNull @NotNull PartialVcsRepositoryData newVcsConfiguration, @Nullable @Nullable com.atlassian.user.User user, @NotNull @NotNull VcsRepositoryConfigurationService.RepositoryAccess accessOption)
VcsRepositoryConfigurationServicecreateProjectRepository in interface VcsRepositoryConfigurationService@NotNull public @NotNull PartialVcsRepositoryData editLinkedRepository(long repositoryId, @NotNull @NotNull PartialVcsRepositoryData newVcsConfiguration)
VcsRepositoryConfigurationServiceeditLinkedRepository in interface VcsRepositoryConfigurationService@NotNull public @NotNull PartialVcsRepositoryData editProjectRepository(long repositoryId, @NotNull @NotNull PartialVcsRepositoryData newVcsConfiguration)
VcsRepositoryConfigurationServiceeditProjectRepository in interface VcsRepositoryConfigurationServicepublic void deleteLinkedRepository(long repositoryId)
VcsRepositoryConfigurationServicedeleteLinkedRepository in interface VcsRepositoryConfigurationServicepublic void deleteProjectRepository(long repositoryId)
VcsRepositoryConfigurationServicedeleteProjectRepository in interface VcsRepositoryConfigurationServicepublic boolean validateLinkedRepositoryName(@NotNull
@NotNull String repositoryName,
@Nullable
@Nullable BambooIdProvider vcsRepositoryData)
VcsRepositoryConfigurationServicevalidateLinkedRepositoryName in interface VcsRepositoryConfigurationServicepublic boolean validateProjectRepositoryName(@NotNull
@NotNull String repositoryName,
@NotNull
@NotNull Long projectId,
@Nullable
@Nullable BambooIdProvider vcsRepositoryData)
VcsRepositoryConfigurationServicevalidateProjectRepositoryName in interface VcsRepositoryConfigurationServicepublic boolean validateRepositoryName(@NotNull
@NotNull ImmutablePlan immutablePlan,
@NotNull
@NotNull String repositoryName,
@Nullable
@Nullable BambooIdProvider repositoryDefinition)
VcsRepositoryConfigurationServicevalidateRepositoryName in interface VcsRepositoryConfigurationServicepublic org.acegisecurity.acls.MutableAcl createNewSharedRepositoryDefaultAcl(@Nullable
@Nullable com.atlassian.user.User user,
long repositoryId,
VcsRepositoryConfigurationService.RepositoryAccess accessOption)
user - to create acl foraccessOption - MutableAcl representing a default permission setpublic void deleteRepository(@NotNull
@NotNull Plan plan,
long repositoryId,
Long replacementRepositoryId)
VcsRepositoryConfigurationServicedeleteRepository in interface VcsRepositoryConfigurationServicereplacementRepositoryId - repository id to replace removed one in tasks depending on itpublic void moveRepository(@NotNull
@NotNull Plan plan,
long repositoryId,
long beforePosition,
long afterPosition)
throws IllegalArgumentException,
IllegalStateException
VcsRepositoryConfigurationServicemoveRepository in interface VcsRepositoryConfigurationServicerepositoryId - 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 listIllegalArgumentExceptionIllegalStateException@NotNull protected @NotNull List<PlanRepositoryLink> getNewRepositoryList(@NotNull @NotNull List<PlanRepositoryLink> originalRepositories, @NotNull @NotNull PlanRepositoryLink toMove, long beforeId, long afterId)
public void shareRepository(@NotNull
@NotNull Plan plan,
@NotNull
@NotNull PartialVcsRepositoryData repositoryData,
@NotNull
@NotNull String repositoryName,
@Nullable
@Nullable String userDescription,
@NotNull
@NotNull com.atlassian.user.User user)
VcsRepositoryConfigurationServiceshareRepository in interface VcsRepositoryConfigurationServiceplan - plan that owns the repositoryrepositoryData - repository to sharerepositoryName - new name of the repositoryuserDescription - of the repositorypublic boolean validateRestartableStatus(@NotNull
@NotNull ResultsSummary resultSummary)
VcsRepositoryConfigurationServicevalidateRestartableStatus in interface VcsRepositoryConfigurationServicepublic boolean validateContinuableStatus(@NotNull
@NotNull ResultsSummary resultSummary)
VcsRepositoryConfigurationServicevalidateContinuableStatus in interface VcsRepositoryConfigurationServicepublic Map<ImmutableJob,List<TaskDefinition>> getRelevantJobsForRepositoryIdChange(@NotNull @NotNull ImmutablePlan plan, long repositoryId)
VcsRepositoryConfigurationServicegetRelevantJobsForRepositoryIdChange in interface VcsRepositoryConfigurationServicepublic PartialVcsRepositoryData convertToNewRepositoryConfiguration(@NotNull @NotNull PartialVcsRepositoryData vcsRepositoryData)
VcsRepositoryConfigurationServiceconvertToNewRepositoryConfiguration in interface VcsRepositoryConfigurationServicepublic void validateProjectRepository(@NotNull
@NotNull PartialVcsRepositoryData vcsRepositoryData)
throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
VcsRepositoryConfigurationServicevalidateProjectRepository in interface VcsRepositoryConfigurationServicevcsRepositoryData - imported project repositorycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationExceptionpublic void validateLinkedRepository(@NotNull
@NotNull PartialVcsRepositoryData vcsRepositoryData)
throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
VcsRepositoryConfigurationServicevalidateLinkedRepository in interface VcsRepositoryConfigurationServicevcsRepositoryData - imported linked repositorycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationExceptionpublic PartialVcsRepositoryData mergeLinkedRepository(@NotNull @NotNull PartialVcsRepositoryData vcsRepositoryData) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
VcsRepositoryConfigurationServiceThis service will attempt to merge the entity based on ImmutableEntityWithOid.getOid(), and if there's no
match, based on DescriptionProvider.getName(). If an existing entity is found, then it will be updated.
Otherwise, a new database entity will be created.
It's assumed that this method is used in specs import only as it's sending analytic event.
mergeLinkedRepository in interface VcsRepositoryConfigurationServicevcsRepositoryData - imported linked repositorycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationExceptionpublic PartialVcsRepositoryData mergeProjectRepository(@NotNull @NotNull PartialVcsRepositoryData vcsRepositoryData) throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
VcsRepositoryConfigurationServiceThis service will attempt to merge the entity based on ImmutableEntityWithOid.getOid(), and if there's no
match, based on DescriptionProvider.getName(). If an existing entity is found, then it will be updated.
Otherwise, a new database entity will be created.
It's assumed that this method is used in specs import only as it's sending analytic event.
mergeProjectRepository in interface VcsRepositoryConfigurationServicevcsRepositoryData - imported project repositorycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationExceptionpublic void validatePlanRepository(@NotNull
@NotNull Plan plan,
@NotNull
@NotNull PartialVcsRepositoryData vcsRepositoryData)
throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
VcsRepositoryConfigurationServicevalidatePlanRepository in interface VcsRepositoryConfigurationServicevcsRepositoryData - imported plan repositorycom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationExceptionpublic void validatePlanRepositoriesNamesAndOids(@NotNull
@NotNull Plan plan,
@NotNull
@NotNull List<PartialVcsRepositoryData> repositoryDataList)
throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
VcsRepositoryConfigurationServicevalidatePlanRepositoriesNamesAndOids in interface VcsRepositoryConfigurationServicecom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationExceptionpublic void mergePlanRepositories(@NotNull
@NotNull Plan plan,
@NotNull
@NotNull List<PartialVcsRepositoryData> vcsRepositoryDataList)
throws com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException
VcsRepositoryConfigurationServiceThis service will attempt to merge the entities based on BambooIdProvider.getId(), and if there's no
match, a new database entity will be created. All other repositories in plan will be removed.
mergePlanRepositories in interface VcsRepositoryConfigurationServicevcsRepositoryDataList - list of imported plan repositoriescom.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException@NotNull public @NotNull ErrorCollection configureRssDetection(long repositoryId, PartialVcsRepositoryData vcsRepositoryData, boolean isEnabled)
VcsRepositoryConfigurationServiceconfigureRssDetection in interface VcsRepositoryConfigurationServicerepositoryId - id of repositoryvcsRepositoryData - repository configuration, remains unchangedisEnabled - true if Specs detection should be enabled, false otherwise@NotNull public @NotNull boolean hasProjectSharedCredentialsForRepository(PartialVcsRepositoryData vcsRepositoryData)
hasProjectSharedCredentialsForRepository in interface VcsRepositoryConfigurationServicevcsRepositoryData - repository configurationCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.