public interface StageService
Modifier and Type | Method and Description |
---|---|
ImmutableChainStage |
addStage(PlanKey planKey,
String name,
String description,
boolean isManual,
boolean isFinal)
Adds a new stage to the specified plan.
|
void |
deleteStage(PlanKey planKey,
long stageId,
BambooClosures.Throwing1<ImmutableChainStage,WebValidationException>... runBefore)
Deletes the given stage and any jobs under the stage.
|
ImmutableChainStage |
getStage(PlanKey planKey,
long stageId)
Get an individual stage from a plan
|
List<ImmutableChainStage> |
getStagesForPlan(PlanKey planKey)
Get all stages in a plan, in order
|
ImmutableChainStage |
moveStage(PlanKey planKey,
long stageId,
int index)
Moves stage to a different position in the plan structure.
|
ImmutableChainStage |
updateStage(PlanKey planKey,
long stageId,
String name,
String description,
boolean manual,
boolean isFinal,
Integer index,
BambooClosures.Throwing1<ImmutableChainStage,WebValidationException>... runBefore)
Update the details of a stage.
|
ErrorCollection |
validateStageForAdd(PlanKey planKey,
String name,
String description,
boolean isManual,
boolean isFinal)
Validates a new stage for the specified plan.
|
ErrorCollection |
validateStageForUpdate(PlanKey planKey,
long stageId,
String name,
String description,
boolean manual,
boolean isFinal)
Validates editing of a stage.
|
@NotNull List<ImmutableChainStage> getStagesForPlan(@NotNull PlanKey planKey)
planKey
- of planNotFoundException
- if the plan does not existorg.acegisecurity.AccessDeniedException
- if user has no WRITE access to the plan@NotNull ImmutableChainStage getStage(@NotNull PlanKey planKey, long stageId) throws WebValidationException
planKey
- the plan the stage belongs tostageId
- the id of the stageNotFoundException
- if the plan or stage does not existorg.acegisecurity.AccessDeniedException
- if user has no WRITE access to the planWebValidationException
@NotNull ImmutableChainStage addStage(@NotNull PlanKey planKey, @NotNull String name, @Nullable String description, boolean isManual, boolean isFinal) throws WebValidationException
planKey
- of plan to add stage toname
- of stagedescription
- of stageisManual
- true if this stage is a manual stageisFinal
- true if stage is a final stageWebValidationException
- if plan does not exist or it is not of the correct type, or if validation fails@NotNull ErrorCollection validateStageForAdd(@NotNull PlanKey planKey, @Nullable String name, @Nullable String description, boolean isManual, boolean isFinal) throws WebValidationException
planKey
- of plan to add stage toname
- of stagedescription
- of stageisManual
- true if this stage is a manual stageWebValidationException
- if plan does not exist or it is not of the correct type@NotNull ErrorCollection validateStageForUpdate(@NotNull PlanKey planKey, long stageId, @Nullable String name, @Nullable String description, boolean manual, boolean isFinal) throws WebValidationException
planKey
- of plan stage belongs tostageId
- if of the stage being editedname
- new name of stagedescription
- new description of stagemanual
- new value for id stage is manual or notisFinal
- if stage is final or notWebValidationException
@NotNull ImmutableChainStage moveStage(@NotNull PlanKey planKey, long stageId, int index) throws WebValidationException
planKey
- key of the plan the stage belongs tostageId
- if of the stage being updatedindex
- new position of the stage in the plan structure, must be a non-negative value. If the index is too
big, the stage will be moved to the end of the list.ImmutableChainStage
representing the updated stageWebValidationException
- if any errors occur@NotNull ImmutableChainStage updateStage(@NotNull PlanKey planKey, long stageId, @NotNull String name, @NotNull String description, boolean manual, boolean isFinal, @Nullable Integer index, @NotNull BambooClosures.Throwing1<ImmutableChainStage,WebValidationException>... runBefore) throws WebValidationException
planKey
- key of the plan the stage belongs tostageId
- if of the stage being updatedname
- the name of the stagedescription
- the description of the stagemanual
- indicates if the stage runs automatically or needs manual interventionindex
- position of the stage in the plan structureImmutableChainStage
representing the updated stageWebValidationException
- if invalidvoid deleteStage(@NotNull PlanKey planKey, long stageId, @NotNull BambooClosures.Throwing1<ImmutableChainStage,WebValidationException>... runBefore) throws WebValidationException
planKey
- key for the plan the stage belongs to.stageId
- id if of the stage being deleted.runBefore
- code to execute after security and validation has passed but before the deletion occurs.WebValidationException
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.