Class BaseUWSResource

java.lang.Object
org.javastro.ivoacore.uws.webapi.BaseUWSResource
All Implemented Interfaces:
UWSControl, UWSCore, UWS

@Produces("application/xml") public abstract class BaseUWSResource extends Object implements UWS
Base JAX-RS resource implementation of the UWS interface, providing default HTTP endpoint implementations delegating to a JobManager.
  • Constructor Details

    • BaseUWSResource

      public BaseUWSResource()
  • Method Details

    • getJobManager

      protected abstract JobManager getJobManager()
      get the JobManager.
      Returns:
      the JobManager.
    • redirectToJob

      protected abstract jakarta.ws.rs.core.Response redirectToJob(String jobid)
      return the correct job redirection. Abstract as that depended on the implementation.
      Parameters:
      jobid - the job identifier. Note if this is null the redirect will be to the job list.
      Returns:
    • listJobs

      @GET public org.javastro.ivoa.entities.uws.Jobs listJobs(@QueryParam("PHASE") String phase, @QueryParam("AFTER") ZonedDateTime after, @QueryParam("LAST") Integer last) throws UWSException
      Description copied from interface: UWSCore
      List of jobs known to the UWS system.
      Specified by:
      listJobs in interface UWSCore
      Parameters:
      phase - filter jobs by execution phase; may be null for no filtering.
      after - filter jobs created after this time; may be null for no filtering.
      last - return only the last N jobs; may be null for no limit.
      Returns:
      the list of jobs matching the filter criteria.
      Throws:
      UWSException - if there is an error accessing the job list.
    • jobDetail

      @GET @Path("/{jobid}") public org.javastro.ivoa.entities.uws.Job jobDetail(@PathParam("jobid") String jobid) throws UWSException
      Description copied from interface: UWSCore
      Get the summary of the current status of a job.
      Specified by:
      jobDetail in interface UWSCore
      Parameters:
      jobid - the identifier of the job to retrieve.
      Returns:
      the UWS Job representing the current state of the job.
      Throws:
      UWSException - if the job cannot be found or accessed.
    • getResults

      @GET @Path("/{jobid}/results") public org.javastro.ivoa.entities.uws.Results getResults(@PathParam("jobid") String jobid) throws UWSException
      Description copied from interface: UWS
      Get the result list for a job. This will not return until the results have been created.
      Specified by:
      getResults in interface UWS
      Parameters:
      jobid - the identifier of the job.
      Returns:
      the Results of the job.
      Throws:
      UWSException - if the job cannot be found or accessed.
    • setPhase

      @POST @Path("/{jobid}/phase") public jakarta.ws.rs.core.Response setPhase(@PathParam("jobid") String jobid, @FormParam("PHASE") String phase) throws UWSException
      Sets the execution phase of a job (e.g., to "RUN" or "ABORT") and redirects to the job resource.
      Parameters:
      jobid - the identifier of the job.
      phase - the new phase string.
      Returns:
      a 303 redirect response to the job resource.
      Throws:
      UWSException - if the phase transition fails.
    • getJobErrorDetail

      @GET @Path("/{jobid}/error") public String getJobErrorDetail(@PathParam("jobid") String jobid) throws UWSException
      Get the error detail message for a job.
      Parameters:
      jobid - the identifier of the job.
      Returns:
      the error message string, or null if no error.
      Throws:
      UWSException - if the job cannot be found or accessed.
    • setDestruction

      @POST @Path("/{jobid}/destruction") public jakarta.ws.rs.core.Response setDestruction(@PathParam("jobid") String jobId, @FormParam("DESTRUCTION") ZonedDateTime destructionTime) throws UWSException
      Description copied from interface: UWSControl
      set the destruction time for a job. The destruction time is the time at which a job will be deteted from the UWS system.
      Specified by:
      setDestruction in interface UWSControl
      Parameters:
      jobId - the identifier of the job.
      destructionTime - the new destruction time for the job.
      Returns:
      a redirect response to the job resource.
      Throws:
      UWSException - if the destruction time cannot be set.
    • setExecutionDuration

      @POST @Path("/{jobid}/executionduration") public jakarta.ws.rs.core.Response setExecutionDuration(@PathParam("jobid") String jobId, @FormParam("EXECUTIONDURATION") Long executionDuration) throws UWSException
      Description copied from interface: UWSControl
      Set the maximum execution duration for a job.
      Specified by:
      setExecutionDuration in interface UWSControl
      Parameters:
      jobId - the identifier of the job.
      executionDuration - A length of time in seconds that the job can run for.
      Returns:
      a redirect response to the job resource.
      Throws:
      UWSException - if the execution duration cannot be set.
    • deleteJob

      @DELETE @Path("/{jobid}") public jakarta.ws.rs.core.Response deleteJob(@PathParam("jobid") String jobid) throws UWSException
      Description copied from interface: UWSControl
      Delete a job.
      Specified by:
      deleteJob in interface UWSControl
      Parameters:
      jobid - the identifier of the job to delete.
      Returns:
      a redirect response after deletion.
      Throws:
      UWSException - if the job cannot be deleted.