Package com.atlassian.bamboo.repository
Interface RepositoryDefinitionManager
-
- All Superinterfaces:
RepositoryDefinitionAccessor
- All Known Implementing Classes:
RepositoryDefinitionManagerImpl
@PublicApi public interface RepositoryDefinitionManager extends RepositoryDefinitionAccessor
Interface to handle access to repository data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method 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()
Deprecated.since 5.14 usegetLinkedRepositories()
List<RepositoryData>
getGlobalRepositoryDefinitionsForAdministration()
Deprecated.since 5.14 usegetLinkedRepositoriesForAdministration()
List<RepositoryData>
getGlobalRepositoryDefinitionsUnrestricted()
Deprecated.since 5.14List<PlanIdentifier>
getIdentifiersOfPlansUsingRepository(long repositoryId)
Get identifiers of Plans referencing a repository.@NotNull List<PlanIdentifier>
getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId)
Get identifiers ofChain
s referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked) If the parameter refers to a linked repository, onlyTopLevelPlan
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.@NotNull 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.@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<PlanRepositoryLinkDto>
getPlanRepositoryLinkDtos(@NotNull PlanIdentifier plan)
@NotNull List<PlanRepositoryLink>
getPlanRepositoryLinks(@NotNull ImmutablePlan plan)
Get persistent representation of relation between Plan and repositoriesList<PlanRepositoryLink>
getPlansUsingRepository(long repositoryId)
GetPlanRepositoryLink
s 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)
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 plansvoid
removeRepositoriesForPlan(Plan plan)
Remove all repositories fromPlan
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 aRepositoryChangeset
, removes it otherwise.void
removeUnusedRepositories()
Removes all repositories that has been previously markedForDeletion and are no longer referenced by anyRepositoryChangeset
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 toRepositoryDataEntity
long
saveRepositoryDefinition(RepositoryDataEntity repositoryData)
Save repository definition.void
saveRepositoryDefinitions(@NotNull Collection<RepositoryDataEntity> repositoriesBeingCreated)
Saves all repository definitions in the collection.-
Methods inherited from interface com.atlassian.bamboo.repository.RepositoryDefinitionAccessor
getVcsRepositoryDataByOid
-
-
-
-
Method Detail
-
getPlanRepositoryLink
@Nullable @Nullable PlanRepositoryLink getPlanRepositoryLink(@NotNull @NotNull ImmutablePlan plan, long repositoryId)
Get persistent representation of a relation between Plan and repository
-
getPlanRepositoryLinkByName
@Nullable @Nullable PlanRepositoryLink getPlanRepositoryLinkByName(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String repositoryName)
Get persistent representation of a relation between Plan and repository
-
getPlanRepositoryLinks
@NotNull @NotNull List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull @NotNull ImmutablePlan plan)
Get persistent representation of relation between Plan and repositories
-
getRepositoryDataEntity
@Nullable @Nullable RepositoryDataEntity getRepositoryDataEntity(long id)
Get persistent representation of a repository
-
getRepositoryDefinitionsForPlan
@NotNull @Deprecated @NotNull List<RepositoryDefinition> getRepositoryDefinitionsForPlan(@NotNull @NotNull ImmutablePlan plan)
Deprecated.since 5.14Get all repositories attached to a plan ordered by position.
-
getPlanRepositoryDefinitions
@NotNull @NotNull List<PlanRepositoryDefinition> getPlanRepositoryDefinitions(@NotNull @NotNull PlanIdentifier plan)
Get all repositories attached to a plan ordered by position.- Since:
- 5.14
-
getPlanRepositoryLinkDtos
@NotNull @NotNull List<PlanRepositoryLinkDto> getPlanRepositoryLinkDtos(@NotNull @NotNull PlanIdentifier plan)
-
getPlanRepositoriesForExport
@NotNull @NotNull List<PartialVcsRepositoryData> getPlanRepositoriesForExport(@NotNull @NotNull PlanIdentifier plan)
Get all repositories attached to a plan in form suitable for export.- Since:
- 5.14
-
removeRepositoriesForPlan
void removeRepositoriesForPlan(Plan plan)
Remove all repositories fromPlan
that are not global repositories.
-
saveRepositoryDefinition
long saveRepositoryDefinition(RepositoryDataEntity repositoryData)
Save repository definition.- Returns:
- id of saved definition
-
saveRepositoryDefinitions
void saveRepositoryDefinitions(@NotNull @NotNull Collection<RepositoryDataEntity> repositoriesBeingCreated)
Saves all repository definitions in the collection.
-
savePlanRepositoryWithDefinition
long savePlanRepositoryWithDefinition(@NotNull @NotNull PlanRepositoryLink planRepository)
Saves plan to repository relation definition with cascade toRepositoryDataEntity
- Returns:
- new repository entity id
-
savePlanRepositoryLink
void savePlanRepositoryLink(@NotNull @NotNull PlanRepositoryLink planRepository)
-
savePlanRepositoryLinks
void savePlanRepositoryLinks(@NotNull @NotNull List<PlanRepositoryLink> planRepositories)
Saves the collection of plan to repository relations.
-
removeRepositoryIfUnused
void removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity)
Marks repository for deletion if it is referenced by aRepositoryChangeset
, removes it otherwise.
-
removeUnusedRepositories
void removeUnusedRepositories()
Removes all repositories that has been previously markedForDeletion and are no longer referenced by anyRepositoryChangeset
-
removeRepositoryFromPlan
void removeRepositoryFromPlan(@NotNull @NotNull PlanRepositoryLink planRepository)
Removes relation between repository and plan. If the repository is not a global repository,removeRepositoryIfUnused(RepositoryDataEntity)
is called.
-
getGlobalRepositoryDefinitions
@Deprecated List<RepositoryData> getGlobalRepositoryDefinitions()
Deprecated.since 5.14 usegetLinkedRepositories()
Get all Shared repositories current user has permission to use in his plans.
-
getGlobalRepositoryDefinitionsForAdministration
@Deprecated List<RepositoryData> getGlobalRepositoryDefinitionsForAdministration()
Deprecated.since 5.14 usegetLinkedRepositoriesForAdministration()
Get all Shared repositories current user has permission to administrate.
-
getLinkedRepositories
@NotNull @NotNull List<VcsRepositoryData> getLinkedRepositories()
Get all linked repositories current user has permission to use in his plans.- Specified by:
getLinkedRepositories
in interfaceRepositoryDefinitionAccessor
-
getLinkedRepositoriesForAdministration
List<VcsRepositoryData> getLinkedRepositoriesForAdministration()
Get all Shared repositories current user has permission to administrate.
-
getGlobalRepositoryDefinitionsUnrestricted
@Deprecated List<RepositoryData> getGlobalRepositoryDefinitionsUnrestricted()
Deprecated.since 5.14Get all Shared Repositories without permission checking.
-
getLinkedRepositoriesForExport
@NotNull @NotNull List<VcsRepositoryData> getLinkedRepositoriesForExport()
Get all linked repositories in a form suitable for export.- Since:
- 9.5
-
entityToVcsData
@Nullable @Nullable VcsRepositoryData entityToVcsData(@Nullable @Nullable RepositoryDataEntity input)
-
getVcsRepositoryData
@Nullable @Nullable VcsRepositoryData getVcsRepositoryData(long repositoryId)
Get plugin-agnostic representation of a repository configuration.
-
entityToUnmergedData
PartialVcsRepositoryData entityToUnmergedData(@NotNull @NotNull RepositoryDataEntity entity)
- Parameters:
entity
- should be in decoded state.
-
getVcsRepositoryDataForEditing
@Nullable @Nullable PartialVcsRepositoryData getVcsRepositoryDataForEditing(long repositoryId)
-
getLinkedRepositoriesUnrestricted
List<VcsRepositoryData> getLinkedRepositoriesUnrestricted()
Get all linked repositories without permission checking.
-
getPlansUsingRepository
List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
GetPlanRepositoryLink
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 alsogetIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long)
-
getIdentifiersOfPlansUsingRepository
List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
Get identifiers of Plans referencing a repository. This is faster than getPlansUsingRepository() and should be preferred for 'view' actions. This method only returns plans that are directly linked to the repository. This means, that since Bamboo 5.14, it will return no results for linked repository. See alsogetIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long)
- Since:
- 4.2
-
findRepositoriesByPluginKey
@NotNull @NotNull List<RepositoryDataEntity> findRepositoriesByPluginKey(@NotNull @NotNull String pluginKey)
Given a pluginKey this will get you all the repositories in Bamboo that were created for that key. Irrespective of whether:- The plugin module with that plugin key is currently disabled.
- The repository is marked for deletion.
- The repository is marked as global or not.
- Parameters:
pluginKey
- The plugin key to search for.- Returns:
- All the repositories that match that plugin key.
-
getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren
@NotNull @NotNull List<PlanIdentifier> getIdentifiersOfPlansUsingRepositoryOrItsDirectChildren(long repositoryId)
Get identifiers ofChain
s referencing a repository, either directly or through inheritance (only direct parent-child relationship is checked) If the parameter refers to a linked repository, onlyTopLevelPlan
s are returned. If the parameter refers to a plan local repository, it will return the plan the repository is linked to and all itsChainBranch
es- Since:
- 5.14
-
isRepositoryOrItsDirectChildrenUsedInPlans
boolean isRepositoryOrItsDirectChildrenUsedInPlans(long repositoryId)
Checks if repository is used in plans- Since:
- 8.2
-
getLinkedRepositoryByName
@Nullable @Nullable VcsRepositoryData getLinkedRepositoryByName(String name)
Find a linked repository by name.- Parameters:
name
- of linked repository- Returns:
- linked repository
- Since:
- 5.15
-
findAllTopLevelRepositoriesIds
@NotNull @NotNull Set<Long> findAllTopLevelRepositoriesIds()
Get ids of all repositories that doesn't have parent repository (are either linked or are created on plan level)- Since:
- 7.0
-
getProjectRepositoryByName
@Nullable @Nullable VcsRepositoryData getProjectRepositoryByName(String name, Long projectId)
Find a project repository by name in project associated with given projectId.- Parameters:
name
-projectId
-- Returns:
- RepositoryDataEntity if repository exists otherwise null.
-
countAllProjectsRepositories
@NotNull @NotNull Long countAllProjectsRepositories()
Count all project repositories.- Returns:
- a Long count of all project repositories
-
findAllProjectsIdsUsingProjectRepositories
@NotNull @NotNull List<Long> findAllProjectsIdsUsingProjectRepositories()
Find all project which are using project repositories.- Returns:
- a list of all projects IDs which are using project repositories
-
getProjectRepositories
@NotNull @NotNull List<VcsRepositoryData> getProjectRepositories(long projectId)
Find all repositories in a project with given id.- Returns:
- a list of all project repositories
-
getProjectRepositoriesRestricted
List<VcsRepositoryData> getProjectRepositoriesRestricted(long projectId)
Get all project repositories current user has permission to use in his plans connected with requested project ID.- Parameters:
projectId
-- Returns:
- a list of all project repositories
- Since:
- 9.1
-
-