net.sf.xbus.protocol.xml
Class XMLMessageImplementation
java.lang.Object
net.sf.xbus.protocol.Message
net.sf.xbus.protocol.xml.XMLMessageAbstract
net.sf.xbus.protocol.xml.XMLMessageImplementation
- All Implemented Interfaces:
- ObjectMessage, TextMessage, XMLMessage
public class XMLMessageImplementation
- extends XMLMessageAbstract
- implements TextMessage, ObjectMessage, XMLMessage
XMLMessageImplementation
represents generic XML messages.
Constructor Summary |
XMLMessageImplementation(java.lang.String function,
XBUSSystem source,
java.lang.String id)
This constructor initializes the new
XMLMessageImplementation with the given parameters. |
XMLMessageImplementation(XBUSSystem source)
This constructor stores the source , creates an unique
identifier for the call and initializes the requestTimestamp. |
Method Summary |
protected void |
synchronizeRequestFields(XBUSSystem system)
After setting the request data, both setRequestText and
setRequestDocument , some fields of the
Message must be synchronized with the request data. |
protected void |
synchronizeResponseFields(XBUSSystem system)
After setting the response data, both setResponseText and
setResponseDocument , some fields of the
Message must be synchronized with the response data. |
Methods inherited from class net.sf.xbus.protocol.xml.XMLMessageAbstract |
getDocumentBuilder, getRequestDocument, getRequestObject, getRequestText, getResponseDocument, getResponseObject, getResponseText, parseXML, serializeXML, setRequestDocument, setRequestObject, setRequestText, setResponseDocument, setResponseObject, setResponseText |
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 |
XMLMessageImplementation
public XMLMessageImplementation(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 XBUSXMLMessage
from the data of a
receiver.
XMLMessageImplementation
public XMLMessageImplementation(java.lang.String function,
XBUSSystem source,
java.lang.String id)
- This constructor initializes the new
XMLMessageImplementation
with the given parameters. It is
used when constructing a new XMLMessageImplementation
by
converting it from another Message
.
synchronizeRequestFields
protected void synchronizeRequestFields(XBUSSystem system)
- Description copied from class:
XMLMessageAbstract
- After setting the request data, both
setRequestText
and
setRequestDocument
, some fields of the
Message
must be synchronized with the request data.
- Id: When the Id is found in the request data, it must be
copied to the
Message
. When it is not found, the value
from the Message
must be copied to the request data.
- Function: The value for the function must be read from the
request data and must be set in the
Message
.
- Source: Must be copied from the
Message
object
to the request data, to be sure that it is set correct.
- Request Timestamp: Must be copied from the
Message
object to the request data.
- Specified by:
synchronizeRequestFields
in class XMLMessageAbstract
synchronizeResponseFields
protected void synchronizeResponseFields(XBUSSystem system)
- Description copied from class:
XMLMessageAbstract
- After setting the response data, both
setResponseText
and
setResponseDocument
, some fields of the
Message
must be synchronized with the response data.
- Returncode: The value of the returncode must be extracted out
of the response data.
- Errorcode: When an error has occured, the value for the
errorcode can be read out of the response data, if it is included there.
- Errortext: When an error has occured, the value for the
errortext can be read out of the response data, if it is included there.
- Specified by:
synchronizeResponseFields
in class XMLMessageAbstract