org.objectweb.telosys.rpl
Class GenericResponse

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.rpl.GenericResponse
Direct Known Subclasses:
ScreenResponse, ServiceResponse

public abstract class GenericResponse
extends TelosysObject

The abstract/generic response class used as super class for "Screen Service Response" and "Screen Action Response"

Since:
1.0.5

Field Summary
static int ERRORS
           
static int EXCEPTIONS
           
static int MESSAGES
           
static int REDIRECTION
           
static int RETURN
           
static int VALUES
           
 
Constructor Summary
GenericResponse(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
          Constructs a new ServiceResponse object
 
Method Summary
 void addError(ScreenError error)
          Adds an error in the list
 void addException(java.lang.Throwable th)
          Add an exception to the exceptions list
 void addMessage(ScreenMessage message)
          Adds a message in the list
 void expose(java.lang.String sName, java.lang.Object obj)
          Exposes an object in the standard request scope for future use in a view
( the object is stored as an attribute in the HttpServletRequest )
 void forceRedirect(GenericURI uri)
          Force the client-side (the browser) to redirect to the given generic URI
( replace the current screen by the given object URL )
 void forceRedirect(java.lang.String sURL)
          Force the client-side (the browser) to redirect to the given URL
( replace the current screen by the given URL )
 ScreenError getError(int index)
          Returns the error associated with the given index
 java.lang.Throwable getException(int index)
          Returns the exception associated with the given id
 javax.servlet.http.HttpServletRequest getHttpRequest()
          Returns the "HttpServletRequest" object
 javax.servlet.http.HttpServletResponse getHttpResponse()
          Returns the "HttpServletResponse" object
 ScreenMessage getMessage(int index)
          Returns the message associated with the given index
 int getNumberOfErrors()
          Returns the number of errors
 int getNumberOfExceptions()
          Returns the number of exception(s)
 int getNumberOfMessages()
          Returns the number of messages
 int getNumberOfValues()
          Returns the number of values stored in the response
 java.lang.String getRedirection()
          Returns the redirection URL set by 'forceRedirect' or null if none
 int getReturnCode()
          Returns the "return code"
 java.lang.String getReturnMessage()
          Returns the main "return message"
 java.lang.String getValue(java.lang.String sName)
          Returns the response value associated with the given name
 java.util.Enumeration getValueNames()
          Returns the values names
 void setReturnCode(int iCode)
          Set the "return code"
 void setReturnMessage(java.lang.String sMsg)
          Set the main "return message"
 void setValue(java.lang.String sName, boolean bValue)
          Set a 'boolean' value in the response
 void setValue(java.lang.String sName, byte byValue)
          Set a 'byte' value in the response
 void setValue(java.lang.String sName, double dValue)
          Set a 'double' value in the response
 void setValue(java.lang.String sName, float fValue)
          Set a 'float' value in the response
 void setValue(java.lang.String sName, int iValue)
          Set an 'int' value in the response
 void setValue(java.lang.String sName, long lValue)
          Set a 'long' value in the response
 void setValue(java.lang.String sName, short shValue)
          Set a 'short' value in the response
 void setValue(java.lang.String sName, java.lang.String sValue)
          Set a 'String' value in the response (do nothing if the name or the value is null)
 java.lang.String toString(int iFlag)
          Specific "toString" method designed to return then string part wanted
 
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, toString, wait, wait, wait
 

Field Detail

RETURN

public static final int RETURN
See Also:
Constant Field Values

REDIRECTION

public static final int REDIRECTION
See Also:
Constant Field Values

ERRORS

public static final int ERRORS
See Also:
Constant Field Values

EXCEPTIONS

public static final int EXCEPTIONS
See Also:
Constant Field Values

MESSAGES

public static final int MESSAGES
See Also:
Constant Field Values

VALUES

public static final int VALUES
See Also:
Constant Field Values
Constructor Detail

GenericResponse

public GenericResponse(javax.servlet.http.HttpServletRequest httpRequest,
                       javax.servlet.http.HttpServletResponse httpResponse)
Constructs a new ServiceResponse object

Parameters:
httpRequest -
httpResponse -
Method Detail

getHttpRequest

public javax.servlet.http.HttpServletRequest getHttpRequest()
Returns the "HttpServletRequest" object

Returns:

getHttpResponse

public javax.servlet.http.HttpServletResponse getHttpResponse()
Returns the "HttpServletResponse" object

Returns:
Since:
1.0.5

setReturnCode

public void setReturnCode(int iCode)
Set the "return code"

Parameters:
iCode -

getReturnCode

public int getReturnCode()
Returns the "return code"

Returns:

setReturnMessage

public void setReturnMessage(java.lang.String sMsg)
Set the main "return message"

Parameters:
sMsg -

getReturnMessage

public java.lang.String getReturnMessage()
Returns the main "return message"

Returns:

addMessage

public void addMessage(ScreenMessage message)
Adds a message in the list

Parameters:
message -

getNumberOfMessages

public int getNumberOfMessages()
Returns the number of messages

Returns:

getMessage

public ScreenMessage getMessage(int index)
Returns the message associated with the given index

Parameters:
index -
Returns:

addError

public void addError(ScreenError error)
Adds an error in the list

Parameters:
error -

getNumberOfErrors

public int getNumberOfErrors()
Returns the number of errors

Returns:

getError

public ScreenError getError(int index)
Returns the error associated with the given index

Parameters:
index -
Returns:

addException

public void addException(java.lang.Throwable th)
Add an exception to the exceptions list

Parameters:
th -

getNumberOfExceptions

public int getNumberOfExceptions()
Returns the number of exception(s)

Returns:

getException

public java.lang.Throwable getException(int index)
Returns the exception associated with the given id

Parameters:
index -
Returns:

setValue

public void setValue(java.lang.String sName,
                     java.lang.String sValue)
Set a 'String' value in the response (do nothing if the name or the value is null)

Parameters:
sName -
sValue -

setValue

public void setValue(java.lang.String sName,
                     int iValue)
Set an 'int' value in the response

Parameters:
sName -
iValue -

setValue

public void setValue(java.lang.String sName,
                     long lValue)
Set a 'long' value in the response

Parameters:
sName -
lValue -

setValue

public void setValue(java.lang.String sName,
                     short shValue)
Set a 'short' value in the response

Parameters:
sName -
shValue -

setValue

public void setValue(java.lang.String sName,
                     byte byValue)
Set a 'byte' value in the response

Parameters:
sName -
byValue -

setValue

public void setValue(java.lang.String sName,
                     float fValue)
Set a 'float' value in the response

Parameters:
sName -
fValue -

setValue

public void setValue(java.lang.String sName,
                     double dValue)
Set a 'double' value in the response

Parameters:
sName -
dValue -

setValue

public void setValue(java.lang.String sName,
                     boolean bValue)
Set a 'boolean' value in the response

Parameters:
sName -
bValue -

getValue

public java.lang.String getValue(java.lang.String sName)
Returns the response value associated with the given name

Parameters:
sName -
Returns:

getNumberOfValues

public int getNumberOfValues()
Returns the number of values stored in the response

Returns:

getValueNames

public java.util.Enumeration getValueNames()
Returns the values names

Returns:

expose

public void expose(java.lang.String sName,
                   java.lang.Object obj)
Exposes an object in the standard request scope for future use in a view
( the object is stored as an attribute in the HttpServletRequest )

Parameters:
sName -
obj -

forceRedirect

public void forceRedirect(java.lang.String sURL)
Force the client-side (the browser) to redirect to the given URL
( replace the current screen by the given URL )

Parameters:
sURL -

forceRedirect

public void forceRedirect(GenericURI uri)
Force the client-side (the browser) to redirect to the given generic URI
( replace the current screen by the given object URL )

Parameters:
uri -

getRedirection

public java.lang.String getRedirection()
Returns the redirection URL set by 'forceRedirect' or null if none

Returns:

toString

public java.lang.String toString(int iFlag)
Specific "toString" method designed to return then string part wanted

Parameters:
iFlag -
Returns: