@Component public class PlanRestServiceImpl extends Object implements PlanRestService
Constructor and Description |
---|
PlanRestServiceImpl(BambooCachingPermissionManagerFacadeFactory bambooCachingPermissionManagerFacadeFactory,
BambooUserManager bambooUserManager,
CachedPlanManager cachedPlanManager,
LabelManager labelManager,
PlanExecutionManager planExecutionManager,
PlanManager planManager,
ResultsSummaryManager resultsSummaryManager) |
Modifier and Type | Method and Description |
---|---|
void |
assertPlanExistsAndVisible(@NotNull PlanKey planKey)
Checks if
Plan exists and is visible for calling user |
void |
assertPlanExistsAndVisible(@NotNull PlanKey planKey,
@NotNull Class<? extends ImmutablePlan> clazz)
Checks if
Plan exists, has correct type and is visible for calling user |
@Nullable RestBranchLatestActive |
createLatestActiveBranchResult(ImmutablePlan branch) |
RestPlanBranchList |
createPaginatedBranchResponse(List<? extends ImmutablePlan> branches,
@Nullable com.atlassian.user.User user,
javax.ws.rs.core.UriInfo uriInfo,
boolean allBranches) |
RestPlans |
createPaginatedPlanResponse(List<? extends ImmutablePlan> plans,
@Nullable com.atlassian.user.User user,
javax.ws.rs.core.UriInfo uriInfo) |
@Nullable ImmutablePlan |
getBranchByName(@NotNull ImmutablePlan plan,
@NotNull String branchName)
Get branch of a given plan by name.
|
List<ImmutableChainBranch> |
getBranchesForChain(ImmutablePlan plan) |
List<ImmutableJob> |
getBranchesForJob(ImmutableJob job) |
@NotNull ImmutableChain |
getChainByKey(@NotNull PlanKey planKey)
Returns a
Plan if plan exists and is visible for calling user |
List<ImmutableJob> |
getJobsForPlan(@NotNull PlanKey planKey,
@NotNull javax.ws.rs.core.UriInfo uriInfo,
@NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of jobs of specified plan.
|
@NotNull ImmutablePlan |
getPlanByKey(@NotNull PlanKey planKey)
Returns a
Plan if plan exists and is visible for calling user |
ImmutablePlan |
getPlanByKeyUnchecked(@NotNull PlanKey planKey)
Returns a
Plan if plan exists. |
<T extends ImmutablePlan> |
getPlans(Class<T> planType,
@NotNull javax.ws.rs.core.UriInfo uriInfo,
@NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans.
|
List<ImmutablePlan> |
getPlans(@NotNull javax.ws.rs.core.UriInfo uriInfo,
@NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans.
|
List<ImmutablePlan> |
getPlansByProject(@NotNull Project project,
@NotNull javax.ws.rs.core.UriInfo uriInfo)
Get a list of plans that belong to a project.
|
List<ImmutablePlan> |
getPlansByProject(@NotNull Project project,
@NotNull javax.ws.rs.core.UriInfo uriInfo,
@NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans that belong to a project.
|
List<ImmutablePlan> |
getRunnablePlans(@NotNull Project project,
@NotNull javax.ws.rs.core.UriInfo uriInfo)
Get a list of plans that can be run currently logged in user.
|
List<ImmutableChainStage> |
getStagesForPlan(@NotNull PlanKey planKey,
@NotNull javax.ws.rs.core.UriInfo uriInfo,
@NotNull 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)
|
@Inject public PlanRestServiceImpl(BambooCachingPermissionManagerFacadeFactory bambooCachingPermissionManagerFacadeFactory, BambooUserManager bambooUserManager, CachedPlanManager cachedPlanManager, LabelManager labelManager, PlanExecutionManager planExecutionManager, PlanManager planManager, ResultsSummaryManager resultsSummaryManager)
public List<ImmutableChainBranch> getBranchesForChain(ImmutablePlan plan)
getBranchesForChain
in interface PlanRestService
public List<ImmutableJob> getBranchesForJob(ImmutableJob job)
getBranchesForJob
in interface PlanRestService
public RestPlans createPaginatedPlanResponse(List<? extends ImmutablePlan> plans, @Nullable @Nullable com.atlassian.user.User user, javax.ws.rs.core.UriInfo uriInfo)
createPaginatedPlanResponse
in interface PlanRestService
public RestPlanBranchList createPaginatedBranchResponse(List<? extends ImmutablePlan> branches, @Nullable @Nullable com.atlassian.user.User user, javax.ws.rs.core.UriInfo uriInfo, boolean allBranches)
createPaginatedBranchResponse
in interface PlanRestService
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 public @Nullable RestBranchLatestActive createLatestActiveBranchResult(ImmutablePlan branch)
createLatestActiveBranchResult
in interface PlanRestService
@Nullable public @Nullable ImmutablePlan getBranchByName(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String branchName)
PlanRestService
getBranchByName
in interface PlanRestService
plan
- planbranchName
- name of the branch to be fetchedImmutableChainBranch
, ImmutableJob
or null if not foundpublic List<ImmutablePlan> getPlans(@NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
PlanRestService
favourite
permission
type
getPlans
in interface PlanRestService
public <T extends ImmutablePlan> List<T> getPlans(Class<T> planType, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
PlanRestService
favourite
permission
getPlans
in interface PlanRestService
planType
- type of planspublic List<ImmutableJob> getJobsForPlan(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
PlanRestService
getJobsForPlan
in interface PlanRestService
planKey
- planKeypublic List<ImmutableChainStage> getStagesForPlan(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
PlanRestService
getStagesForPlan
in interface PlanRestService
planKey
- planKeypublic List<ImmutablePlan> getPlansByProject(@NotNull @NotNull Project project, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo)
PlanRestService
getPlansByProject
in interface PlanRestService
public List<ImmutablePlan> getPlansByProject(@NotNull @NotNull Project project, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
PlanRestService
getPlansByProject
in interface PlanRestService
public List<ImmutablePlan> getRunnablePlans(@NotNull @NotNull Project project, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo)
PlanRestService
getRunnablePlans
in interface PlanRestService
public void assertPlanExistsAndVisible(@NotNull @NotNull PlanKey planKey)
PlanRestService
Plan
exists and is visible for calling userassertPlanExistsAndVisible
in interface PlanRestService
public void assertPlanExistsAndVisible(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull Class<? extends ImmutablePlan> clazz)
PlanRestService
Plan
exists, has correct type and is visible for calling userassertPlanExistsAndVisible
in interface PlanRestService
@NotNull public @NotNull ImmutableChain getChainByKey(@NotNull @NotNull PlanKey planKey)
PlanRestService
Plan
if plan exists and is visible for calling usergetChainByKey
in interface PlanRestService
@NotNull public @NotNull ImmutablePlan getPlanByKey(@NotNull @NotNull PlanKey planKey)
PlanRestService
Plan
if plan exists and is visible for calling usergetPlanByKey
in interface PlanRestService
planKey
- key of a plan to search forImmutablePlan
public ImmutablePlan getPlanByKeyUnchecked(@NotNull @NotNull PlanKey planKey)
PlanRestService
Plan
if plan exists. No permission check is performed.getPlanByKeyUnchecked
in interface PlanRestService
planKey
- key of a plan to search forImmutablePlan
or null if not foundpublic boolean isPlanCreationAllowed()
PlanRestService
isPlanCreationAllowed
in interface PlanRestService
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.