public class GetJobParam extends UWSAction
The "Get Job Parameter" action of a UWS.
Note: The corresponding name is UWSAction.GET_JOB_PARAM
.
This action returns the value of the specified job attribute. If the attribute is basic (i.e. jobID, startTime, ...) the value is returned with the content type text/plain whereas it is a complex type (i.e. results, parameters, ...) the value is the serialization of the job attribute itself. The serializer is choosen in function of the HTTP Accept header.
ADD_JOB, DESTROY_JOB, GET_JOB_PARAM, HOME_PAGE, JOB_SUMMARY, LIST_JOBS, SET_JOB_PARAM, SET_UWS_PARAMETER, uws
Constructor and Description |
---|
GetJobParam(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 attribute in the given response.
|
java.lang.String |
getDescription()
Gets the description of this UWS action.
|
java.lang.String |
getName()
Gets the name of this UWS action.
|
boolean |
isDefaultUrl(Result result,
UWSJob job)
Tells whether the URL of this Result is the default one.
|
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 a job attribute,
the HTTP method is HTTP-GET.
|
public GetJobParam(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.GET_JOB_PARAM
,
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
Gets the specified job (and throw an error if not found), chooses the serializer and write the serialization of the job attribute in the given response.
Note: if the specified attribute is simple (i.e. jobID, runID, startTime, ...) it will not serialized ! The response will merely be the job attribute value (so, the content type will be: text/plain).
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)
,
JobInfo.write(HttpServletResponse)
,
UWSAction.apply(UWSUrl, JobOwner, HttpServletRequest, HttpServletResponse)
public final boolean isDefaultUrl(Result result, UWSJob job)