public class RepositoryDefinitionManagerImpl extends Object implements RepositoryDefinitionManager
| Constructor and Description |
|---|
RepositoryDefinitionManagerImpl(RepositoryDefinitionDao repositoryDefinitionDao,
PlanRepositoryLinkDao planRepositoryLinkDao,
RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter,
RssRepositoryPermissionDao rssRepositoryPermissionDao) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull Long |
countAllProjectsRepositories()
Count all project repositories.
|
PartialVcsRepositoryData |
entityToUnmergedData(@NotNull RepositoryDataEntity entity) |
@Nullable VcsRepositoryData |
entityToVcsData(@Nullable RepositoryDataEntity input) |
@NotNull List<Long> |
findAllProjectsIdsUsingProjectRepositories()
Find all project which are using project repositories.
|
@NotNull Set<Long> |
findAllTopLevelRepositoriesIds()
Get ids of all repositories that doesn't have parent repository (are either linked or are created on plan level)
|
@NotNull List<RepositoryDataEntity> |
findRepositoriesByPluginKey(@NotNull String pluginKey)
Given a pluginKey this will get you all the repositories in Bamboo that were created for that key.
|
List<RepositoryData> |
getGlobalRepositoryDefinitions()
Get all Shared repositories current user has permission to use in his plans.
|
List<RepositoryData> |
getGlobalRepositoryDefinitionsForAdministration()
Get all Shared repositories current user has permission to administrate.
|
List<RepositoryData> |
getGlobalRepositoryDefinitionsUnrestricted()
Get all Shared Repositories without permission checking.
|
List<PlanIdentifier> |
getIdentifiersOfPlansUsingRepository(long repositoryId)
Get identifiers of Plans referencing a repository.
|
@NotNull List<PlanIdentifier> |
getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId)
Get identifiers of
Chains referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked)
If the parameter refers to a linked repository, only TopLevelPlans are returned. |
@NotNull List<VcsRepositoryData> |
getLinkedRepositories()
Get all linked repositories current user has permission to use in his plans.
|
List<VcsRepositoryData> |
getLinkedRepositoriesForAdministration()
Get all Shared repositories current user has permission to administrate.
|
List<VcsRepositoryData> |
getLinkedRepositoriesForExport()
Get all linked repositories in a form suitable for export.
|
List<VcsRepositoryData> |
getLinkedRepositoriesUnrestricted()
Get all linked repositories without permission checking.
|
@Nullable VcsRepositoryData |
getLinkedRepositoryByName(String name)
Find a linked repository by name.
|
@NotNull List<PartialVcsRepositoryData> |
getPlanRepositoriesForExport(@NotNull PlanIdentifier plan)
Get all repositories attached to a plan in form suitable for export.
|
@NotNull List<PlanRepositoryDefinition> |
getPlanRepositoryDefinitions(@NotNull PlanIdentifier plan)
Get all repositories attached to a plan ordered by position.
|
PlanRepositoryLink |
getPlanRepositoryLink(@NotNull ImmutablePlan plan,
long repositoryId)
Get persistent representation of a relation between Plan and repository
|
PlanRepositoryLink |
getPlanRepositoryLinkByName(@NotNull ImmutablePlan plan,
@NotNull String repositoryName)
Get persistent representation of a relation between Plan and repository
|
@NotNull List<PlanRepositoryLinkDto> |
getPlanRepositoryLinkDtos(@NotNull PlanIdentifier plan) |
@NotNull List<PlanRepositoryLink> |
getPlanRepositoryLinks(@NotNull ImmutablePlan plan)
Get persistent representation of relation between Plan and repositories
|
List<PlanRepositoryLink> |
getPlansUsingRepository(long repositoryId)
Get
PlanRepositoryLinks associated with repository. |
@NotNull List<VcsRepositoryData> |
getProjectRepositories(long projectId)
Find all repositories in a project with given id.
|
List<VcsRepositoryData> |
getProjectRepositoriesRestricted(long projectId)
Get all project repositories current user has permission to use in his plans connected with requested project ID.
|
@Nullable VcsRepositoryData |
getProjectRepositoryByName(String name,
Long projectId)
Find a project repository by name in project associated with given projectId.
|
@Nullable RepositoryDataEntity |
getRepositoryDataEntity(long id)
Get persistent representation of a repository
|
@NotNull List<RepositoryDefinition> |
getRepositoryDefinitionsForPlan(@NotNull ImmutablePlan plan)
Get all repositories attached to a plan ordered by position.
|
@Nullable VcsRepositoryData |
getVcsRepositoryData(long repositoryId)
Get plugin-agnostic representation of a repository configuration.
|
VcsRepositoryData |
getVcsRepositoryDataByOid(BambooEntityOid oid)
Find a repository by oid.
|
@Nullable PartialVcsRepositoryData |
getVcsRepositoryDataForEditing(long repositoryId) |
boolean |
isRepositoryOrItsDirectChildrenUsedInPlans(long repositoryId)
Checks if repository is used in plans
|
void |
removeRepositoriesForPlan(Plan plan)
Remove all repositories from
Plan that are not global repositories. |
void |
removeRepositoryFromPlan(@NotNull PlanRepositoryLink planRepository)
Removes relation between repository and plan.
|
void |
removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity)
Marks repository for deletion if it is referenced by a
RepositoryChangeset, removes it otherwise. |
void |
removeUnusedRepositories()
Removes all repositories that has been previously markedForDeletion and are no longer
referenced by any
RepositoryChangeset |
void |
savePlanRepositoryLink(@NotNull PlanRepositoryLink planRepository) |
void |
savePlanRepositoryLinks(@NotNull List<PlanRepositoryLink> planRepositories)
Saves the collection of plan to repository relations.
|
long |
savePlanRepositoryWithDefinition(@NotNull PlanRepositoryLink planRepository)
Saves plan to repository relation definition with cascade to
RepositoryDataEntity |
long |
saveRepositoryDefinition(RepositoryDataEntity repositoryData)
Save repository definition.
|
void |
saveRepositoryDefinitions(@NotNull Collection<RepositoryDataEntity> repositoriesBeingCreated)
Saves all repository definitions in the collection.
|
public RepositoryDefinitionManagerImpl(RepositoryDefinitionDao repositoryDefinitionDao, PlanRepositoryLinkDao planRepositoryLinkDao, RawRepositoryConfigurationXmlConverter rawRepositoryConfigurationXmlConverter, RssRepositoryPermissionDao rssRepositoryPermissionDao)
public PlanRepositoryLink getPlanRepositoryLink(@NotNull @NotNull ImmutablePlan plan, long repositoryId)
RepositoryDefinitionManagergetPlanRepositoryLink in interface RepositoryDefinitionManagerpublic PlanRepositoryLink getPlanRepositoryLinkByName(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String repositoryName)
RepositoryDefinitionManagergetPlanRepositoryLinkByName in interface RepositoryDefinitionManager@NotNull public @NotNull List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull @NotNull ImmutablePlan plan)
RepositoryDefinitionManagergetPlanRepositoryLinks in interface RepositoryDefinitionManager@Nullable public @Nullable RepositoryDataEntity getRepositoryDataEntity(long id)
RepositoryDefinitionManagergetRepositoryDataEntity in interface RepositoryDefinitionManager@NotNull public @NotNull List<RepositoryDefinition> getRepositoryDefinitionsForPlan(@NotNull @NotNull ImmutablePlan plan)
RepositoryDefinitionManagergetRepositoryDefinitionsForPlan in interface RepositoryDefinitionManager@NotNull public @NotNull List<PlanRepositoryDefinition> getPlanRepositoryDefinitions(@NotNull @NotNull PlanIdentifier plan)
RepositoryDefinitionManagergetPlanRepositoryDefinitions in interface RepositoryDefinitionManager@NotNull public @NotNull List<PlanRepositoryLinkDto> getPlanRepositoryLinkDtos(@NotNull @NotNull PlanIdentifier plan)
getPlanRepositoryLinkDtos in interface RepositoryDefinitionManager@NotNull public @NotNull List<PartialVcsRepositoryData> getPlanRepositoriesForExport(@NotNull @NotNull PlanIdentifier plan)
RepositoryDefinitionManagergetPlanRepositoriesForExport in interface RepositoryDefinitionManagerpublic List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
RepositoryDefinitionManagerPlanRepositoryLinks associated with repository. This method should only be used when editing
the list of repositories associated with a Plan.
This method only direct associations. This means, that since Bamboo 5.14, it will return no results
for linked repository. See also RepositoryDefinitionManager.getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long)getPlansUsingRepository in interface RepositoryDefinitionManager@NotNull public @NotNull List<PlanIdentifier> getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId)
RepositoryDefinitionManagerChains referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked)
If the parameter refers to a linked repository, only TopLevelPlans are returned.
If the parameter refers to a plan local repository, it will return the plan the repository is linked to and all its ChainBranchesgetIdentifiersOfPlansUsingRepositoryOrItsDirectChildren in interface RepositoryDefinitionManagerpublic boolean isRepositoryOrItsDirectChildrenUsedInPlans(long repositoryId)
RepositoryDefinitionManagerisRepositoryOrItsDirectChildrenUsedInPlans in interface RepositoryDefinitionManagerpublic List<RepositoryData> getGlobalRepositoryDefinitions()
RepositoryDefinitionManagergetGlobalRepositoryDefinitions in interface RepositoryDefinitionManagerpublic List<RepositoryData> getGlobalRepositoryDefinitionsForAdministration()
RepositoryDefinitionManagergetGlobalRepositoryDefinitionsForAdministration in interface RepositoryDefinitionManagerpublic List<RepositoryData> getGlobalRepositoryDefinitionsUnrestricted()
RepositoryDefinitionManagergetGlobalRepositoryDefinitionsUnrestricted in interface RepositoryDefinitionManager@NotNull public @NotNull List<VcsRepositoryData> getLinkedRepositories()
RepositoryDefinitionManagergetLinkedRepositories in interface RepositoryDefinitionAccessorgetLinkedRepositories in interface RepositoryDefinitionManagerpublic List<VcsRepositoryData> getLinkedRepositoriesForAdministration()
RepositoryDefinitionManagergetLinkedRepositoriesForAdministration in interface RepositoryDefinitionManagerpublic List<VcsRepositoryData> getLinkedRepositoriesForExport()
RepositoryDefinitionManagergetLinkedRepositoriesForExport in interface RepositoryDefinitionManager@Nullable public @Nullable VcsRepositoryData entityToVcsData(@Nullable @Nullable RepositoryDataEntity input)
entityToVcsData in interface RepositoryDefinitionManager@Nullable public @Nullable VcsRepositoryData getVcsRepositoryData(long repositoryId)
RepositoryDefinitionManagergetVcsRepositoryData in interface RepositoryDefinitionManagerpublic PartialVcsRepositoryData entityToUnmergedData(@NotNull @NotNull RepositoryDataEntity entity)
entityToUnmergedData in interface RepositoryDefinitionManagerentity - should be in decoded state.@Nullable public @Nullable PartialVcsRepositoryData getVcsRepositoryDataForEditing(long repositoryId)
getVcsRepositoryDataForEditing in interface RepositoryDefinitionManagerpublic List<VcsRepositoryData> getLinkedRepositoriesUnrestricted()
RepositoryDefinitionManagergetLinkedRepositoriesUnrestricted in interface RepositoryDefinitionManagerpublic long saveRepositoryDefinition(RepositoryDataEntity repositoryData)
RepositoryDefinitionManagersaveRepositoryDefinition in interface RepositoryDefinitionManagerpublic void saveRepositoryDefinitions(@NotNull
@NotNull Collection<RepositoryDataEntity> repositoriesBeingCreated)
RepositoryDefinitionManagersaveRepositoryDefinitions in interface RepositoryDefinitionManagerpublic long savePlanRepositoryWithDefinition(@NotNull
@NotNull PlanRepositoryLink planRepository)
RepositoryDefinitionManagerRepositoryDataEntitysavePlanRepositoryWithDefinition in interface RepositoryDefinitionManagerpublic void savePlanRepositoryLink(@NotNull
@NotNull PlanRepositoryLink planRepository)
savePlanRepositoryLink in interface RepositoryDefinitionManagerpublic void savePlanRepositoryLinks(@NotNull
@NotNull List<PlanRepositoryLink> planRepositories)
RepositoryDefinitionManagersavePlanRepositoryLinks in interface RepositoryDefinitionManagerpublic void removeRepositoryFromPlan(@NotNull
@NotNull PlanRepositoryLink planRepository)
RepositoryDefinitionManagerRepositoryDefinitionManager.removeRepositoryIfUnused(RepositoryDataEntity) is called.removeRepositoryFromPlan in interface RepositoryDefinitionManagerpublic void removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity)
RepositoryDefinitionManagerRepositoryChangeset, removes it otherwise.removeRepositoryIfUnused in interface RepositoryDefinitionManagerpublic void removeUnusedRepositories()
RepositoryDefinitionManagerRepositoryChangesetremoveUnusedRepositories in interface RepositoryDefinitionManagerpublic void removeRepositoriesForPlan(Plan plan)
RepositoryDefinitionManagerPlan that are not global repositories.removeRepositoriesForPlan in interface RepositoryDefinitionManagerpublic List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
RepositoryDefinitionManagerRepositoryDefinitionManager.getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long)getIdentifiersOfPlansUsingRepository in interface RepositoryDefinitionManager@NotNull public @NotNull List<RepositoryDataEntity> findRepositoriesByPluginKey(@NotNull @NotNull String pluginKey)
RepositoryDefinitionManagerfindRepositoriesByPluginKey in interface RepositoryDefinitionManagerpluginKey - The plugin key to search for.public VcsRepositoryData getVcsRepositoryDataByOid(BambooEntityOid oid)
RepositoryDefinitionAccessorgetVcsRepositoryDataByOid in interface RepositoryDefinitionAccessor@Nullable public @Nullable VcsRepositoryData getLinkedRepositoryByName(String name)
RepositoryDefinitionManagergetLinkedRepositoryByName in interface RepositoryDefinitionManagername - of linked repository@NotNull public @NotNull Set<Long> findAllTopLevelRepositoriesIds()
RepositoryDefinitionManagerfindAllTopLevelRepositoriesIds in interface RepositoryDefinitionManager@Nullable public @Nullable VcsRepositoryData getProjectRepositoryByName(String name, Long projectId)
RepositoryDefinitionManagergetProjectRepositoryByName in interface RepositoryDefinitionManager@NotNull public @NotNull Long countAllProjectsRepositories()
RepositoryDefinitionManagercountAllProjectsRepositories in interface RepositoryDefinitionManager@NotNull public @NotNull List<VcsRepositoryData> getProjectRepositories(long projectId)
RepositoryDefinitionManagergetProjectRepositories in interface RepositoryDefinitionManagerpublic List<VcsRepositoryData> getProjectRepositoriesRestricted(long projectId)
RepositoryDefinitionManagergetProjectRepositoriesRestricted in interface RepositoryDefinitionManager@NotNull public @NotNull List<Long> findAllProjectsIdsUsingProjectRepositories()
RepositoryDefinitionManagerfindAllProjectsIdsUsingProjectRepositories in interface RepositoryDefinitionManagerCopyright © 2024 Atlassian Software Systems Pty Ltd. All rights reserved.