net.sf.xbus.protocol
Class Message

java.lang.Object
  extended by net.sf.xbus.protocol.Message
Direct Known Subclasses:
EmptyMessage, NotifyErrorMessage, SimpleObjectMessage, SimpleTextMessage, XMLMessageAbstract

public class Message
extends java.lang.Object

Message is the base for all classes that handle the data of requests and responses. It contains all methods and attributes which are independent of the application-protocol.


Constructor Summary
Message(java.lang.String function, XBUSSystem source, java.lang.String id)
          This constructor initializes the new Message with the given parameters.
Message(XBUSSystem source)
          This constructor stores the source, creates an unique identifier for the call and initializes the requestTimestamp.
 
Method Summary
 int getErrorcode()
          Gets the errorcode.
 java.lang.String getErrortext()
          Gets the errortext.
 java.lang.String getFunction()
          Gets the name of the function.
 java.lang.String getId()
          Gets the unique id.
 java.util.Date getRequestTimestamp()
          Gets the timestamp when this Message has been received.
 java.util.Date getResponseTimestamp()
          Gets the timestamp when the response has been given to the neighbor-system, which has sent the request.
 java.lang.String getReturncode()
          Gets the returncode.
 java.lang.String getShortname()
          Gets the shortname.
 XBUSSystem getSource()
          Gets the name of the neighbor-system that has send the message.
 void setErrorcode(int errorcode)
          Sets the errorcode.
 void setErrortext(java.lang.String errortext)
          Sets the errortext.
protected  void setFunction(java.lang.String function)
          Sets the name of the function.
protected  void setId(java.lang.String id)
          Sets the unique id.
 void setResponseTimestamp(java.util.Date timestamp)
          Sets the timestamp when the response has been given to the neighbor-system, which has sent the request.
 void setReturncode(java.lang.String rc)
          Sets the returncode.
 void setShortname(java.lang.String shortname)
          Sets the shortname.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message(XBUSSystem source)
This constructor stores the source, creates an unique identifier for the call and initializes the requestTimestamp. It is used when constructing a new Message from the data of a receiver.


Message

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

Method Detail

getId

public java.lang.String getId()
Gets the unique id.


setId

protected void setId(java.lang.String id)
Sets the unique id.


getFunction

public java.lang.String getFunction()
Gets the name of the function.


setFunction

protected void setFunction(java.lang.String function)
Sets the name of the function.


getSource

public XBUSSystem getSource()
Gets the name of the neighbor-system that has send the message.


getRequestTimestamp

public java.util.Date getRequestTimestamp()
Gets the timestamp when this Message has been received.


getResponseTimestamp

public java.util.Date getResponseTimestamp()
Gets the timestamp when the response has been given to the neighbor-system, which has sent the request.


setResponseTimestamp

public void setResponseTimestamp(java.util.Date timestamp)
Sets the timestamp when the response has been given to the neighbor-system, which has sent the request.


getReturncode

public java.lang.String getReturncode()
Gets the returncode.


setReturncode

public void setReturncode(java.lang.String rc)
Sets the returncode.


getErrorcode

public int getErrorcode()
Gets the errorcode.


setErrorcode

public void setErrorcode(int errorcode)
Sets the errorcode.


getErrortext

public java.lang.String getErrortext()
Gets the errortext.


setErrortext

public void setErrortext(java.lang.String errortext)
Sets the errortext.


setShortname

public void setShortname(java.lang.String shortname)
Sets the shortname.


getShortname

public java.lang.String getShortname()
Gets the shortname.