org.osesb.msgrouting
Class BrokerAcknowledgementMessage

java.lang.Object
  extended by org.osesb.msgrouting.BrokerAcknowledgementMessage

public class BrokerAcknowledgementMessage
extends java.lang.Object

A BrokerAcknowledgementMessage is returned to a service requestor by a transport handler when the requestor expects a reply, but message processing does not produce a result.

See the org.osesb.transporthandlers package in the transport-handlers module.

A standard broker acknowledgement message XML looks like:

<ack:brokerAcknowledgement xmlns:ack="http://www.osesb.org/brokerAcknowledgement">
        <dateTime>22 Feb 2007 05:41:41</dateTime>
        <relatesToMessageType namespaceURI="www.osesb.org" localPart="testMessage" />
        <relatesToMessageID>1234</relatesToMessageID>
        <acknowledgementMessage>This is a test message.</acknowledgementMessage>
      </ack:brokerAcknowledgement>
 

This class encapsulates the properties that compose a BrokerAcknowledgementMessage and includes the following operative methods:

BrokerAcknowledgementMessage includes standard properties and extended properties. Standard properties are common to all BrokerAcknowledgementMessage(s). Extended properties are used to extend BrokerAcknowledgementMessage with properties that are message-conversation specific. For example, a 'purchaseNumber' property could be used to associate a BrokerErrorMessage with a purchase order submission. Extended properties are set using the setExtendedProperty() method.

Standard BrokerAcknowledgementMessage properties are set using accessor methods. Standard BrokerAcknowledgementMessage properties are:

Since:
Version .9

Field Summary
protected  java.lang.String acknowledgementMessage
          AcknowledgementMessage text.
protected  java.util.Date acknowledgementMessageCreateDateTime
          A Date object for the date-time the AcknowledgementMessage was created.
protected  java.lang.String acknowledgementTimestampFormat
          The format for the timestamp element in the XML acknowledgement message generated by toXML().
static java.lang.String BROKER_ACKNOWLEDGEMENTMESSAGE_NAMESPACEPREFIX
          The namespace prefix for the XML acknowledgement message generated by Acknowledgement#toXML().
static java.lang.String BROKER_ACKNOWLEDGEMENTMESSAGE_NAMESPACEURI
          The namespaceURI for the XML acknowledgement message generated by Acknowledgement#toXML().
static java.lang.String BROKER_ACKNOWLEDGEMENTMESSAGE_ROOTTAGNAME
          The tagName for the root Element of the XML generated by Acknowledgement#toXML().
protected  java.lang.String relatesToMessageID
          This is the message ID of the message that was sent to osESB and that this BrokerAcknowledgementMessage acknowledges.
protected  javax.xml.namespace.QName relatesToMessageType
          The message type of the of the message that was sent to osESB and that this BrokerAcknowledgementMessage acknowledges.
protected static java.util.Map standardPropertyNames
          fromXML() must distinguish between standard BrokerAcknowledgementMessage properties and extended properties.
protected  java.lang.String thisClassName
          The full name of this class.
 
Constructor Summary
BrokerAcknowledgementMessage()
          Construct instance of BrokerAcknowledgementMessage.
BrokerAcknowledgementMessage(java.lang.String acknowledgementMessage)
          Construct instance of BrokerAcknowledgementMessage.
 
Method Summary
static BrokerAcknowledgementMessage fromXML(java.lang.String brokerAcknowledgementXML)
          Creates a new BrokerAcknowledgementMessage object from the given broker acknowledgement XML, which looks like:

 java.lang.String getAcknowledgementMessage()
          Get AcknowledgementMessage text.
 java.lang.String getAcknowledgementTimestampFormat()
          Get the timestamp format for the XML acknowledgement message generated by toXML().
 java.util.Properties getExtendedProperties()
          Return the extended Properties for this BrokerAcknowledgementMessage.
 java.lang.String getExtendedProperty(java.lang.String propertyName)
          Return an extended Property by name.
 java.lang.String getRelatesToMessageID()
          Get the message ID of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.
 javax.xml.namespace.QName getRelatesToMessageType()
          Get the message type of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.
static boolean isBrokerAcknowledgementMessage(java.lang.String xmlText)
          Returns true if the given XML is broker acknowledgement message XML.
