org.objectweb.telosys.service
Class ServiceResponse

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

public class ServiceResponse
extends TelosysObject

The response of a ScreenService


Constructor Summary
ServiceResponse(java.lang.String sServiceName, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, ScreenSession screenSession)
          Constructs a new ServiceResponse object
 
Method Summary
 void addError(ScreenError error)
          Adds an error in the list
 void addException(java.lang.Exception ex)
          Add an 'Exception' to the exceptions list
 void addException(java.lang.Throwable th)
          Add a 'Throwable' 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.Exception getException(int index)
          Returns the exception associated with the given id
 javax.servlet.http.HttpServletRequest getHttpRequest()
          Returns the "HttpServletRequest" 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
 java.lang.Object getResult()
          Returns the service result object
 int getReturnCode()
          Returns the "return code"
 java.lang.String getReturnMessage()
          Returns the main "return message"
 ScreenSession getScreenSession()
          Returns the "ScreenSession" object
 java.lang.String getServiceName()
          Returns the "service name"
 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 setResult(java.lang.Object v)
          Set the service result object
 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
 void setValue(java.lang.String sName, byte byValue)
          Set a 'byte' value
 void setValue(java.lang.String sName, double dValue)
          Set a 'double' value
 void setValue(java.lang.String sName, float fValue)
          Set a 'float' value
 void setValue(java.lang.String sName, int iValue)
          Set an 'int' value
 void setValue(java.lang.String sName, long lValue)
          Set a 'long' value
 void setValue(java.lang.String sName, short shValue)
          Set a 'short' value
 void setValue(java.lang.String sName, java.lang.String sValue)
          Set an 'String' value
 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

ServiceResponse

public ServiceResponse(java.lang.String sServiceName,
                       javax.servlet.http.HttpServletRequest httpRequest,
                       javax.servlet.http.HttpServletResponse httpResponse,
                       ScreenSession screenSession)
Constructs a new ServiceResponse object

Parameters:
sServiceName -
httpRequest -
httpResponse -
screenSession -
Method Detail

getServiceName

public java.lang.String getServiceName()
Returns the "service name"

Returns:

getHttpRequest

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

Returns:

getScreenSession

public ScreenSession getScreenSession()
Returns the "ScreenSession" object

Returns:

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.Exception ex)
Add an 'Exception' to the exceptions list

Parameters:
ex -

addException

public void addException(java.lang.Throwable th)
Add a 'Throwable' to the exceptions list

Parameters:
th -

getNumberOfExceptions

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

Returns:

getException

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

Parameters:
index -
Returns:

getResult

public java.lang.Object getResult()
Returns the service result object

Returns:

setResult

public void setResult(java.lang.Object v)
Set the service result object

Parameters:
v -

setValue

public void setValue(java.lang.String sName,
                     java.lang.String sValue)
Set an 'String' value

Parameters:
sName -
sValue -

setValue

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

Parameters:
sName -
iValue -

setValue

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

Parameters:
sName -
lValue -

setValue

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

Parameters:
sName -
shValue -

setValue

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

Parameters:
sName -
byValue -

setValue

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

Parameters:
sName -
fValue -

setValue

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

Parameters:
sName -
dValue -

setValue

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

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()