public class RepositoryDefinitionManagerImpl extends Object implements RepositoryDefinitionManager
Constructor and Description |
---|
RepositoryDefinitionManagerImpl(RepositoryDefinitionDao repositoryDefinitionDao,
PlanRepositoryLinkDao planRepositoryLinkDao) |
Modifier and Type | Method and Description |
---|---|
List<RepositoryDataEntity> |
findRepositoriesByPluginKey(String pluginKey)
Given a pluginKey this will get you all of 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.
|
PlanRepositoryLink |
getPlanRepositoryLink(ImmutablePlan plan,
long repositoryId)
Get persistent representation of a relation between Plan and repository
|
List<PlanRepositoryLink> |
getPlanRepositoryLinks(ImmutablePlan plan)
Get persistent representation of relation between Plan and repositories
|
List<PlanRepositoryLink> |
getPlansUsingRepository(long repositoryId) |
RepositoryDataEntity |
getRepositoryDataEntity(long id)
Get persistent representation of a repository
|
List<RepositoryDefinition> |
getRepositoryDefinitionsForPlan(ImmutablePlan plan)
Get all repositories attached to a plan ordered by position.
|
void |
removeRepositoriesForPlan(Plan plan)
Remove all repositories from
Plan that are not global repositories. |
void |
removeRepositoryFromPlan(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(PlanRepositoryLink planRepository) |
void |
savePlanRepositoryLinks(List<PlanRepositoryLink> planRepositories)
Saves the collection of plan to repository relations.
|
long |
savePlanRepositoryWithDefinition(PlanRepositoryLink planRepository)
Saves plan to repository relation definition with cascade to
RepositoryDataEntity |
long |
saveRepositoryDefinition(RepositoryDataEntity repositoryData)
Save repository definition.
|
void |
saveRepositoryDefinitions(Collection<RepositoryDataEntity> repositoriesBeingCreated)
Saves all repository definitions in the collection.
|
public RepositoryDefinitionManagerImpl(RepositoryDefinitionDao repositoryDefinitionDao, PlanRepositoryLinkDao planRepositoryLinkDao)
public PlanRepositoryLink getPlanRepositoryLink(@NotNull ImmutablePlan plan, long repositoryId)
RepositoryDefinitionManager
getPlanRepositoryLink
in interface RepositoryDefinitionManager
@NotNull public List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull ImmutablePlan plan)
RepositoryDefinitionManager
getPlanRepositoryLinks
in interface RepositoryDefinitionManager
@Nullable public RepositoryDataEntity getRepositoryDataEntity(long id)
RepositoryDefinitionManager
getRepositoryDataEntity
in interface RepositoryDefinitionManager
@NotNull public List<RepositoryDefinition> getRepositoryDefinitionsForPlan(@NotNull ImmutablePlan plan)
RepositoryDefinitionManager
getRepositoryDefinitionsForPlan
in interface RepositoryDefinitionManager
public List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
getPlansUsingRepository
in interface RepositoryDefinitionManager
public List<RepositoryData> getGlobalRepositoryDefinitions()
RepositoryDefinitionManager
getGlobalRepositoryDefinitions
in interface RepositoryDefinitionManager
public List<RepositoryData> getGlobalRepositoryDefinitionsForAdministration()
RepositoryDefinitionManager
getGlobalRepositoryDefinitionsForAdministration
in interface RepositoryDefinitionManager
public List<RepositoryData> getGlobalRepositoryDefinitionsUnrestricted()
RepositoryDefinitionManager
getGlobalRepositoryDefinitionsUnrestricted
in interface RepositoryDefinitionManager
public long saveRepositoryDefinition(RepositoryDataEntity repositoryData)
RepositoryDefinitionManager
saveRepositoryDefinition
in interface RepositoryDefinitionManager
public void saveRepositoryDefinitions(@NotNull Collection<RepositoryDataEntity> repositoriesBeingCreated)
RepositoryDefinitionManager
saveRepositoryDefinitions
in interface RepositoryDefinitionManager
public long savePlanRepositoryWithDefinition(@NotNull PlanRepositoryLink planRepository)
RepositoryDefinitionManager
RepositoryDataEntity
savePlanRepositoryWithDefinition
in interface RepositoryDefinitionManager
public void savePlanRepositoryLink(@NotNull PlanRepositoryLink planRepository)
savePlanRepositoryLink
in interface RepositoryDefinitionManager
public void savePlanRepositoryLinks(@NotNull List<PlanRepositoryLink> planRepositories)
RepositoryDefinitionManager
savePlanRepositoryLinks
in interface RepositoryDefinitionManager
public void removeRepositoryFromPlan(@NotNull PlanRepositoryLink planRepository)
RepositoryDefinitionManager
RepositoryDefinitionManager.removeRepositoryIfUnused(RepositoryDataEntity)
is called.removeRepositoryFromPlan
in interface RepositoryDefinitionManager
public void removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity)
RepositoryDefinitionManager
RepositoryChangeset
, removes it otherwise.removeRepositoryIfUnused
in interface RepositoryDefinitionManager
public void removeUnusedRepositories()
RepositoryDefinitionManager
RepositoryChangeset
removeUnusedRepositories
in interface RepositoryDefinitionManager
public void removeRepositoriesForPlan(Plan plan)
RepositoryDefinitionManager
Plan
that are not global repositories.removeRepositoriesForPlan
in interface RepositoryDefinitionManager
public List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
RepositoryDefinitionManager
getIdentifiersOfPlansUsingRepository
in interface RepositoryDefinitionManager
@NotNull public List<RepositoryDataEntity> findRepositoriesByPluginKey(@NotNull String pluginKey)
RepositoryDefinitionManager
findRepositoriesByPluginKey
in interface RepositoryDefinitionManager
pluginKey
- The plugin key to search for.Copyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.