|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uws.service.actions.UWSAction<JL,J>
public abstract class UWSAction<JL extends JobList<J>,J extends AbstractJob>
Action of a UWS (i.e. "List Jobs", "Get Job", etc...). An instance of a UWSAction can be added to a given UWS thanks to the method
AbstractUWS.addUWSAction(UWSAction)
.
WARNING: The action of a UWS have, each one, a different name. So be careful about the name of your UWS action ! By default the name of a UWS action is the full java name of the class !
AbstractUWS
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
ADD_JOB
Name of the UWS action AddJob . |
static java.lang.String |
DESTROY_JOB
Name of the UWS action DestroyJob . |
static java.lang.String |
GET_JOB_PARAM
Name of the UWS action GetJobParam . |
static java.lang.String |
HOME_PAGE
Name of the UWS action ShowHomePage . |
static java.lang.String |
JOB_SUMMARY
Name of the UWS action JobSummary . |
static java.lang.String |
LIST_JOBS
Name of the UWS action ListJobs . |
static java.lang.String |
SET_JOB_PARAM
Name of the UWS action SetJobParam . |
protected AbstractUWS<JL,J> |
uws
The UWS on which this action must be applied. |
Constructor Summary | |
---|---|
protected |
UWSAction(AbstractUWS<JL,J> u)
Builds a UWSAction. |
Method Summary | |
---|---|
abstract boolean |
apply(UWSUrl urlInterpreter,
java.lang.String userId,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Applies this UWS action in function of the given request and writes the result in the given response. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getDescription()
Gets the description of this UWS action. |
protected J |
getJob(UWSUrl urlInterpreter)
Extracts the job ID from the given UWS URL and gets the corresponding job from the UWS. |
protected J |
getJob(UWSUrl urlInterpreter,
JL jobsList)
Extracts the job ID from the given UWS URL and gets the corresponding job from the given jobs list. |
protected JL |
getJobsList(UWSUrl urlInterpreter)
Extracts the name of the jobs list from the given UWS URL and gets the jobs list from the UWS. |
java.lang.String |
getName()
Gets the name of this UWS action. |
AbstractUWS<JL,J> |
getUWS()
Gets the UWS which contains this action. |
abstract boolean |
match(UWSUrl urlInterpreter,
java.lang.String userId,
javax.servlet.http.HttpServletRequest request)
Indicates whether the given request corresponds to this UWS action. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LIST_JOBS
ListJobs
.
public static final java.lang.String ADD_JOB
AddJob
.
public static final java.lang.String DESTROY_JOB
DestroyJob
.
public static final java.lang.String JOB_SUMMARY
JobSummary
.
public static final java.lang.String GET_JOB_PARAM
GetJobParam
.
public static final java.lang.String SET_JOB_PARAM
SetJobParam
.
public static final java.lang.String HOME_PAGE
ShowHomePage
.
protected final AbstractUWS<JL extends JobList<J>,J extends AbstractJob> uws
Constructor Detail |
---|
protected UWSAction(AbstractUWS<JL,J> u)
u
- The UWS which contains this action.Method Detail |
---|
public final AbstractUWS<JL,J> getUWS()
public java.lang.String getName()
Gets the name of this UWS action. MUST BE UNIQUE !
Note: By default the name of the class is returned (Class.getName()
).
public java.lang.String getDescription()
Gets the description of this UWS action.
Note: By default an empty string is returned.
protected final JL getJobsList(UWSUrl urlInterpreter) throws UWSException
urlInterpreter
- The UWS URL which contains the name of the jobs list to get.
UWSException
- If there is no jobs list name in the given UWS URL
or if no corresponding jobs list can be found in the UWS.UWSUrl.getJobListName()
,
AbstractUWS.getJobList(String)
protected final J getJob(UWSUrl urlInterpreter) throws UWSException
urlInterpreter
- The UWS URL which contains the ID of the job to get.
UWSException
- If no jobs list name or/and job ID can be found in the given UWS URL
or if there are no corresponding jobs list and/or job in the UWS.UWSUrl.getJobId()
,
getJobsList(UWSUrl)
,
JobList.getJob(String)
protected final J getJob(UWSUrl urlInterpreter, JL jobsList) throws UWSException
urlInterpreter
- The UWS URL which contains the ID of the job to get.jobsList
- The jobs list which is supposed to contain the job to get.
UWSException
- If no job ID can be found in the given UWS URL
or if there are no corresponding job in the UWS.UWSUrl.getJobId()
,
JobList.getJob(String)
public abstract boolean match(UWSUrl urlInterpreter, java.lang.String userId, javax.servlet.http.HttpServletRequest request) throws UWSException
urlInterpreter
- The UWS URL of the given request.userId
- The user who has sent the given request.request
- The received request.
UWSException
- If any error occurs during the tests.public abstract boolean apply(UWSUrl urlInterpreter, java.lang.String userId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws UWSException, java.io.IOException
Applies this UWS action in function of the given request and writes the result in the given response.
Note: You can use the functions getJobsList(UWSUrl)
, getJob(UWSUrl)
and getJob(UWSUrl, JobList)
to
get more easily the jobs list and/or the job from the given UWS URL !
urlInterpreter
- The UWS URL of the given request.userId
- 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.public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |