Class RestStageServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.plugins.rest.plan.stage.RestStageServiceImpl
-
- All Implemented Interfaces:
RestStageService
@Component public class RestStageServiceImpl extends Object implements RestStageService
Provides stage information and operations in restful formats
-
-
Constructor Summary
Constructors Constructor Description RestStageServiceImpl(BuildExecutionManager buildExecutionManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, PlanRestService planRestService, RestArtifactService restArtifactService, RestJobService restJobService, StageConversionFunction stageConversionFunction, StageService stageService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteStage(@NotNull PlanKey planKey, long stageId, @NotNull io.atlassian.fugue.Option<ConfirmationToken> confirmationToken, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Deletes the given stage.@NotNull RestWarnings
getStageDeletionWarnings(@NotNull PlanKey planKey, long stageId, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Get warnings related to stage deletion.@NotNull RestWarnings
getStageMoveWarnings(@NotNull PlanKey planKey, long stageId, int index, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Returns warnings related to a stage move action.@NotNull RestStage
updateStage(@NotNull PlanKey planKey, long stageId, @NotNull RestStage updatedStage, @NotNull io.atlassian.fugue.Option<ConfirmationToken> token, @Nullable Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Performs a partial update on a stage, updating just the fields that are specified while the rest will remain the same.
-
-
-
Constructor Detail
-
RestStageServiceImpl
@Autowired public RestStageServiceImpl(BuildExecutionManager buildExecutionManager, com.atlassian.sal.api.message.I18nResolver i18nResolver, PlanRestService planRestService, RestArtifactService restArtifactService, RestJobService restJobService, StageConversionFunction stageConversionFunction, StageService stageService)
-
-
Method Detail
-
updateStage
@NotNull public @NotNull RestStage updateStage(@NotNull @NotNull PlanKey planKey, long stageId, @NotNull @NotNull RestStage updatedStage, @NotNull @NotNull io.atlassian.fugue.Option<ConfirmationToken> token, @Nullable @Nullable Expansion expansion, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Description copied from interface:RestStageService
Performs a partial update on a stage, updating just the fields that are specified while the rest will remain the same. If a token is provided, will only update the stage is the token is up to date.- Specified by:
updateStage
in interfaceRestStageService
- Parameters:
planKey
- of the plan the stage belongs tostageId
- id of stage being updatedupdatedStage
- partial representation of a stage, only the specified fields will be updatedtoken
- checks we have a token that applies to the current status of the stage, and not an obsolete versionexpansion
- fields to expand in the stage representation included in the responseuriInfo
- URI info from the request- Returns:
RestStage
updated version- Throws:
WebValidationException
- if the stage cannot be updated due to invalid request
-
deleteStage
public void deleteStage(@NotNull @NotNull PlanKey planKey, long stageId, @NotNull @NotNull io.atlassian.fugue.Option<ConfirmationToken> confirmationToken, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Description copied from interface:RestStageService
Deletes the given stage. Also removes any jobs under the stage.- Specified by:
deleteStage
in interfaceRestStageService
- Parameters:
planKey
- of plan stage belongs to.stageId
- id of stage being removed.confirmationToken
- The token to match before performing the deleteuriInfo
- URI info from the request- Throws:
WebValidationException
-
getStageDeletionWarnings
@NotNull public @NotNull RestWarnings getStageDeletionWarnings(@NotNull @NotNull PlanKey planKey, long stageId, @NotNull @NotNull Expansion expansion, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Description copied from interface:RestStageService
Get warnings related to stage deletion. This will return a structure with one entry for each artifact subscription. The entry for the artifact subscription will contain a list of all consuming jobs.- Specified by:
getStageDeletionWarnings
in interfaceRestStageService
- Parameters:
planKey
- of plan stage is instageId
- of stage to deleteexpansion
- the expansion.uriInfo
- URI info from the request- Returns:
- an object with information needed to display warnings to the user
- Throws:
WebValidationException
-
getStageMoveWarnings
@NotNull public @NotNull RestWarnings getStageMoveWarnings(@NotNull @NotNull PlanKey planKey, long stageId, int index, @NotNull @NotNull Expansion expansion, @NotNull @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Description copied from interface:RestStageService
Returns warnings related to a stage move action. This will return a structure with one entry for each artifact subscription that will be broken if the stage is moved. The entry for the artifact subscription will contain a list of all consumer jobs.- Specified by:
getStageMoveWarnings
in interfaceRestStageService
- Parameters:
planKey
- plan key of the plan the stage is instageId
- identifies the stage to moveindex
- zero-based position the stage will be moved intoexpansion
- the fields to expand in the warnings responseuriInfo
- URI info from the request- Returns:
RestWarnings
with warnings if any, and a token- Throws:
WebValidationException
- if the planKey is not valid
-
-