@Internal public interface PlanDao extends BambooObjectWithOidDao<Plan>
Plan
Modifier and Type | Method and Description |
---|---|
List<ImmutableChain> |
filterFavouritedPlans(Collection<? extends ImmutableChain> plans,
com.atlassian.user.User user)
Return a collection of
TopLevelPlan s that are a subset of the given Plan s collection that are favourited by the User |
<T extends Plan> |
findAllPlans(Class<T> planType)
Return a
Plan collection for specified plan type. |
<T extends Plan> |
findAllPlans(Class<T> planType,
int firstResult,
int maxResults)
Return a
Plan collection for specified plan type. |
<T extends Plan> |
findAllPlansByProject(Project project,
Class<T> planType)
|
<T extends Plan> |
findPlansByProject(Project project,
Class<T> planType)
|
<T extends Plan> |
getAllPlansMarkedForDeletion(Class<T> planType)
Returns a list of
Plan s that are ImmutableDeletable.isMarkedForDeletion() for the given type |
int |
getBranchCount(ImmutablePlan plan)
Returns the number of branches that exist for the given plan
|
List<Pair<Number,Number>> |
getBranchesCount()
Returns the number of branches that exist for master plans in Bamboo.
|
List<ChainBranch> |
getBranchesForChain(ImmutableChain chain)
Returns all branches which have the given chain as their master
|
Collection<Job> |
getBranchesForJob(Job job) |
List<ChainBranchIdentifier> |
getBranchIdentifiersForChain(PlanIdentifier chain)
Returns minimal data about all branches which have the given chain as their master
|
List<PlanKey> |
getJobKeys(PlanKey chainKey)
Return all plan keys of Jobs that belong to a Chain
|
BambooEntityOid |
getMaxPlanOid(int serverKey,
BambooEntityType entityType)
Returns the max
BambooEntityOid that's currently in use of the specified entity type, with the
given server key. |
<T extends Plan> |
getPlanByKey(PlanKey planKey,
Class<T> aClass)
Return a
Plan that matches the given key |
<T extends Plan> |
getPlanByKey(String planKey,
Class<T> aClass)
Return a
Plan that matches the given key |
<T extends Plan> |
getPlanByPartialKeyAndName(PlanKey partialPlanKey,
String planName,
Class<T> planType)
|
Class<? extends Plan> |
getPlanClass(PlanKey planKey) |
<T extends Plan> |
getPlanCount(Class<T> planType)
How many plans filtered by
Class currently exist |
PlanIdentifier |
getPlanIdentifierForPermissionCheckingByKey(String planKey)
Return a
Plan skeleton providing ONLY id and key, that matches the given key
This method should be used only for permission checking using Acegi
If Job key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are defined only for TopLevelPlan s |
<T extends Plan> |
getPlanIdentifiersForProject(ProjectIdentifier projectIdentifier,
Class<T> planType,
boolean includeMarkedForDeletion)
Returns minimal data about all plans in the given project
|
<T extends Plan> |
getPlanKeys(Class<T> planType)
Returns all plan keys of a particular type
|
boolean |
isChainNameConflicting(String projectKey,
long planIdToIgnore,
String planName)
Verifies whether a
Chain name is unique with the given project |
boolean |
isPlanKeyConflicting(PlanKey planKey)
Verifies whether a
Plan key is unique within whole Bamboo installation |
boolean |
isPlanKeyConflicting(PlanKey planKey,
long idOfChainBeingVerified)
Verifies whether a
Plan key is unique within whole Bamboo installation |
void |
markPlanForDeletion(PlanKey planKey)
Efficiently marks a plan to be deleted
|
void |
syncDeletionStatusOfJobs()
Performs a cleanup task to mark
Job objects that have a Plan or ChainStage that
is marked to be deleted, but it itself was not marked as deleted. |
findByOid
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
@Nullable <T extends Plan> T getPlanByKey(@NotNull PlanKey planKey, Class<T> aClass)
Plan
that matches the given keyplanKey
- @Nullable <T extends Plan> T getPlanByKey(@NotNull String planKey, Class<T> aClass)
Plan
that matches the given keyplanKey
- @Nullable PlanIdentifier getPlanIdentifierForPermissionCheckingByKey(@NotNull String planKey)
Plan
skeleton providing ONLY id and key, that matches the given key
This method should be used only for permission checking using Acegi
If Job
key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are defined only for TopLevelPlan
splanKey
- boolean isChainNameConflicting(@NotNull String projectKey, long planIdToIgnore, @NotNull String planName)
Chain
name is unique with the given project
projectKey
- of the project to look for the plan inplanIdToIgnore
- the id of the plan that has to be ignored during lookup (when you're saving a Plan, you should supply the plan id here)planName
- - name of the plan inside the project: this is just the plan component of the name (i.e does
not include the project component)boolean isPlanKeyConflicting(@NotNull PlanKey planKey)
Plan
key is unique within whole Bamboo installationplanKey
- key of the plan to be searched for in the databaseboolean isPlanKeyConflicting(@NotNull PlanKey planKey, long idOfChainBeingVerified)
Plan
key is unique within whole Bamboo installationplanKey
- key of the plan to be searched for in the databaseidOfChainBeingVerified
- id of plan that is verified (i.e. if that plan uses the key, it's not a duplicate key)@Nullable <T extends Plan> T getPlanByPartialKeyAndName(@NotNull PlanKey partialPlanKey, @NotNull String planName, Class<T> planType)
partialPlanKey
- planName
- planType
- <T extends Plan> int getPlanCount(Class<T> planType)
Class
currently existplanType
- <T extends Plan> List<T> findPlansByProject(@NotNull Project project, Class<T> planType)
project
- planType
- <T extends Plan> List<T> findAllPlansByProject(@NotNull Project project, Class<T> planType)
project
- planType
- @NotNull <T extends Plan> List<T> findAllPlans(Class<T> planType)
Plan
collection for specified plan type. Does not include plans marked for deletion.T
- planType
- type of plan to be selected from DBPlan
collection for specified plan type@NotNull <T extends Plan> List<T> findAllPlans(Class<T> planType, int firstResult, int maxResults)
Plan
collection for specified plan type. Does not include plans marked for deletion.T
- planType
- type of plan to be selected from DBfirstResult
- firstResult for a paginated resultsmaxResults
- maximum number of results to returnPlan
collection for specified plan typeList<ImmutableChain> filterFavouritedPlans(@NotNull Collection<? extends ImmutableChain> plans, @NotNull com.atlassian.user.User user)
TopLevelPlan
s that are a subset of the given Plan
s collection that are favourited by the User
plans
- user
- @NotNull <T extends Plan> Collection<T> getAllPlansMarkedForDeletion(Class<T> planType)
Plan
s that are ImmutableDeletable.isMarkedForDeletion()
for the given type@NotNull <T extends Plan> List<PlanKey> getPlanKeys(Class<T> planType)
T
- planType
- @NotNull List<PlanKey> getJobKeys(@NotNull PlanKey chainKey)
chainKey
- key of a Chain@NotNull List<ChainBranch> getBranchesForChain(ImmutableChain chain)
chain
- master planCollection<Job> getBranchesForJob(Job job)
@NotNull List<ChainBranchIdentifier> getBranchIdentifiersForChain(@NotNull PlanIdentifier chain)
chain
- master@NotNull <T extends Plan> List<PlanIdentifier> getPlanIdentifiersForProject(@NotNull ProjectIdentifier projectIdentifier, @NotNull Class<T> planType, boolean includeMarkedForDeletion)
projectIdentifier
- - to get plans forplanType
- to filter plans byincludeMarkedForDeletion
- - true if you want to include any results currently marked for deletionint getBranchCount(@NotNull ImmutablePlan plan)
plan
- to count branches ofList<Pair<Number,Number>> getBranchesCount()
void markPlanForDeletion(PlanKey planKey)
planKey
- void syncDeletionStatusOfJobs()
Job
objects that have a Plan
or ChainStage
that
is marked to be deleted, but it itself was not marked as deleted.@Nullable BambooEntityOid getMaxPlanOid(int serverKey, @NotNull BambooEntityType entityType)
BambooEntityOid
that's currently in use of the specified entity type, with the
given server key.
Allowed entity types:
- BambooEntityType.CHAIN
- BambooEntityType.JOB
- BambooEntityType.CHAIN_BRANCH
- BambooEntityType.JOB_BRANCH
Returns null if no OIDs are in use of the specified type with the given server key.IllegalArgumentException
- if the entity type is invalidCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.