org.apache.muse.ws.notification.impl
Class SimpleNotificationMessage

java.lang.Object
  extended by org.apache.muse.ws.notification.impl.SimpleNotificationMessage
All Implemented Interfaces:
XmlSerializable, NotificationMessage

public class SimpleNotificationMessage
extends Object
implements XmlSerializable, NotificationMessage

SimpleNotificationMessage is Muse's default implementation of the WS-Notification NotificationMessageHolderType type. It provides serialization capabilities for these messages and validation of their contents.

Author:
Dan Jemiolo (danj)

Constructor Summary
SimpleNotificationMessage()
          The default constructor provides no initialization, allowing users to create messages in an 'aseembly line' system, where pieces of the messages are added by different components before being published.
SimpleNotificationMessage(Element root)
           
SimpleNotificationMessage(QName topicPath)
           
 
Method Summary
 void addMessageContent(Element content)
          This method allows you to add message content in its XML form - the element will be added as the last child under the wsnt:Message part of the notification message.
 void addMessageContent(QName qname, Object content)
          This method allows you to add message content that has not yet been serialized into XML.
 Element getMessageContent(QName qname)
           
 Object getMessageContent(QName qname, Class type)
          This is a convenience method that does the same task as getMessageContent(QName) but deserializes the message content into a POJO of the given type before returning it.
 Collection getMessageContentNames()
           
 EndpointReference getProducerReference()
           
 EndpointReference getSubscriptionReference()
           
 QName getTopic()
           
 String getTopicDialect()
           
 void setProducerReference(EndpointReference producer)
           
 void setSubscriptionReference(EndpointReference subscription)
           
 void setTopic(QName topicPath)
           
 void setTopicDialect(String dialect)
           
 String toString()
           
 Element toXML()
          Converts this object into an XML representation, as defined by its related schema or specification.
 Element toXML(Document doc)
          Converts this object into an XML representation, as defined by its related schema or specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleNotificationMessage

public SimpleNotificationMessage()
The default constructor provides no initialization, allowing users to create messages in an 'aseembly line' system, where pieces of the messages are added by different components before being published.


SimpleNotificationMessage

public SimpleNotificationMessage(Element root)
                          throws SoapFault
Parameters:
root - A DOM Element representing a WS-N SimpleNotificationMessage
Throws:
SoapFault

SimpleNotificationMessage

public SimpleNotificationMessage(QName topicPath)
Method Detail

addMessageContent

public void addMessageContent(Element content)
Description copied from interface: NotificationMessage
This method allows you to add message content in its XML form - the element will be added as the last child under the wsnt:Message part of the notification message.

Specified by:
addMessageContent in interface NotificationMessage

addMessageContent

public void addMessageContent(QName qname,
                              Object content)
                       throws SoapFault
Description copied from interface: NotificationMessage
This method allows you to add message content that has not yet been serialized into XML. The content object must be of a type that has a Muse Serializer registered for it; these types include all of the base/built-in types plus those that had serializers registered for them in muse.xml.

Specified by:
addMessageContent in interface NotificationMessage
Throws:
SoapFault
See Also:
Serializer

getMessageContent

public Element getMessageContent(QName qname)
Specified by:
getMessageContent in interface NotificationMessage
Returns:
The element under wsnt:Message that has the given name, or null if no such element exists.

getMessageContent

public Object getMessageContent(QName qname,
                                Class type)
                         throws SoapFault
Description copied from interface: NotificationMessage
This is a convenience method that does the same task as getMessageContent(QName) but deserializes the message content into a POJO of the given type before returning it.

Specified by:
getMessageContent in interface NotificationMessage
Throws:
SoapFault

getMessageContentNames

public Collection getMessageContentNames()
Specified by:
getMessageContentNames in interface NotificationMessage
Returns:
The names of all elements added under the wsnt:Message section.

getProducerReference

public EndpointReference getProducerReference()
Specified by:
getProducerReference in interface NotificationMessage
Returns:
The EPR of the resource that is sending the message. This may be null.

getSubscriptionReference

public EndpointReference getSubscriptionReference()
Specified by:
getSubscriptionReference in interface NotificationMessage
Returns:
The EPR of the subscription that is causing the message to be sent to the subscriber. This may be null.

getTopic

public QName getTopic()
Specified by:
getTopic in interface NotificationMessage
Returns:
The topic that this message was published under. This may be null.

getTopicDialect

public String getTopicDialect()
Specified by:
getTopicDialect in interface NotificationMessage
Returns:
The concrete expression dialect
See Also:
WstConstants.CONCRETE_TOPIC_URI

setProducerReference

public void setProducerReference(EndpointReference producer)
Specified by:
setProducerReference in interface NotificationMessage

setSubscriptionReference

public void setSubscriptionReference(EndpointReference subscription)
Specified by:
setSubscriptionReference in interface NotificationMessage

setTopic

public void setTopic(QName topicPath)
Specified by:
setTopic in interface NotificationMessage

setTopicDialect

public void setTopicDialect(String dialect)
                     throws TopicExpressionDialectUnknownFault
Specified by:
setTopicDialect in interface NotificationMessage
Throws:
TopicExpressionDialectUnknownFault

toString

public String toString()
Overrides:
toString in class Object

toXML

public Element toXML()
Description copied from interface: XmlSerializable
Converts this object into an XML representation, as defined by its related schema or specification. The format of the XML is dependent on the concrete type.

Specified by:
toXML in interface XmlSerializable
Returns:
An XML representation of this object.

toXML

public Element toXML(Document doc)
Description copied from interface: XmlSerializable
Converts this object into an XML representation, as defined by its related schema or specification. The format of the XML is dependent on the concrete type.

Specified by:
toXML in interface XmlSerializable
Parameters:
doc - The DOM Document that will be used to create all of the nodes in the resulting XML fragment.
Returns:
An XML representation of this object.


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.