@PublicApi public interface RepositoryDefinitionManager extends RepositoryDefinitionAccessor
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 of the repositories in Bamboo that were created for that key.
|
List<RepositoryData> |
getGlobalRepositoryDefinitions()
Deprecated.
since 5.14 use
getLinkedRepositories() |
List<RepositoryData> |
getGlobalRepositoryDefinitionsForAdministration()
Deprecated.
since 5.14 use
getLinkedRepositoriesForAdministration() |
List<RepositoryData> |
getGlobalRepositoryDefinitionsUnrestricted()
Deprecated.
since 5.14
|
List<PlanIdentifier> |
getIdentifiersOfPlansUsingRepository(long repositoryId)
Get identifiers of Plans referencing a repository.
|
@NotNull List<PlanIdentifier> |
getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId)
Get identifiers of
Chain s referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked)
If the parameter refers to a linked repository, only TopLevelPlan s 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> |
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.
|
@Nullable PlanRepositoryLink |
getPlanRepositoryLink(@NotNull ImmutablePlan plan,
long repositoryId)
Get persistent representation of a relation between Plan and repository
|
@Nullable PlanRepositoryLink |
getPlanRepositoryLinkByName(@NotNull ImmutablePlan plan,
@NotNull String repositoryName)
Get persistent representation of a relation between Plan and repository
|
@NotNull List<PlanRepositoryLink> |
getPlanRepositoryLinks(@NotNull ImmutablePlan plan)
Get persistent representation of relation between Plan and repositories
|
List<PlanRepositoryLink> |
getPlansUsingRepository(long repositoryId)
Get
PlanRepositoryLink s associated with repository. |
@NotNull List<VcsRepositoryData> |
getProjectRepositories(long projectId)
Find all repositories in a project with given 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)
Deprecated.
since 5.14
|
@Nullable VcsRepositoryData |
getVcsRepositoryData(long repositoryId)
Get plugin-agnostic representation of a repository configuration.
|
@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.
|
getVcsRepositoryDataByOid
@Nullable @Nullable PlanRepositoryLink getPlanRepositoryLink(@NotNull @NotNull ImmutablePlan plan, long repositoryId)
@Nullable @Nullable PlanRepositoryLink getPlanRepositoryLinkByName(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String repositoryName)
@NotNull @NotNull List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull @NotNull ImmutablePlan plan)
@Nullable @Nullable RepositoryDataEntity getRepositoryDataEntity(long id)
@NotNull @Deprecated @NotNull List<RepositoryDefinition> getRepositoryDefinitionsForPlan(@NotNull @NotNull ImmutablePlan plan)
@NotNull @NotNull List<PlanRepositoryDefinition> getPlanRepositoryDefinitions(@NotNull @NotNull PlanIdentifier plan)
@NotNull @NotNull List<PartialVcsRepositoryData> getPlanRepositoriesForExport(@NotNull @NotNull PlanIdentifier plan)
void removeRepositoriesForPlan(Plan plan)
Plan
that are not global repositories.long saveRepositoryDefinition(RepositoryDataEntity repositoryData)
void saveRepositoryDefinitions(@NotNull @NotNull Collection<RepositoryDataEntity> repositoriesBeingCreated)
long savePlanRepositoryWithDefinition(@NotNull @NotNull PlanRepositoryLink planRepository)
RepositoryDataEntity
void savePlanRepositoryLink(@NotNull @NotNull PlanRepositoryLink planRepository)
void savePlanRepositoryLinks(@NotNull @NotNull List<PlanRepositoryLink> planRepositories)
void removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity)
RepositoryChangeset
, removes it otherwise.void removeUnusedRepositories()
RepositoryChangeset
void removeRepositoryFromPlan(@NotNull @NotNull PlanRepositoryLink planRepository)
removeRepositoryIfUnused(RepositoryDataEntity)
is called.@Deprecated List<RepositoryData> getGlobalRepositoryDefinitions()
getLinkedRepositories()
@Deprecated List<RepositoryData> getGlobalRepositoryDefinitionsForAdministration()
getLinkedRepositoriesForAdministration()
@NotNull @NotNull List<VcsRepositoryData> getLinkedRepositories()
getLinkedRepositories
in interface RepositoryDefinitionAccessor
List<VcsRepositoryData> getLinkedRepositoriesForAdministration()
@Deprecated List<RepositoryData> getGlobalRepositoryDefinitionsUnrestricted()
@Nullable @Nullable VcsRepositoryData entityToVcsData(@Nullable @Nullable RepositoryDataEntity input)
@Nullable @Nullable VcsRepositoryData getVcsRepositoryData(long repositoryId)
PartialVcsRepositoryData entityToUnmergedData(@NotNull @NotNull RepositoryDataEntity entity)
entity
- should be in decoded state.@Nullable @Nullable PartialVcsRepositoryData getVcsRepositoryDataForEditing(long repositoryId)
List<VcsRepositoryData> getLinkedRepositoriesUnrestricted()
List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
PlanRepositoryLink
s 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 getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long)
List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long)
@NotNull @NotNull List<RepositoryDataEntity> findRepositoriesByPluginKey(@NotNull @NotNull String pluginKey)
pluginKey
- The plugin key to search for.@NotNull @NotNull List<PlanIdentifier> getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId)
Chain
s referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked)
If the parameter refers to a linked repository, only TopLevelPlan
s are returned.
If the parameter refers to a plan local repository, it will return the plan the repository is linked to and all its ChainBranch
esboolean isRepositoryOrItsDirectChildrenUsedInPlans(long repositoryId)
@Nullable @Nullable VcsRepositoryData getLinkedRepositoryByName(String name)
name
- of linked repository@NotNull @NotNull Set<Long> findAllTopLevelRepositoriesIds()
@Nullable @Nullable VcsRepositoryData getProjectRepositoryByName(String name, Long projectId)
name
- projectId
- @NotNull @NotNull Long countAllProjectsRepositories()
@NotNull @NotNull List<Long> findAllProjectsIdsUsingProjectRepositories()
@NotNull @NotNull List<VcsRepositoryData> getProjectRepositories(long projectId)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.