public class JobSummary extends UWSAction
Note:
The corresponding name is UWSAction.JOB_SUMMARY
.
This action returns the summary of the job specified in the given UWS URL.
This summary is serialized by the UWSSerializer
chosen in function
of the HTTP Accept header.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
WAIT_PARAMETER
Name of the parameter which allows the blocking behavior
(for a specified or unlimited duration) of a
JobSummary request. |
ADD_JOB, DESTROY_JOB, GET_JOB_PARAM, HOME_PAGE, JOB_SUMMARY, LIST_JOBS, SET_JOB_PARAM, SET_UWS_PARAMETER, uws
Constructor and Description |
---|
JobSummary(UWSService u) |
Modifier and Type | Method and Description |
---|---|
boolean |
apply(UWSUrl urlInterpreter,
JobOwner user,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Gets the specified job (and throw an error if not found),
chooses the serializer and write the serialization of the job in the
given response.
|
static void |
block(BlockingPolicy policy,
javax.servlet.http.HttpServletRequest req,
UWSJob job,
JobOwner user)
Block the current thread until the specified duration (in seconds) is
elapsed or if the execution phase of the target job changes.
|
java.lang.String |
getDescription()
Gets the description of this UWS action.
|
java.lang.String |
getName()
Gets the name of this UWS action.
|
boolean |
match(UWSUrl urlInterpreter,
JobOwner user,
javax.servlet.http.HttpServletRequest request)
Checks whether:
a job list name is specified in the given UWS URL
(note: the existence of the jobs list is not checked),
a job ID is given in the UWS URL
(note: the existence of the job is not checked),
there is no job attribute,
the HTTP method is HTTP-GET.
|
public static final java.lang.String WAIT_PARAMETER
JobSummary
request.public JobSummary(UWSService u)
public java.lang.String getName()
UWSAction
Gets the name of this UWS action. MUST BE UNIQUE !
Note: By default the name of the class is returned (Class.getName()
).
getName
in class UWSAction
UWSAction.JOB_SUMMARY
,
UWSAction.getName()
public java.lang.String getDescription()
UWSAction
Gets the description of this UWS action.
Note: By default an empty string is returned.
getDescription
in class UWSAction
public boolean match(UWSUrl urlInterpreter, JobOwner user, javax.servlet.http.HttpServletRequest request) throws UWSException
match
in class UWSAction
urlInterpreter
- The UWS URL of the given request.user
- The user who has sent the given request.request
- The received request.UWSException
- If any error occurs during the tests.UWSAction.match(UWSUrl, JobOwner, HttpServletRequest)
public boolean apply(UWSUrl urlInterpreter, JobOwner user, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws UWSException, java.io.IOException
apply
in class UWSAction
urlInterpreter
- The UWS URL of the given request.user
- The user who has sent the given request.request
- The received request.response
- The response of the given request (MUST BE UPDATED).UWSException
- If any error occurs during the action application.java.io.IOException
- If there is an error while the result is written in the given response.UWSAction.getJob(UWSUrl)
,
UWSService.getSerializer(String)
,
SerializableUWSObject.serialize(ServletOutputStream, UWSSerializer)
,
UWSAction.apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse)
public static void block(BlockingPolicy policy, javax.servlet.http.HttpServletRequest req, UWSJob job, JobOwner user)
A blocking is performed only if the given job is in an active phase (i.e. PENDING, QUEUED or EXECUTING).
This function expects the 2 following HTTP-GET parameters:
Note: A waiting time of 0 will be interpreted as "no blocking".
Note: This function will have no effect if the given thread, the given HTTP request or the given job is NULL.
policy
- Strategy to adopt for the blocking behavior.
If NULL, the standard blocking behavior will be
performed: block the duration (eventually unlimited)
specified by the user.req
- The HTTP request which asked for the blocking.
MUST NOT be NULL, otherwise no blocking will be
performed.job
- The job associate with the HTTP request.
MUST NOT be NULL, otherwise no blocking will be
performed.user
- The user who asked for the blocking behavior.
NULL if no user is logged in.