Class RestStageServiceImpl

  • All Implemented Interfaces:
    RestStageService

    @Component
    public class RestStageServiceImpl
    extends Object
    implements RestStageService
    Provides stage information and operations in restful formats
    • 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 interface RestStageService
        Parameters:
        planKey - of the plan the stage belongs to
        stageId - id of stage being updated
        updatedStage - partial representation of a stage, only the specified fields will be updated
        token - checks we have a token that applies to the current status of the stage, and not an obsolete version
        expansion - fields to expand in the stage representation included in the response
        uriInfo - 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 interface RestStageService
        Parameters:
        planKey - of plan stage belongs to.
        stageId - id of stage being removed.
        confirmationToken - The token to match before performing the delete
        uriInfo - 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 interface RestStageService
        Parameters:
        planKey - of plan stage is in
        stageId - of stage to delete
        expansion - 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 interface RestStageService
        Parameters:
        planKey - plan key of the plan the stage is in
        stageId - identifies the stage to move
        index - zero-based position the stage will be moved into
        expansion - the fields to expand in the warnings response
        uriInfo - URI info from the request
        Returns:
        RestWarnings with warnings if any, and a token
        Throws:
        WebValidationException - if the planKey is not valid