static void main(java.lang.String[] args)
          main(): For testing and sandboxing.
 void setAcknowledgementMessage(java.lang.String acknowledgementMessage)
          Set AcknowledgementMessage text.
 void setAcknowledgementTimestampFormat(java.lang.String acknowledgementTimestampFormat)
          Set the timestamp format for the XML acknowledgement message generated by toXML().
 void setExtendedProperties(java.util.Properties extendedProperties)
          Set the extended Properties for this BrokerAcknowledgementMessage.
 void setExtendedProperty(java.lang.String propertyName, java.lang.String propertyValue)
          Set an extended Property by name.
 void setRelatesToMessageID(java.lang.String relatesToMessageID)
          Set the message ID of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.
 void setRelatesToMessageType(javax.xml.namespace.QName relatesToMessageType)
          Set the message type of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.
 java.lang.String toXML()
          Generates a broker XML acknowledgement message from this BrokerAcknowledgementMessage that looks like:

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisClassName

protected java.lang.String thisClassName
The full name of this class.


acknowledgementMessage

protected java.lang.String acknowledgementMessage
AcknowledgementMessage text.


relatesToMessageType

protected javax.xml.namespace.QName relatesToMessageType
The message type of the of the message that was sent to osESB and that this BrokerAcknowledgementMessage acknowledges.


relatesToMessageID

protected java.lang.String relatesToMessageID
This is the message ID of the message that was sent to osESB and that this BrokerAcknowledgementMessage acknowledges.

If the originating message was sent to osESB over JMS, then this is the JMS MessageID of the JMS Message that was received by osESB.

If the originating message was sent over SOAP, then this is the value of the <wsa:MessageID> entry in the SOAPHeader of the SOAPMessage that was received by osESB.


acknowledgementMessageCreateDateTime

protected java.util.Date acknowledgementMessageCreateDateTime
A Date object for the date-time the AcknowledgementMessage was created.


acknowledgementTimestampFormat

protected java.lang.String acknowledgementTimestampFormat
The format for the timestamp element in the XML acknowledgement message generated by toXML(). Defaults to DateTimeConversionUtility.DEFAULT_TIMESTAMP_FORMAT.


standardPropertyNames

protected static java.util.Map standardPropertyNames
fromXML() must distinguish between standard BrokerAcknowledgementMessage properties and extended properties. This is a Map of standard property names; Map value entries are not used.


BROKER_ACKNOWLEDGEMENTMESSAGE_ROOTTAGNAME

public static java.lang.String BROKER_ACKNOWLEDGEMENTMESSAGE_ROOTTAGNAME
The tagName for the root Element of the XML generated by Acknowledgement#toXML().


BROKER_ACKNOWLEDGEMENTMESSAGE_NAMESPACEURI

public static java.lang.String BROKER_ACKNOWLEDGEMENTMESSAGE_NAMESPACEURI
The namespaceURI for the XML acknowledgement message generated by Acknowledgement#toXML().


BROKER_ACKNOWLEDGEMENTMESSAGE_NAMESPACEPREFIX

public static java.lang.String BROKER_ACKNOWLEDGEMENTMESSAGE_NAMESPACEPREFIX
The namespace prefix for the XML acknowledgement message generated by Acknowledgement#toXML().

Constructor Detail

BrokerAcknowledgementMessage

public BrokerAcknowledgementMessage()
Construct instance of BrokerAcknowledgementMessage.


BrokerAcknowledgementMessage

public BrokerAcknowledgementMessage(java.lang.String acknowledgementMessage)
Construct instance of BrokerAcknowledgementMessage.

Method Detail

toXML

public java.lang.String toXML()
                       throws java.lang.Exception
Generates a broker XML acknowledgement message from this BrokerAcknowledgementMessage that looks like:

<ack:brokerAcknowledgement xmlns:ack="http://www.osesb.org/brokerAcknowledgement">
        <dateTime>22 Feb 2007 05:41:41</dateTime>
        <relatesToMessageType namespaceURI="www.osesb.org" localPart="testMessage" />
        <relatesToMessageID>1234</relatesToMessageID>
        <acknowledgementMessage>This is a test message.</acknowledgementMessage>
      </ack:brokerAcknowledgement>
 

