org.objectweb.telosys.service
Class ServiceRequest

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.service.ServiceRequest

public class ServiceRequest
extends TelosysObject


Constructor Summary
ServiceRequest(java.lang.String sServiceName, javax.servlet.http.HttpServletRequest httpRequest, ScreenSession screenSession)
           
 
Method Summary
 java.lang.String getFormName()
           
 javax.servlet.http.HttpServletRequest getHttpRequest()
          Returns the standard HTTP servlet request
 javax.servlet.http.HttpSession getHttpSession()
          Returns the standard HTTP session or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way
 java.lang.String getHttpSessionId()
          Returns the ID of the standard HTTP session
or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way
 int getIntParameter(int iParamNum)
          Returns the 'integer' value of the 'nth' parameter
 int getIntParameter(java.lang.String sParamName)
          Returns the 'integer' value for the given parameter name
 long getLongParameter(int iParamNum)
          Returns the 'long' value of the 'nth' parameter
 long getLongParameter(java.lang.String sParamName)
          Returns the 'long' value for the given parameter name
 java.lang.String getParameter(int iParamNum)
          Returns the 'nth' parameter value
 java.lang.String getParameter(java.lang.String sParamName)
          Returns the value for the given parameter name
 int getParameterCount()
          Return the number of parameters
 java.util.Map getParameterMap()
          Returns the standard parameters map of the HttpServletRequest object
NB : each value of the Map is a String array ( cf HttpServletRequest : getParameterMap() )
 java.lang.String[] getParameterNames()
          Returns all the parameter names
 int getPostBackType()
           
 ScreenApplication getScreenApplication()
          Returns the ScreenApplication object associated with the current web app
or null if the ScreenApplication has not yet been created (opened)
It cannot returns null, unless the ServletContext has been corrupted by an external way
 java.lang.String getScreenId()
           
 java.lang.String getScreenName()
           
 ScreenPostback getScreenPostback()
           
 ScreenSession getScreenSession()
          Returns the current ScreenSession associated with the request
or null if the HttpSession doesn't exist or if it doesn't contain a ScreenSession attribute
It cannot returns null, unless the HttpSession has been corrupted by an external way
 java.lang.String getServiceName()
           
 javax.servlet.ServletContext getServletContext()
          Returns the standard web app ServletContext
or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way
 boolean submitBy(java.lang.String sSubmitElementName)
          Returns true if the submit element name is present in the request parameters
( useful for forms with multiple submit buttons and/or submit images )
An HTML form can submit a request with
a "button" ( input type="submit" name="abc" : parameter "abc" )
an "image" ( input type="image" name="abc" : parameters "abc.x" and "abc.y" )
 java.lang.String toString()
           
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceRequest

public ServiceRequest(java.lang.String sServiceName,
                      javax.servlet.http.HttpServletRequest httpRequest,
                      ScreenSession screenSession)
Method Detail

getServiceName

public java.lang.String getServiceName()

getHttpRequest

public javax.servlet.http.HttpServletRequest getHttpRequest()
Returns the standard HTTP servlet request

Returns:

getHttpSession

public javax.servlet.http.HttpSession getHttpSession()
Returns the standard HTTP session or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way

Returns:

getHttpSessionId

public java.lang.String getHttpSessionId()
Returns the ID of the standard HTTP session
or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way

Returns:

getServletContext

public javax.servlet.ServletContext getServletContext()
Returns the standard web app ServletContext
or null if the Http Session doesn't exist It cannot returns null, unless the HttpSession has been invalidate by an external way

Returns:

getScreenSession

public ScreenSession getScreenSession()
Returns the current ScreenSession associated with the request
or null if the HttpSession doesn't exist or if it doesn't contain a ScreenSession attribute
It cannot returns null, unless the HttpSession has been corrupted by an external way

Returns:

getScreenApplication

public ScreenApplication getScreenApplication()
Returns the ScreenApplication object associated with the current web app
or null if the ScreenApplication has not yet been created (opened)
It cannot returns null, unless the ServletContext has been corrupted by an external way

Returns:

getPostBackType

public int getPostBackType()

getScreenName

public java.lang.String getScreenName()

getScreenId

public java.lang.String getScreenId()

getFormName

public java.lang.String getFormName()

getScreenPostback

public ScreenPostback getScreenPostback()

getParameterMap

public java.util.Map getParameterMap()
Returns the standard parameters map of the HttpServletRequest object
NB : each value of the Map is a String array ( cf HttpServletRequest : getParameterMap() )

Returns:

getParameterCount

public int getParameterCount()
Return the number of parameters

Returns:

getParameterNames

public java.lang.String[] getParameterNames()
Returns all the parameter names

Returns:
: Names (never null : size = 0 if no parameters )

getParameter

public java.lang.String getParameter(java.lang.String sParamName)
Returns the value for the given parameter name

Parameters:
sParamName - : parameter name
Returns:
: parameter value (or null if not found)

getIntParameter

public int getIntParameter(java.lang.String sParamName)
                    throws TelosysException
Returns the 'integer' value for the given parameter name

Parameters:
sParamName - : parameter name
Returns:
: parameter value
Throws:
TelosysException - if parameter not found or invalid ( not 'integer' )

getLongParameter

public long getLongParameter(java.lang.String sParamName)
                      throws TelosysException
Returns the 'long' value for the given parameter name

Parameters:
sParamName - : parameter name
Returns:
: parameter value
Throws:
TelosysException - if parameter not found or invalid ( not 'long' )

getParameter

public java.lang.String getParameter(int iParamNum)
Returns the 'nth' parameter value

Parameters:
iParamNum - : parameter index ( 1 for "p1", 2 for "p2", ... )
Returns:
: parameter value (or null if not found)

getIntParameter

public int getIntParameter(int iParamNum)
                    throws TelosysException
Returns the 'integer' value of the 'nth' parameter

Parameters:
iParamNum - : parameter index ( 1 for "p1", 2 for "p2", ... )
Returns:
: parameter value
Throws:
TelosysException - if parameter not found or invalid ( not integer )

getLongParameter

public long getLongParameter(int iParamNum)
                      throws TelosysException
Returns the 'long' value of the 'nth' parameter

Parameters:
iParamNum - : parameter index ( 1 for "p1", 2 for "p2", ... )
Returns:
: parameter value
Throws:
TelosysException - if parameter not found or invalid ( not long )

submitBy

public boolean submitBy(java.lang.String sSubmitElementName)
Returns true if the submit element name is present in the request parameters
( useful for forms with multiple submit buttons and/or submit images )
An HTML form can submit a request with
a "button" ( input type="submit" name="abc" : parameter "abc" )
an "image" ( input type="image" name="abc" : parameters "abc.x" and "abc.y" )

Parameters:
sSubmitElementName -
Returns:

toString

public java.lang.String toString()