Class RestJobServiceImpl

  • All Implemented Interfaces:
    RestJobService

    @Component
    public class RestJobServiceImpl
    extends Object
    implements RestJobService
    Provides job information and operations in restful formats
    • Method Detail

      • addJob

        @NotNull
        public @NotNull RestJob addJob​(@NotNull
                                       @NotNull PlanKey planKey,
                                       long stageId,
                                       @Nullable
                                       @Nullable RestJob restJob,
                                       @NotNull
                                       @NotNull Expansion expansion,
                                       @NotNull
                                       @NotNull javax.ws.rs.core.UriInfo uriInfo)
                                throws WebValidationException
        Description copied from interface: RestJobService
        Create a new job
        Specified by:
        addJob in interface RestJobService
        Parameters:
        planKey - of plan job is in
        stageId - of stage job is in
        restJob - Rest Job
        expansion - the expansion.
        uriInfo - URI info from the request
        Returns:
        Rest Job
        Throws:
        WebValidationException
      • updateJob

        @NotNull
        public @NotNull RestJob updateJob​(@NotNull
                                          @NotNull PlanKey jobKey,
                                          @Nullable
                                          @Nullable RestJob restJob,
                                          @NotNull
                                          @NotNull Optional<ConfirmationToken> confirmationToken,
                                          @NotNull
                                          @NotNull Expansion expansion,
                                          @NotNull
                                          @NotNull javax.ws.rs.core.UriInfo uriInfo)
                                   throws WebValidationException
        Description copied from interface: RestJobService
        Updates the details of a specific job. Will ignore missing properties.
        Specified by:
        updateJob in interface RestJobService
        Parameters:
        jobKey - of job.
        restJob - job details.
        confirmationToken - The token to match before performing the update
        expansion - the expansion.
        uriInfo - URI info from the request
        Returns:
        updated job object
        Throws:
        WebValidationException
      • getJobDeletionWarnings

        @NotNull
        public @NotNull RestWarnings getJobDeletionWarnings​(@NotNull
                                                            @NotNull PlanKey jobKey,
                                                            @NotNull
                                                            @NotNull Expansion expansion,
                                                            @NotNull
                                                            @NotNull javax.ws.rs.core.UriInfo uriInfo)
                                                     throws WebValidationException
        Description copied from interface: RestJobService
        Get warnings related to job 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:
        getJobDeletionWarnings in interface RestJobService
        Parameters:
        jobKey - of job
        expansion - the expansion.
        uriInfo - URI info from the request
        Returns:
        an object with information needed to display warnings to the user
        Throws:
        WebValidationException
      • getDeleteConfirmationToken

        @NotNull
        public @NotNull Token getDeleteConfirmationToken​(@NotNull
                                                         @NotNull PlanKey jobKey,
                                                         @NotNull
                                                         @NotNull javax.ws.rs.core.UriInfo uriInfo)
                                                  throws WebValidationException
        Description copied from interface: RestJobService
        Generate the delete confirmation token to be used for the given job key.
        Specified by:
        getDeleteConfirmationToken in interface RestJobService
        Parameters:
        jobKey - job key to generate the token for.
        uriInfo - URI info from the request
        Returns:
        current confirmation token.
        Throws:
        WebValidationException - if the job key is invalid.
      • getJobMoveWarnings

        @NotNull
        public @NotNull RestWarnings getJobMoveWarnings​(@NotNull
                                                        @NotNull PlanKey jobKey,
                                                        long targetStageId,
                                                        @NotNull
                                                        @NotNull Expansion expansion,
                                                        @NotNull
                                                        @NotNull javax.ws.rs.core.UriInfo uriInfo)
                                                 throws WebValidationException
        Description copied from interface: RestJobService
        Get warnings related to job move. 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:
        getJobMoveWarnings in interface RestJobService
        Parameters:
        jobKey - of job.
        targetStageId - id of the stage the job is moving to.
        expansion - the expansion.
        uriInfo - URI info from the request
        Returns:
        an object with information needed to display warnings to the user
        Throws:
        WebValidationException