com.bankframe.fe.statemachine.ext.connectors.servlet
Class Request

java.lang.Object
  |
  +--com.bankframe.fe.statemachine.ext.connectors.servlet.Request
All Implemented Interfaces:
IRequest, IRequest

public class Request
extends java.lang.Object
implements IRequest


Field Summary
static java.lang.String APPLICATION_PARAM_NAME
          This is the name of the request parameter that should contain the name of the application being run.
static java.lang.String EVENT_PARAM_NAME
          The is the name of the request parameter that should contain the name of the event to be processed.
static java.lang.String FILENAME_EXTENSION
          This is the name of the filename extension that can be used to indicate that the application, state and event names can be taken from the URL path instead of from request parameters.
static java.lang.String STATE_PARAM_NAME
          This is the name of the request parameter that should contain the name of the state from which the current event is being fired.
 
Constructor Summary
Request(javax.servlet.http.HttpServletRequest request)
          Creates a new Request.
 
Method Summary
 java.lang.String getApplicationName()
          Returns the name of the application which should handle this request.
 java.lang.Object getAttribute(java.lang.String name)
           
 java.util.Enumeration getAttributeNames()
           
 java.lang.String getEventName()
          Returns the name of the event which needs to be handled for this request.
 java.lang.String getParameter(java.lang.String name)
           
 java.util.Enumeration getParameterNames()
          Returns the names of the parameters contained in this request.
 java.lang.String[] getParameterValues(java.lang.String parameterName)
          Returns the values for the parameter of the given name.
 javax.servlet.http.HttpServletRequest getRequest()
           
 java.lang.String getSessionId()
          Returns the id of the UserSession for this request.
 java.lang.String getStateId()
          Returns the id of the state from which this request comes.
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_PARAM_NAME

public static final java.lang.String APPLICATION_PARAM_NAME
This is the name of the request parameter that should contain the name of the application being run. The value of APPLICATION_PARAM_NAME is 'statemachineAppName'

See Also:
Constant Field Values

STATE_PARAM_NAME

public static final java.lang.String STATE_PARAM_NAME
This is the name of the request parameter that should contain the name of the state from which the current event is being fired. The value of STATE_PARAM_NAME is 'statemachineStateName'

See Also:
Constant Field Values

EVENT_PARAM_NAME

public static final java.lang.String EVENT_PARAM_NAME
The is the name of the request parameter that should contain the name of the event to be processed. The value of EVENT_PARAM_NAME is 'statemachineEventName'

See Also:
Constant Field Values

FILENAME_EXTENSION

public static final java.lang.String FILENAME_EXTENSION
This is the name of the filename extension that can be used to indicate that the application, state and event names can be taken from the URL path instead of from request parameters.

The value of FILENAME_EXTENSION is '.jsm'

If the URL ends with this string then the request will get the application, state and event names from the path instead of from the request parameters.

The exact interpretation of the path is as follows:


Thus the path /org/jstatemachine/demoapp/DemoAppAutoView.xml/Welcome.Logout.jsm identifies the Logout event called from the Welcome state in the DemoAppAutoView application.
The reason for such a complex structure is that is should allow you have a single directory on the web server for each application, containing all the other resources required by the app. (images and the like). References can be kept as relative to the application directory in all your JSPs.

Another important point: If some of the information is not in the path, then it will be taken from the defaults. Thus the path /org/jstatemachine/demoapp/DemoAppAutoView.xml/.jsm will load the start state in the demoapp.
The path /.jsm will load the start state in the default app.
The path /Welcome.Logout.jsm will look for the event in the default application.
The path /Logout.jsm will look for the event Logout from the last recorded state in the default application (to be used in conjunction with the com.bankframe.fe.statemachine.base.StateIdSource parameter, as described in the javadoc for RequestContext.)

See Also:
Constant Field Values
Constructor Detail

Request

public Request(javax.servlet.http.HttpServletRequest request)
Creates a new Request.

Parameters:
request - the HttpServletRequest to wrap.
Method Detail

getApplicationName

public java.lang.String getApplicationName()
Returns the name of the application which should handle this request. If this returns null the statemachine will use the default application returned by the ApplicationManager.

Specified by:
getApplicationName in interface IRequest
Returns:
the name of the application that should handle this request.

getEventName

public java.lang.String getEventName()
Returns the name of the event which needs to be handled for this request. This should not return null. If no event name is applicable it can return an empty string.

Specified by:
getEventName in interface IRequest
Returns:
the name of the event for this request.

getSessionId

public java.lang.String getSessionId()
Returns the id of the UserSession for this request. If this returns null the statemachine will create a new default session.

Specified by:
getSessionId in interface IRequest
Returns:
the ID of the IUserSession associated with this request.

getStateId

public java.lang.String getStateId()
Returns the id of the state from which this request comes. If this returns null the statemachine will use the root state for the current application.

Specified by:
getStateId in interface IRequest
Returns:
the ID of the state from which this request comes.

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getParameterNames

public java.util.Enumeration getParameterNames()
Description copied from interface: IRequest
Returns the names of the parameters contained in this request.

Specified by:
getParameterNames in interface IRequest
Returns:
the names of the parameters contained in this request.
See Also:
IRequest.getParameterNames()

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String parameterName)
Description copied from interface: IRequest
Returns the values for the parameter of the given name.

Specified by:
getParameterValues in interface IRequest
Parameters:
parameterName - the name of the parameter values to return.
Returns:
the values for the parameter of the given name.
See Also:
IRequest.getParameterValues(String)

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in interface IRequest
See Also:
IRequest.getAttribute(String)

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Specified by:
setAttribute in interface IRequest
See Also:
IRequest.setAttribute(String, Object)

getParameter

public java.lang.String getParameter(java.lang.String name)
Specified by:
getParameter in interface IRequest
See Also:
IRequest.getParameter(String)

getAttributeNames

public java.util.Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface IRequest
See Also:
IRequest.getAttributeNames()


Copyright © 2005 Siebel Systems, Inc. All rights reserved.