org.apache.muse.ws.notification.topics.impl
Class SimpleTopic

java.lang.Object
  extended by org.apache.muse.ws.notification.topics.impl.SimpleTopic
All Implemented Interfaces:
XmlSerializable, Topic

public class SimpleTopic
extends Object
implements Topic

SimpleTopic is Muse's default implementation of the wsnt:Topic data structure defined in WS-Notification v1.3 and WS-Topics v1.3.

Author:
Dan Jemiolo (danj)

Constructor Summary
SimpleTopic(Element root, TopicNamespace topicSpace)
           
SimpleTopic(String name, TopicNamespace topicSpace)
           
 
Method Summary
 void addMessageType(QName messageType)
           
 void addTopic(Topic childTopic)
          Adds a child topic to the topic.
 boolean equals(Object obj)
           
 QName getConcretePath()
           
 NotificationMessage getCurrentMessage()
           
 String getMessagePattern()
           
 String getMessagePatternDialect()
           
 Set getMessageTypes()
           
 String getName()
           
 Topic getParentTopic()
           
 Topic getTopic(String topicName)
           
 TopicNamespace getTopicNamespace()
           
 Collection getTopics()
           
 int hashCode()
           
 boolean hasTopic(String topicName)
           
 boolean isFinal()
           
 boolean isRootTopic()
           
 void removeAllTopics()
           
 void removeMessageType(QName messageType)
           
 void removeTopic(String topicName)
           
 void setCurrentMessage(NotificationMessage message)
           
 void setFinal(boolean isFinal)
           
 void setMessagePattern(String messagePattern)
           
 void setParentTopic(Topic parentTopic)
           
 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, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleTopic

public SimpleTopic(Element root,
                   TopicNamespace topicSpace)
            throws InvalidTopicExpressionFault,
                   BaseFault
Throws:
InvalidTopicExpressionFault
BaseFault

SimpleTopic

public SimpleTopic(String name,
                   TopicNamespace topicSpace)
            throws BaseFault
Throws:
BaseFault
Method Detail

addMessageType

public final void addMessageType(QName messageType)
Specified by:
addMessageType in interface Topic

addTopic

public final void addTopic(Topic childTopic)
                    throws InvalidTopicExpressionFault,
                           BaseFault
Description copied from interface: Topic
Adds a child topic to the topic.

Specified by:
addTopic in interface Topic
Throws:
InvalidTopicExpressionFault
BaseFault

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Returns:
True if the two topics have the same local name, topic namespace, concrete path, message pattern, and 'final' status.

getConcretePath

public QName getConcretePath()
Specified by:
getConcretePath in interface Topic
Returns:
A fully-qualified name for the topic.

getCurrentMessage

public NotificationMessage getCurrentMessage()
Specified by:
getCurrentMessage in interface Topic
Returns:
The last message published to this topic.

getMessagePattern

public String getMessagePattern()
Specified by:
getMessagePattern in interface Topic
Returns:
An XPath that further expresses the types of messages this topic publishes.

getMessagePatternDialect

public String getMessagePatternDialect()
Specified by:
getMessagePatternDialect in interface Topic
Returns:
The XPath 1.0 namespace.

getMessageTypes

public Set getMessageTypes()
Specified by:
getMessageTypes in interface Topic

getName

public final String getName()
Specified by:
getName in interface Topic
Returns:
The local name of the topic.

getParentTopic

public Topic getParentTopic()
Specified by:
getParentTopic in interface Topic

getTopic

public Topic getTopic(String topicName)
Specified by:
getTopic in interface Topic
Returns:
The child topic with the given name, or null if no such topic exists.

getTopicNamespace

public TopicNamespace getTopicNamespace()
Specified by:
getTopicNamespace in interface Topic
Returns:
The TopicNamespace that contains this Topic.

getTopics

public Collection getTopics()
Specified by:
getTopics in interface Topic
Returns:
All of the child topics under this topic.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
A hash code based on the same values used for testing equality.
See Also:
equals(Object)

hasTopic

public boolean hasTopic(String topicName)
Specified by:
hasTopic in interface Topic
Returns:
True if this topic has a child topic with the given name.

isFinal

public boolean isFinal()
Specified by:
isFinal in interface Topic
Returns:
True if the topic does not allow addition of child topics.

isRootTopic

public boolean isRootTopic()
Specified by:
isRootTopic in interface Topic
Returns:
True if the topic has no parent topic.

removeAllTopics

public final void removeAllTopics()
Specified by:
removeAllTopics in interface Topic

removeMessageType

public final void removeMessageType(QName messageType)
Specified by:
removeMessageType in interface Topic

removeTopic

public final void removeTopic(String topicName)
Specified by:
removeTopic in interface Topic

setCurrentMessage

public void setCurrentMessage(NotificationMessage message)
Specified by:
setCurrentMessage in interface Topic
Parameters:
message - The last message published to this topic.

setFinal

public void setFinal(boolean isFinal)
Specified by:
setFinal in interface Topic

setMessagePattern

public void setMessagePattern(String messagePattern)
Specified by:
setMessagePattern in interface Topic

setParentTopic

public void setParentTopic(Topic parentTopic)
Specified by:
setParentTopic in interface Topic

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.