public interface PlanRestService
Modifier and Type | Method and Description |
---|---|
void |
assertPlanExistsAndVisible(PlanKey planKey)
Checks if
Plan exists and is visible for calling user |
void |
assertPlanExistsAndVisible(PlanKey planKey,
Class<? extends ImmutablePlan> clazz)
Checks if
Plan exists, has correct type and is visible for calling user |
RestBranchLatestActive |
createLatestActiveBranchResult(ImmutablePlan branch) |
RestPlanBranchList |
createPaginatedBranchResponse(List<? extends ImmutablePlan> branches,
com.atlassian.user.User user,
javax.ws.rs.core.UriInfo uriInfo,
boolean allBranches) |
RestPlans |
createPaginatedPlanResponse(List<? extends ImmutablePlan> plans,
com.atlassian.user.User user,
javax.ws.rs.core.UriInfo uriInfo) |
ImmutablePlan |
getBranchByName(ImmutablePlan plan,
String branchName)
Get branch of a given plan by name.
|
List<ImmutableChainBranch> |
getBranchesForChain(ImmutablePlan plan) |
List<ImmutableJob> |
getBranchesForJob(ImmutableJob job) |
ImmutableChain |
getChainByKey(PlanKey planKey)
Returns a
Plan if plan exists and is visible for calling user |
List<ImmutableJob> |
getJobsForPlan(PlanKey planKey,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of jobs of specified plan.
|
ImmutablePlan |
getPlanByKey(PlanKey planKey)
Returns a
Plan if plan exists and is visible for calling user |
ImmutablePlan |
getPlanByKeyUnchecked(PlanKey planKey)
Returns a
Plan if plan exists. |
<T extends ImmutablePlan> |
getPlans(Class<T> planType,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans.
|
List<ImmutablePlan> |
getPlans(javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans.
|
List<ImmutablePlan> |
getPlansByProject(Project project,
javax.ws.rs.core.UriInfo uriInfo)
Get a list of plans that belong to a project.
|
List<ImmutablePlan> |
getPlansByProject(Project project,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans that belong to a project.
|
List<ImmutablePlan> |
getRunnablePlans(Project project,
javax.ws.rs.core.UriInfo uriInfo)
Get a list of plans that can be run currently logged in user.
|
List<ImmutableChainStage> |
getStagesForPlan(PlanKey planKey,
javax.ws.rs.core.UriInfo uriInfo,
com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of stages of specified plan.
|
boolean |
isPlanCreationAllowed()
Check whether or not a plan can be created or not (based on licensing etc)
|
List<ImmutableChainBranch> getBranchesForChain(ImmutablePlan plan)
List<ImmutableJob> getBranchesForJob(ImmutableJob job)
RestPlanBranchList createPaginatedBranchResponse(List<? extends ImmutablePlan> branches, @Nullable com.atlassian.user.User user, javax.ws.rs.core.UriInfo uriInfo, boolean allBranches)
branches
- user
- uriInfo
- allBranches
- return all branches, even if expand has 'favourites' parameter. This is because 'favourites'
is about plans not branches and all branches of a favourite plan are to be shown@Nullable RestBranchLatestActive createLatestActiveBranchResult(ImmutablePlan branch)
@Nullable ImmutablePlan getBranchByName(@NotNull ImmutablePlan plan, @NotNull String branchName)
plan
- planbranchName
- name of the branch to be fetchedImmutableChainBranch
, ImmutableJob
or null if not foundRestPlans createPaginatedPlanResponse(List<? extends ImmutablePlan> plans, @Nullable com.atlassian.user.User user, javax.ws.rs.core.UriInfo uriInfo)
List<ImmutablePlan> getPlans(@NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
favourite
permission
type
uriInfo
- authenticationContext
- <T extends ImmutablePlan> List<T> getPlans(Class<T> planType, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
favourite
permission
planType
- type of plansuriInfo
- authenticationContext
- List<ImmutableJob> getJobsForPlan(@NotNull PlanKey planKey, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
planKey
- planKeyuriInfo
- authenticationContext
- List<ImmutableChainStage> getStagesForPlan(@NotNull PlanKey planKey, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
planKey
- planKeyuriInfo
- authenticationContext
- List<ImmutablePlan> getPlansByProject(@NotNull Project project, @NotNull javax.ws.rs.core.UriInfo uriInfo)
project
- uriInfo
- List<ImmutablePlan> getPlansByProject(@NotNull Project project, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
project
- uriInfo
- authenticationContext
- List<ImmutablePlan> getRunnablePlans(@NotNull Project project, @NotNull javax.ws.rs.core.UriInfo uriInfo)
project
- uriInfo
- void assertPlanExistsAndVisible(@NotNull PlanKey planKey)
Plan
exists and is visible for calling userplanKey
- NotFoundException,
- AccessDeniedExceptionvoid assertPlanExistsAndVisible(@NotNull PlanKey planKey, @NotNull Class<? extends ImmutablePlan> clazz)
Plan
exists, has correct type and is visible for calling userplanKey
- clazz
- NotFoundException,
- AccessDeniedException@NotNull ImmutableChain getChainByKey(@NotNull PlanKey planKey)
Plan
if plan exists and is visible for calling userplanKey
- NotFoundException,
- AccessDeniedException@NotNull ImmutablePlan getPlanByKey(@NotNull PlanKey planKey)
Plan
if plan exists and is visible for calling userplanKey
- key of a plan to search forImmutablePlan
NotFoundException
- when plan was not foundorg.acegisecurity.AccessDeniedException
- when authenticated user has no permission to the plan@Nullable ImmutablePlan getPlanByKeyUnchecked(@NotNull PlanKey planKey)
Plan
if plan exists. No permission check is performed.planKey
- key of a plan to search forImmutablePlan
or null if not foundboolean isPlanCreationAllowed()
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.