com.atlassian.bamboo.repository
Interface RepositoryDefinitionManager

All Known Implementing Classes:
RepositoryDefinitionManagerImpl

public interface RepositoryDefinitionManager

Interface to handle access to repository data.


Method Summary
 java.util.List<RepositoryData> getGlobalRepositoryDefinitions()
          Get all Shared repositories current user has permission to use in his plans.
 java.util.List<RepositoryData> getGlobalRepositoryDefinitionsUnrestricted()
          Get all Shared Repositories without permission checking.
 java.util.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
 java.util.List<PlanRepositoryLink> getPlanRepositoryLinks(ImmutablePlan plan)
          Get persistent representation of relation between Plan and repositories
 java.util.List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)
           
 RepositoryDataEntity getRepositoryDataEntity(long id)
          Get persistent representation of a repository
 java.util.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(java.util.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(java.util.Collection<RepositoryDataEntity> repositoriesBeingCreated)
          Saves all repository definitions in the collection.
 

Method Detail

getPlanRepositoryLink

@Nullable
PlanRepositoryLink getPlanRepositoryLink(@NotNull
                                                  ImmutablePlan plan,
                                                  long repositoryId)
Get persistent representation of a relation between Plan and repository

Parameters:
plan -
repositoryId -

getPlanRepositoryLinks

@NotNull
java.util.List<PlanRepositoryLink> getPlanRepositoryLinks(@NotNull
                                                                  ImmutablePlan plan)
Get persistent representation of relation between Plan and repositories

Parameters:
plan -

getRepositoryDataEntity

@Nullable
RepositoryDataEntity getRepositoryDataEntity(long id)
Get persistent representation of a repository

Parameters:
id -
Returns:

getRepositoryDefinitionsForPlan

@NotNull
java.util.List<RepositoryDefinition> getRepositoryDefinitionsForPlan(@NotNull
                                                                             ImmutablePlan plan)
Get all repositories attached to a plan ordered by position.

Parameters:
plan -
Returns:

removeRepositoriesForPlan

void removeRepositoriesForPlan(Plan plan)
Remove all repositories from Plan that are not global repositories.

Parameters:
plan -

saveRepositoryDefinition

long saveRepositoryDefinition(RepositoryDataEntity repositoryData)
Save repository definition.

Parameters:
repositoryData -
Returns:
id of saved definition

saveRepositoryDefinitions

void saveRepositoryDefinitions(@NotNull
                               java.util.Collection<RepositoryDataEntity> repositoriesBeingCreated)
Saves all repository definitions in the collection.

Parameters:
repositoriesBeingCreated -

savePlanRepositoryWithDefinition

long savePlanRepositoryWithDefinition(@NotNull
                                      PlanRepositoryLink planRepository)
Saves plan to repository relation definition with cascade to RepositoryDataEntity

Parameters:
planRepository -
Returns:

savePlanRepositoryLink

void savePlanRepositoryLink(@NotNull
                            PlanRepositoryLink planRepository)

savePlanRepositoryLinks

void savePlanRepositoryLinks(@NotNull
                             java.util.List<PlanRepositoryLink> planRepositories)
Saves the collection of plan to repository relations.

Parameters:
planRepositories -

removeRepositoryIfUnused

void removeRepositoryIfUnused(RepositoryDataEntity repositoryDataEntity)
Marks repository for deletion if it is referenced by a RepositoryChangeset, removes it otherwise.

Parameters:
repositoryDataEntity -

removeUnusedRepositories

void removeUnusedRepositories()
Removes all repositories that has been previously markedForDeletion and are no longer referenced by any RepositoryChangeset


removeRepositoryFromPlan

void removeRepositoryFromPlan(@NotNull
                              PlanRepositoryLink planRepository)
Removes relation between repository and plan. If the repository is not a global repository, removeRepositoryIfUnused(RepositoryDataEntity) is called.

Parameters:
planRepository -

getGlobalRepositoryDefinitions

java.util.List<RepositoryData> getGlobalRepositoryDefinitions()
Get all Shared repositories current user has permission to use in his plans.

Returns:

getGlobalRepositoryDefinitionsUnrestricted

java.util.List<RepositoryData> getGlobalRepositoryDefinitionsUnrestricted()
Get all Shared Repositories without permission checking.

Returns:

getPlansUsingRepository

java.util.List<PlanRepositoryLink> getPlansUsingRepository(long repositoryId)

getIdentifiersOfPlansUsingRepository

java.util.List<PlanIdentifier> getIdentifiersOfPlansUsingRepository(long repositoryId)
Get identifiers of Plans referencing a repository. This is faster than getPlansUsingRepository() and should be preferred for 'view' actions.

Parameters:
repositoryId -
Since:
4.2


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.