se.lu.thep.waf
Class Event<IDTemplate>

java.lang.Object
  extended by se.lu.thep.waf.Event<IDTemplate>

public class Event<IDTemplate>
extends java.lang.Object

Events are created by the ActionServlet for each request. Each event passes through a set of states, see the figure, before sending back a response to the client.

Event state figure

Author:
gregory

Nested Class Summary
static class Event.State
          Defines the states of an event
 
Field Summary
static java.lang.String ACTION_PARAMETER
           
static org.apache.log4j.Logger log
           
 
Constructor Summary
Event(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionServlet servlet, ActionFactoryInterface actionFactory)
           
 
Method Summary
 boolean done()
           
 java.lang.String fetchTempDirPath()
          Obtains path to directory for temporary files from initparameters.
 AbstractAction getLastAction()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 Event.State getState()
           
 void go()
          Handle the next state
 boolean isMultipart()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log

ACTION_PARAMETER

public static final java.lang.String ACTION_PARAMETER
See Also:
Constant Field Values
Constructor Detail

Event

public Event(javax.servlet.http.HttpServletRequest request,
             javax.servlet.http.HttpServletResponse response,
             ActionServlet servlet,
             ActionFactoryInterface actionFactory)
Method Detail

go

public void go()
        throws EventException,
               javax.servlet.ServletException,
               java.io.IOException
Handle the next state

Throws:
EventException - if an action cannot be identified or something goes bad when running an action
javax.servlet.ServletException - if sending a response to the client fails
java.io.IOException - if sending a response to the client fails

getLastAction

public AbstractAction getLastAction()
Returns:
the last action in the queue

done

public boolean done()

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getResponse

public javax.servlet.http.HttpServletResponse getResponse()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isMultipart

public boolean isMultipart()
Returns:
true if this request is in the state Identified and is a multipart request otherwize false

getState

public Event.State getState()

fetchTempDirPath

public java.lang.String fetchTempDirPath()
Obtains path to directory for temporary files from initparameters.

Returns:
String Path to directory for temporary files.