java.lang.Objectorg.objectweb.telosys.common.TelosysObject
org.objectweb.telosys.common.RequestParameters
org.objectweb.telosys.service.ServiceRequest
Request object for Telosys RPC and Navigation Services
An instance of this class is created for each request,
it is populated with the http request informations
Constructor Summary | |
ServiceRequest(java.lang.String sServiceName,
javax.servlet.http.HttpServletRequest httpRequest,
ScreenSession screenSession)
Constructor |
Method Summary | |
java.lang.String |
getFormName()
Returns the form name (useful only for postback management) |
javax.servlet.http.HttpServletRequest |
getHttpRequest()
Returns the standard HTTP servlet request NB : The original HttpServletRequest is returned "as is", so it contains the original parameters map with their original encoding If the request is submitted with a GET http method, the parameters values are not converted in UTF-8 |
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)
Deprecated. use getParamAsInt |
int |
getIntParameter(java.lang.String sParamName)
Deprecated. use getParamAsInt |
long |
getLongParameter(int iParamNum)
Deprecated. use getParamAsLong |
long |
getLongParameter(java.lang.String sParamName)
Deprecated. use getParamAsLong |
boolean |
getParamAsBoolean(int paramNum)
Returns the 'boolean' value of the 'nth' parameter |
boolean |
getParamAsBoolean(int paramNum,
boolean defaultValue)
Returns the 'boolean' value of the 'nth' parameter |
byte |
getParamAsByte(int paramNum)
Returns the 'byte' value of the 'nth' parameter |
byte |
getParamAsByte(int paramNum,
byte defaultValue)
Returns the 'byte' value of the 'nth' parameter |
char |
getParamAsChar(int paramNum)
Returns the 'char' value of the 'nth' parameter |
char |
getParamAsChar(int paramNum,
char defaultValue)
Returns the 'char' value of the 'nth' parameter |
java.util.Date |
getParamAsDate(int paramNum)
Returns the 'date' value of the 'nth' parameter The parameter value must be in ISO format : "YYYY-MM-DD" or "HH:MM:SS" or "YYYY-MM-DD HH:MM:SS" |
java.util.Date |
getParamAsDate(int paramNum,
java.util.Date defaultValue)
Returns the 'date' value of the 'nth' parameter The parameter value must be in ISO format : "YYYY-MM-DD" or "HH:MM:SS" or "YYYY-MM-DD HH:MM:SS" |
double |
getParamAsDouble(int paramNum)
Returns the 'double' value of the 'nth' parameter |
double |
getParamAsDouble(int paramNum,
double defaultValue)
Returns the 'double' value of the 'nth' parameter |
float |
getParamAsFloat(int paramNum)
Returns the 'float' value of the 'nth' parameter |
float |
getParamAsFloat(int paramNum,
float defaultValue)
Returns the 'float' value of the 'nth' parameter |
int |
getParamAsInt(int paramNum)
Returns the 'int' value of the 'nth' parameter |
int |
getParamAsInt(int paramNum,
int defaultValue)
Returns the 'int' value of the 'nth' parameter |
long |
getParamAsLong(int paramNum)
Returns the 'long' value of the 'nth' parameter |
long |
getParamAsLong(int paramNum,
long defaultValue)
Returns the 'long' value of the 'nth' parameter |
short |
getParamAsShort(int paramNum)
Returns the 'short' value of the 'nth' parameter |
short |
getParamAsShort(int paramNum,
short defaultValue)
Returns the 'short' value of the 'nth' parameter |
java.lang.String |
getParameter(int iParamNum)
Returns the 'nth' parameter value |
java.lang.String |
getParameter(int iParamNum,
java.lang.String defaultValue)
Returns the 'nth' parameter value |
java.lang.String |
getParameter(java.lang.String paramName)
Returns the value of the given parameter name, or NULL if not found |
java.lang.String |
getParameter(java.lang.String paramName,
java.lang.String defaultValue)
Returns the value of the given parameter name, or the default value if not found |
int |
getParameterCount()
Return the number of parameters |
java.util.Map |
getParameterMap()
Returns the parameters map of the HttpServletRequest object If the request has been submitted with a GET method, the map contains the parameters converted to UTF-8 NB : each value of the Map is a String array ( cf HttpServletRequest : getParameterMap() ) |
java.lang.String[] |
getParameterNames()
Returns all the parameter names |
int |
getPostBackType()
Returns the "postback" type ( POSTBACK_NONE or POSTBACK_REQUEST or POSTBACK_SESSION ) |
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()
Returns the screen id (useful only for postback management) |
java.lang.String |
getScreenName()
Returns the screen name (useful only for postback management) |
ScreenPostback |
getScreenPostback()
Returns the ScreenPostback instance for the current request There's a ScreenPostback instance only if the postback type is POSTBACK_REQUEST |
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()
Returns the name of the service invoked |
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 |
hasParameter()
Returns true if there's at least one parameter in the request |
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.RequestParameters |
getParamAsBoolean, getParamAsBoolean, getParamAsByte, getParamAsByte, getParamAsChar, getParamAsChar, getParamAsDate, getParamAsDate, getParamAsDouble, getParamAsDouble, getParamAsFloat, getParamAsFloat, getParamAsInt, getParamAsInt, getParamAsLong, getParamAsLong, getParamAsShort, getParamAsShort |
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 |
public ServiceRequest(java.lang.String sServiceName, javax.servlet.http.HttpServletRequest httpRequest, ScreenSession screenSession)
sServiceName
- httpRequest
- screenSession
- Method Detail |
public java.lang.String getServiceName()
public javax.servlet.http.HttpServletRequest getHttpRequest()
public javax.servlet.http.HttpSession getHttpSession()
public java.lang.String getHttpSessionId()
public javax.servlet.ServletContext getServletContext()
public ScreenSession getScreenSession()
public ScreenApplication getScreenApplication()
public int getPostBackType()
public java.lang.String getScreenName()
public java.lang.String getScreenId()
public java.lang.String getFormName()
public ScreenPostback getScreenPostback()
public java.util.Map getParameterMap()
public int getParameterCount()
public boolean hasParameter()
IRequestParameters
public java.lang.String[] getParameterNames()
public java.lang.String getParameter(java.lang.String paramName)
IRequestParameters
getParameter
in interface IRequestParameters
getParameter
in class RequestParameters
public java.lang.String getParameter(java.lang.String paramName, java.lang.String defaultValue)
IRequestParameters
getParameter
in interface IRequestParameters
getParameter
in class RequestParameters
public java.lang.String getParameter(int iParamNum)
iParamNum
- : parameter index ( 1 for "p1", 2 for "p2", ... )
public java.lang.String getParameter(int iParamNum, java.lang.String defaultValue)
iParamNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public double getParamAsDouble(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public double getParamAsDouble(int paramNum, double defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public float getParamAsFloat(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public float getParamAsFloat(int paramNum, float defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public int getParamAsInt(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public int getParamAsInt(int paramNum, int defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public long getParamAsLong(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public long getParamAsLong(int paramNum, long defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public short getParamAsShort(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public short getParamAsShort(int paramNum, short defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public byte getParamAsByte(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public byte getParamAsByte(int paramNum, byte defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public char getParamAsChar(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public char getParamAsChar(int paramNum, char defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public boolean getParamAsBoolean(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public boolean getParamAsBoolean(int paramNum, boolean defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public java.util.Date getParamAsDate(int paramNum)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )
public java.util.Date getParamAsDate(int paramNum, java.util.Date defaultValue)
paramNum
- parameter index ( 1 for "p1", 2 for "p2", ... )defaultValue
- default value (returned if the parameter cannot be found)
public int getIntParameter(java.lang.String sParamName) throws TelosysException
sParamName
- : parameter name
TelosysException
- if parameter not found or invalid ( not 'integer' )public long getLongParameter(java.lang.String sParamName) throws TelosysException
sParamName
- : parameter name
TelosysException
- if parameter not found or invalid ( not 'long' )public int getIntParameter(int iParamNum) throws TelosysException
iParamNum
- : parameter index ( 1 for "p1", 2 for "p2", ... )
TelosysException
- if parameter not found or invalid ( not integer )public long getLongParameter(int iParamNum) throws TelosysException
iParamNum
- : parameter index ( 1 for "p1", 2 for "p2", ... )
TelosysException
- if parameter not found or invalid ( not long )public boolean submitBy(java.lang.String sSubmitElementName)
sSubmitElementName
-
public java.lang.String toString()