uws.service.actions
Class DestroyJob<JL extends JobList<J>,J extends AbstractJob>

java.lang.Object
  extended by uws.service.actions.UWSAction<JL,J>
      extended by uws.service.actions.DestroyJob<JL,J>
All Implemented Interfaces:
java.io.Serializable

public class DestroyJob<JL extends JobList<J>,J extends AbstractJob>
extends UWSAction<JL,J>

The "Destroy Job" action of a UWS.

Note: The corresponding name is UWSAction.DESTROY_JOB.

This action destroys the job specified in the UWS URL. The response of this action is a redirection to the jobs list.

Version:
01/2011
Author:
Grégory Mantelet (CDS)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class uws.service.actions.UWSAction
ADD_JOB, DESTROY_JOB, GET_JOB_PARAM, HOME_PAGE, JOB_SUMMARY, LIST_JOBS, SET_JOB_PARAM, uws
 
Constructor Summary
DestroyJob(AbstractUWS<JL,J> u)
           
 
Method Summary
 boolean apply(UWSUrl urlInterpreter, java.lang.String userId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Gets the specified jobs list (throw an error if not found), gets the specified job (throw an error if not found), destroys the job and makes a redirection to the jobs list.
 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, java.lang.String userId, 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), the HTTP method is HTTP-DELETE...
 
Methods inherited from class uws.service.actions.UWSAction
equals, getJob, getJob, getJobsList, getUWS, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DestroyJob

public DestroyJob(AbstractUWS<JL,J> u)
Method Detail

getName

public java.lang.String getName()
Description copied from class: UWSAction

Gets the name of this UWS action. MUST BE UNIQUE !

Note: By default the name of the class is returned (Class.getName()).

Overrides:
getName in class UWSAction<JL extends JobList<J>,J extends AbstractJob>
Returns:
Its name.
See Also:
UWSAction.DESTROY_JOB, UWSAction.getName()

getDescription

public java.lang.String getDescription()
Description copied from class: UWSAction

Gets the description of this UWS action.

Note: By default an empty string is returned.

Overrides:
getDescription in class UWSAction<JL extends JobList<J>,J extends AbstractJob>
Returns:
Its description.

match

public boolean match(UWSUrl urlInterpreter,
                     java.lang.String userId,
                     javax.servlet.http.HttpServletRequest request)
              throws UWSException
Checks whether:

Specified by:
match in class UWSAction<JL extends JobList<J>,J extends AbstractJob>
Parameters:
urlInterpreter - The UWS URL of the given request.
userId - The user who has sent the given request.
request - The received request.
Returns:
true if the given request corresponds to this UWS action, false otherwise.
Throws:
UWSException - If any error occurs during the tests.
See Also:
UWSAction.match(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest)

apply

public boolean apply(UWSUrl urlInterpreter,
                     java.lang.String userId,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws UWSException,
                     java.io.IOException
Gets the specified jobs list (throw an error if not found), gets the specified job (throw an error if not found), destroys the job and makes a redirection to the jobs list.

Specified by:
apply in class UWSAction<JL extends JobList<J>,J extends AbstractJob>
Parameters:
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).
Returns:
true if the actions has been successfully applied, false otherwise.
Throws:
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.
See Also:
UWSAction.getJobsList(UWSUrl), UWSAction.getJob(UWSUrl, JobList), JobList.destroyJob(String), AbstractUWS.redirect(String, HttpServletRequest, HttpServletResponse), UWSAction.apply(uws.service.UWSUrl, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)