@PublicApi
public interface PlanManager
Use this manager if you need to address Builds, Plans, etc.
Modifier and Type | Method and Description |
---|---|
boolean |
assertPlanPermission(@NotNull PlanIdentifier plan)
Used to validate user permission for plan.
|
void |
createPlan(Plan plan)
Same as savePlan, but create permissions used instead of edit permissions.
|
void |
deletePlan(@NotNull Plan plan)
Removes the plan object from the database.
|
@NotNull Set<ImmutableChain> |
filterFavouritedPlans(@NotNull Collection<? extends ImmutableChain> plans,
@NotNull com.atlassian.user.User user)
Return a set of
Plan s that are a subset of the given TopLevelPlan s
collection that are favourited by the User . |
@NotNull List<Chain> |
getAllChainsAndJobsUnrestricted()
WARNING this is probably a bad idea from a performance perspective, only do this if you're going to
traverse through all the
ChainStage and Job of all Chain s returned. |
<T extends Plan> |
getAllPlanKeys(Class<T> planType)
Deprecated.
since 6.2 with no replacement
|
@NotNull List<TopLevelPlan> |
getAllPlans()
Deprecated.
since 5.0 please use
CachedPlanManager |
<T extends Plan> |
getAllPlans(Class<T> planType)
|
<T extends Plan> |
getAllPlans(Class<T> planType,
int firstResult,
int maxResults)
|
<T extends Plan> |
getAllPlansByProject(Project project,
Class<T> planType)
|
<T extends Plan> |
getAllPlansMarkedForDeletion(Class<T> planType)
Deprecated.
since 9.0 use
PlanDao.getAllPlansMarkedForDeletion(Class) directly. |
List<TopLevelPlan> |
getAllPlansUnrestricted()
Returns all
TopLevelPlan 's ignoring permissions |
Set<ImmutableChain> |
getFavouritePlans(@NotNull com.atlassian.user.User user) |
@NotNull Set<Long> |
getFavouritePlansIds(@NotNull com.atlassian.user.User user)
Return a collection of Favourite plan ids.
|
@Nullable Plan |
getPlanById(long id)
Returns a
Plan by its id |
<T extends Plan> |
getPlanById(long id,
Class<T> planType)
|
@Nullable Plan |
getPlanByKey(@NotNull PlanKey planKey)
|
<T extends Plan> |
getPlanByKey(@NotNull PlanKey planKey,
Class<T> planType)
|
@Nullable Plan |
getPlanByKey(@NotNull String planKey)
Deprecated.
since 4.2
|
<T extends Plan> |
getPlanByKey(@NotNull String planKey,
Class<T> planType)
Deprecated.
since 4.2
|
<T extends Plan> |
getPlanByKeyIfOfType(@NotNull PlanKey planKey,
@NotNull Class<T> planType)
|
<T extends Plan> |
getPlanByOid(BambooEntityOid oid,
Class<T> planType)
|
<T extends Plan> |
getPlanByPartialKeyAndName(@NotNull PlanKey partialPlanKey,
@NotNull String planName,
Class<T> planType)
Deprecated.
since 4.2
|
@Nullable Class<? extends Plan> |
getPlanClass(@NotNull PlanKey planKey) |
int |
getPlanCount() |
<T extends Plan> |
getPlanCount(Class<T> planType)
How many plans filtered by
Class currently exist |
int |
getPlanCount(@NotNull ProjectIdentifier projectIdentifier)
How many plans currently exist in a
project . |
@Nullable PlanIdentifier |
getPlanIdentifierForPermissionCheckingByKey(@NotNull String planKey)
Returns a
Plan skeleton skeleton providing ONLY id and key, that matches the given key This method should
be used only for permission checking using Acegi |
<T extends Plan> |
getPlanIdentifiersForProject(@NotNull ProjectIdentifier project,
@NotNull Class<T> planType,
boolean includeMarkedForDeletion)
Retrieve a list of plans for a given project.
|
@NotNull List<TopLevelPlan> |
getPlansByProject(Project project)
Returns all
TopLevelPlan 's filtered by Project
Result of this method is filtered by Acegi. |
<T extends Plan> |
getPlansByProject(Project project,
Class<T> planType)
|
<T extends Plan> |
getProjectPlanMap(Class<T> planType,
boolean includeEmptyProjects)
|
boolean |
isChainNameConflicting(@NotNull String projectKey,
long planIdToIgnore,
@NotNull String planName)
Verifies whether a
Chain name is unique with the given project |
boolean |
isPlanCreationAllowed()
Check whether or not a plan can be created or not (based on licensing etc)
|
boolean |
isPlanKeyConflicting(@NotNull PlanKey planKey)
Verifies whether a
Plan key is unique within whole Bamboo installation |
boolean |
isPlanKeyConflicting(@NotNull PlanKey planKey,
long planIdToIgnore)
Verifies whether a
Plan key is unique within whole Bamboo installation |
void |
markPlansForDeletion(PlanKey planKey)
Efficiently marks a plan to be deleted
|
void |
removeStages(@NotNull PlanKey key,
@NotNull Collection<Long> stageIds)
Remove the tages from the plan specified.
|
void |
savePlan(@NotNull Plan plan)
Saves the
Plan |
void |
savePlanWithSchedulesStopped(@NotNull Plan plan)
Saves the
Plan while polling jobs are stopped. |
void |
setPlanSuspendedState(PlanKey planKey,
boolean isSuspended) |
void |
syncDeletionStatusOfChainBranches()
Deprecated.
since 9.0 use
PlanDao.syncDeletionStatusOfChainBranches() ()} directly |
void |
syncDeletionStatusOfJobs()
Deprecated.
since 9.0 use
PlanDao.syncDeletionStatusOfJobs() directly |
void |
syncDeletionStatusOfPlans()
Deprecated.
since 9.0 use
PlanDao.syncDeletionStatusOfPlans() ()} directly |
void |
triggerConfigUpdatedEventsForPlansInProject(@NotNull Project project)
Triggers updated events for every plan in a project regardless of permissions.
|
@Nullable @Nullable PlanIdentifier getPlanIdentifierForPermissionCheckingByKey(@NotNull @NotNull String planKey)
Plan
skeleton 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
planKey
- of the plan to findIncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable @Nullable Plan getPlanById(long id) throws IncorrectPlanTypeException
Plan
by its idid
- of the planIncorrectPlanTypeException
- if plan cannot be found@Nullable <T extends Plan> T getPlanById(long id, Class<T> planType) throws IncorrectPlanTypeException
id
- of the planplanType
- - the type of the plan to retrieveIncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable <T extends Plan> T getPlanByOid(BambooEntityOid oid, Class<T> planType) throws IncorrectPlanTypeException
oid
- of the planplanType
- - the type of the plan to retrieveIncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable @Nullable Plan getPlanByKey(@NotNull @NotNull PlanKey planKey) throws IncorrectPlanTypeException
planKey
- to search forIncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable <T extends Plan> T getPlanByKey(@NotNull @NotNull PlanKey planKey, Class<T> planType) throws IncorrectPlanTypeException
planKey
- to search forplanType
- - the type of the plan to retrieveIncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable <T extends Plan> T getPlanByKeyIfOfType(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull Class<T> planType)
Plan
by its planKey and if it's of the type Class
. Does not throw IncorrectPlanTypeException
. Should only be used when the type of the plan can not be known.planKey
- to search forplanType
- the type of the plan to retrieve@NotNull @Deprecated @NotNull List<TopLevelPlan> getAllPlans()
CachedPlanManager
TopLevelPlan
'sList<TopLevelPlan> getAllPlansUnrestricted()
TopLevelPlan
's ignoring permissions@NotNull <T extends Plan> @NotNull List<T> getAllPlans(Class<T> planType)
planType
- - the type of the plan to retrieveDescriptionProvider.getName()
@NotNull @Deprecated <T extends Plan> @NotNull List<PlanKey> getAllPlanKeys(Class<T> planType)
planType
- - the type of the plan to retrieve@NotNull <T extends Plan> @NotNull List<T> getAllPlans(Class<T> planType, int firstResult, int maxResults)
planType
- - the type of the plan to retrievefirstResult
- firstResult for a paginated resultsmaxResults
- maximum number of results to returnDescriptionProvider.getName()
@NotNull @NotNull List<Chain> getAllChainsAndJobsUnrestricted()
ChainStage
and Job
of all Chain
s returned.@NotNull @NotNull List<TopLevelPlan> getPlansByProject(Project project)
TopLevelPlan
's filtered by Project
Result of this method is filtered by Acegi.project
- - that the plans will belong toTopLevelPlan
plans contained within the given project@NotNull <T extends Plan> @NotNull List<T> getPlansByProject(Project project, Class<T> planType)
project
- - that the plans will belong toplanType
- - the type of the plan to retrieve@NotNull <T extends Plan> @NotNull List<T> getAllPlansByProject(Project project, Class<T> planType)
project
- - that the plans will belong toplanType
- - the type of the plan to retrieve@NotNull <T extends Plan> @NotNull Map<Project,Collection<T>> getProjectPlanMap(Class<T> planType, boolean includeEmptyProjects)
@NotNull <T extends Plan> @NotNull List<PlanIdentifier> getPlanIdentifiersForProject(@NotNull @NotNull ProjectIdentifier project, @NotNull @NotNull Class<T> planType, boolean includeMarkedForDeletion)
project
- to get plans forplanType
- to filter plans byincludeMarkedForDeletion
- set to true if you want to return plans marked for deletionSet<ImmutableChain> getFavouritePlans(@NotNull @NotNull com.atlassian.user.User user)
@NotNull @NotNull Set<Long> getFavouritePlansIds(@NotNull @NotNull com.atlassian.user.User user)
user
- @NotNull @NotNull Set<ImmutableChain> filterFavouritedPlans(@NotNull @NotNull Collection<? extends ImmutableChain> plans, @NotNull @NotNull com.atlassian.user.User user)
Plan
s that are a subset of the given TopLevelPlan
s
collection that are favourited by the User
. Plans are not filtered by read permission.plans
- to filteruser
- to return the favourites ofChain
s that are a subset of the given TopLevelPlan
s collection that are favourited by the User
@Internal @Deprecated @NotNull <T extends Plan> @NotNull Collection<T> getAllPlansMarkedForDeletion(Class<T> planType)
PlanDao.getAllPlansMarkedForDeletion(Class)
directly.Plan
s that are ImmutableDeletable.isMarkedForDeletion()
for the given typeint getPlanCount()
Buildable
's exists<T extends Plan> int getPlanCount(Class<T> planType)
Class
currently existplanType
- - the type of the plan to retrieveint getPlanCount(@NotNull @NotNull ProjectIdentifier projectIdentifier)
project
.projectIdentifier
- identifier of the projectboolean isChainNameConflicting(@NotNull @NotNull String projectKey, long planIdToIgnore, @NotNull @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 @NotNull PlanKey planKey)
Plan
key is unique within whole Bamboo installationplanKey
- key of the plan to be searched for in the databaseboolean isPlanKeyConflicting(@NotNull @NotNull PlanKey planKey, long planIdToIgnore)
Plan
key is unique within whole Bamboo installationplanKey
- planIdToIgnore
- id of plan which we want to set key for, if the key is used by that plan, it's not really conflicting@Nullable @Deprecated <T extends Plan> T getPlanByPartialKeyAndName(@NotNull @NotNull PlanKey partialPlanKey, @NotNull @NotNull String planName, Class<T> planType) throws IncorrectPlanTypeException
IncorrectPlanTypeException
- if plan cannot be found with the correct type@Nullable @Nullable Class<? extends Plan> getPlanClass(@NotNull @NotNull PlanKey planKey)
boolean assertPlanPermission(@NotNull @NotNull PlanIdentifier plan)
plan
- to check the permissions ofboolean isPlanCreationAllowed()
void savePlanWithSchedulesStopped(@NotNull @NotNull Plan plan)
Plan
while polling jobs are stopped.plan
- void setPlanSuspendedState(PlanKey planKey, boolean isSuspended)
void triggerConfigUpdatedEventsForPlansInProject(@NotNull @NotNull Project project)
project
- to trigger event for.void createPlan(Plan plan)
void deletePlan(@NotNull @NotNull Plan plan)
DeletionService
rather than using this method directlyplan
- to delete.void markPlansForDeletion(PlanKey planKey)
planKey
- @Internal @Deprecated void syncDeletionStatusOfPlans()
PlanDao.syncDeletionStatusOfPlans()
()} directly@Internal @Deprecated void syncDeletionStatusOfChainBranches()
PlanDao.syncDeletionStatusOfChainBranches()
()} directlyChainBranch
objects that have a master Plan
that is marked
to be deleted, but is not marked as deleted.@Internal @Deprecated void syncDeletionStatusOfJobs()
PlanDao.syncDeletionStatusOfJobs()
directlyJob
objects that have a Plan
or ChainStage
that is marked
to be deleted, but it itself was not marked as deleted.void removeStages(@NotNull @NotNull PlanKey key, @NotNull @NotNull Collection<Long> stageIds)
Chain
key
- stageIds
- @Nullable @Deprecated @Nullable Plan getPlanByKey(@NotNull @NotNull String planKey) throws IncorrectPlanTypeException
Plan
by its planKeyplanKey
- of the plan to findIncorrectPlanTypeException
- if plan cannot be found with the correct type (should never happen)@Nullable @Deprecated <T extends Plan> T getPlanByKey(@NotNull @NotNull String planKey, Class<T> planType) throws IncorrectPlanTypeException
planKey
- to search forplanType
- - the type of the plan to retrieveIncorrectPlanTypeException
- if plan cannot be found with the correct typeCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.