Package org.javastro.ivoacore.uws.webapi
Class BaseUWSResource
java.lang.Object
org.javastro.ivoacore.uws.webapi.BaseUWSResource
- All Implemented Interfaces:
UWSControl,UWSCore,UWS
Base JAX-RS resource implementation of the
UWS interface, providing default
HTTP endpoint implementations delegating to a JobManager.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseDelete a job.getJobErrorDetail(String jobid) Get the error detail message for a job.protected abstract JobManagerget the JobManager.org.javastro.ivoa.entities.uws.ResultsgetResults(String jobid) Get the result list for a job.org.javastro.ivoa.entities.uws.JobGet the summary of the current status of a job.org.javastro.ivoa.entities.uws.JobslistJobs(String phase, ZonedDateTime after, Integer last) List of jobs known to the UWS system.protected abstract jakarta.ws.rs.core.ResponseredirectToJob(String jobid) return the correct job redirection.jakarta.ws.rs.core.ResponsesetDestruction(String jobId, ZonedDateTime destructionTime) set the destruction time for a job.jakarta.ws.rs.core.ResponsesetExecutionDuration(String jobId, Long executionDuration) Set the maximum execution duration for a job.jakarta.ws.rs.core.ResponseSets the execution phase of a job (e.g., to "RUN" or "ABORT") and redirects to the job resource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.javastro.ivoacore.uws.webapi.UWS
getExecutionDuration, getJobDestruction, getJobOwner, getJobParameters, getJobQuote, getPhase
-
Constructor Details
-
BaseUWSResource
public BaseUWSResource()
-
-
Method Details
-
getJobManager
get the JobManager.- Returns:
- the JobManager.
-
redirectToJob
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:UWSCoreList of jobs known to the UWS system.- Specified by:
listJobsin interfaceUWSCore- Parameters:
phase- filter jobs by execution phase; may benullfor no filtering.after- filter jobs created after this time; may benullfor no filtering.last- return only the last N jobs; may benullfor 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:UWSCoreGet the summary of the current status of a job.- Specified by:
jobDetailin interfaceUWSCore- Parameters:
jobid- the identifier of the job to retrieve.- Returns:
- the UWS
Jobrepresenting 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:UWSGet the result list for a job. This will not return until the results have been created.- Specified by:
getResultsin interfaceUWS- Parameters:
jobid- the identifier of the job.- Returns:
- the
Resultsof 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
nullif 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:UWSControlset 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:
setDestructionin interfaceUWSControl- 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:UWSControlSet the maximum execution duration for a job.- Specified by:
setExecutionDurationin interfaceUWSControl- 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:UWSControlDelete a job.- Specified by:
deleteJobin interfaceUWSControl- Parameters:
jobid- the identifier of the job to delete.- Returns:
- a redirect response after deletion.
- Throws:
UWSException- if the job cannot be deleted.
-