net.sf.xbus.protocol.simple
Class SimpleTextMessage

java.lang.Object
  extended by net.sf.xbus.protocol.Message
      extended by net.sf.xbus.protocol.simple.SimpleTextMessage
All Implemented Interfaces:
ObjectMessage, TextMessage

public class SimpleTextMessage
extends Message
implements TextMessage, ObjectMessage

SimpleTextMessage is the most simple implementation of TextMessage.


Constructor Summary
SimpleTextMessage(java.lang.String function, XBUSSystem source, java.lang.String id)
          This constructor initializes the new SimpleTextMessage with the given parameters.
SimpleTextMessage(XBUSSystem source)
          Creates the SimpleTextMessage with the given source.
 
Method Summary
 java.lang.Object getRequestObject(XBUSSystem system)
          Gets the object from an incomimg message.
 java.lang.String getRequestText(XBUSSystem system)
          Gets the text from an incomimg message.
 java.lang.Object getResponseObject()
          Gets the object of the outgoing message.
 java.lang.String getResponseText()
          Gets the text of the outgoing message.
 void setRequestObject(java.lang.Object text, XBUSSystem source)
          Sets the object from an incomimg message.
 void setRequestText(java.lang.String text, XBUSSystem source)
          Sets the text of the incoming message.
 void setResponseObject(java.lang.Object text, XBUSSystem destination)
          Sets the object of the outgoing message.
 void setResponseText(java.lang.String text, XBUSSystem destination)
          Sets the text of the outgoing message.
 
Methods inherited from class net.sf.xbus.protocol.Message
getErrorcode, getErrortext, getFunction, getId, getRequestTimestamp, getResponseTimestamp, getReturncode, getShortname, getSource, setErrorcode, setErrortext, setFunction, setId, setResponseTimestamp, setReturncode, setShortname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTextMessage

public SimpleTextMessage(XBUSSystem source)
Creates the SimpleTextMessage with the given source.


SimpleTextMessage

public SimpleTextMessage(java.lang.String function,
                         XBUSSystem source,
                         java.lang.String id)
This constructor initializes the new SimpleTextMessage with the given parameters. It is used when constructing a new SimpleTextMessage by converting it from another Message.

Method Detail

setRequestText

public void setRequestText(java.lang.String text,
                           XBUSSystem source)
Description copied from interface: TextMessage
Sets the text of the incoming message.

Specified by:
setRequestText in interface TextMessage
Parameters:
text - the content of the request
source - system where the request is coming from

setResponseText

public void setResponseText(java.lang.String text,
                            XBUSSystem destination)
Description copied from interface: TextMessage
Sets the text of the outgoing message.

Specified by:
setResponseText in interface TextMessage
Parameters:
text - the content of the response
destination - system where the response is coming from

getRequestText

public java.lang.String getRequestText(XBUSSystem system)
Description copied from interface: TextMessage
Gets the text from an incomimg message.

Specified by:
getRequestText in interface TextMessage
Parameters:
system - reference to the system for which the message is meant
Returns:
the content of the request

getResponseText

public java.lang.String getResponseText()
Description copied from interface: TextMessage
Gets the text of the outgoing message.

Specified by:
getResponseText in interface TextMessage
Returns:
the content of the response

setRequestObject

public void setRequestObject(java.lang.Object text,
                             XBUSSystem source)
Description copied from interface: ObjectMessage
Sets the object from an incomimg message.

Specified by:
setRequestObject in interface ObjectMessage
Parameters:
text - the content of the request
source - system where the request is coming from

setResponseObject

public void setResponseObject(java.lang.Object text,
                              XBUSSystem destination)
Description copied from interface: ObjectMessage
Sets the object of the outgoing message.

Specified by:
setResponseObject in interface ObjectMessage
Parameters:
text - the content of the response
destination - system where the response is coming from

getRequestObject

public java.lang.Object getRequestObject(XBUSSystem system)
Description copied from interface: ObjectMessage
Gets the object from an incomimg message.

Specified by:
getRequestObject in interface ObjectMessage
Parameters:
system - reference to the system for which the message is meant
Returns:
the content of the request

getResponseObject

public java.lang.Object getResponseObject()
Description copied from interface: ObjectMessage
Gets the object of the outgoing message.

Specified by:
getResponseObject in interface ObjectMessage
Returns:
the content of the response