Throws:
java.lang.Exception - if There is a problem constructing a osesb acknowledgement XML Message.

fromXML

public static BrokerAcknowledgementMessage fromXML(java.lang.String brokerAcknowledgementXML)
                                            throws java.lang.Exception
Creates a new BrokerAcknowledgementMessage object from the given broker acknowledgement XML, which looks like:

<ack:brokerAcknowledgement xmlns:ack="http://www.osesb.org/brokerAcknowledgement">
        <dateTime>22 Feb 2007 05:41:41</dateTime>
        <relatesToMessageType namespaceURI="www.osesb.org" localPart="testMessage" />
        <relatesToMessageID>1234</relatesToMessageID>
        <acknowledgementMessage>This is a test message.</acknowledgementMessage>
      </ack:brokerAcknowledgement>
 

Throws:
java.lang.Exception - if There is a problem constructing a BrokerAcknowledgementMessage object from a broker acknowledgement XML Message.

isBrokerAcknowledgementMessage

public static boolean isBrokerAcknowledgementMessage(java.lang.String xmlText)
                                              throws java.lang.Exception
Returns true if the given XML is broker acknowledgement message XML.

Parameters:
xmlText - The XML to test.
Returns:
true if the given XML is broker acknowledgement message XML.
Throws:
java.lang.Exception - if xmlText cannot be parsed.

getAcknowledgementMessage

public java.lang.String getAcknowledgementMessage()
Get AcknowledgementMessage text.


setAcknowledgementMessage

public void setAcknowledgementMessage(java.lang.String acknowledgementMessage)
Set AcknowledgementMessage text.


getRelatesToMessageType

public javax.xml.namespace.QName getRelatesToMessageType()
Get the message type of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.

Returns:
The message type of the originating message that was sent to osESB.

setRelatesToMessageType

public void setRelatesToMessageType(javax.xml.namespace.QName relatesToMessageType)
Set the message type of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.

Parameters:
relatesToMessageType - The message type of the originating message that was sent to osESB.

getRelatesToMessageID

public java.lang.String getRelatesToMessageID()
Get the message ID of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.

If the originating message was sent to osESB over JMS, then this is the JMS MessageID of the JMS Message that was received by osESB.

If the originating message was sent over SOAP, then this is the value of the <wsa:MessageID> entry in the SOAPHeader of the SOAPMessage that was received by osESB.

Returns:
The message ID of the originating message that was sent to osESB.

setRelatesToMessageID

public void setRelatesToMessageID(java.lang.String relatesToMessageID)
Set the message ID of the originating message that was sent to osESB that this BrokerAcknowledgementMessage acknowledges.

If the originating message was sent to osESB over JMS, then this is the JMS MessageID of the JMS Message that was received by osESB.

If the originating message was sent over SOAP, then this is the value of the <wsa:MessageID> entry in the SOAPHeader of the SOAPMessage that was received by osESB.

Parameters:
relatesToMessageID - The message ID of the originating message that was sent to osESB.

setAcknowledgementTimestampFormat

public void setAcknowledgementTimestampFormat(java.lang.String acknowledgementTimestampFormat)
Set the timestamp format for the XML acknowledgement message generated by toXML().


getAcknowledgementTimestampFormat

public java.lang.String getAcknowledgementTimestampFormat()
Get the timestamp format for the XML acknowledgement message generated by toXML().


getExtendedProperties

public java.util.Properties getExtendedProperties()
Return the extended Properties for this BrokerAcknowledgementMessage.

Returns:
the extended Properties for this BrokerAcknowledgementMessage.

setExtendedProperties

public void setExtendedProperties(java.util.Properties extendedProperties)
Set the extended Properties for this BrokerAcknowledgementMessage.

Parameters:
extendedProperties - The extended Properties for this BrokerAcknowledgementMessage.

getExtendedProperty

public java.lang.String getExtendedProperty(java.lang.String propertyName)
Return an extended Property by name.

Returns:
a named extended Property.

setExtendedProperty

public void setExtendedProperty(java.lang.String propertyName,
                                java.lang.String propertyValue)
Set an extended Property by name.

Parameters:
propertyName - The Property name.
propertyValue - The Property value.

main

public static void main(java.lang.String[] args)
main(): For testing and sandboxing.

Parameters:
args - commandline arguments