org.apache.ws.notification.topics
Interface Topic

All Superinterfaces:
TopicListenerList, TopicSet
All Known Subinterfaces:
ResourcePropertyValueChangeTopic
All Known Implementing Classes:
ResourcePropertyValueChangeTopicImpl, TopicImpl

public interface Topic
extends TopicSet, TopicListenerList

Interface for representing a topic. A topic is either a child of a parent topic or in the case of root topics a member of a topic list. Non-root topics have names without a namespace component.

See Also:
TopicSpace

Method Summary
 java.lang.Object getCurrentMessage()
          Get the latest notification message published to this topic.
 java.lang.String getName()
          Get the name of this topic.
 java.util.List getTopicPath()
          Get the topic path.
 TopicExpression getTopicReference()
          Get the topic expression for the topic(s) that this topic references.
 TopicSpace getTopicSpace()
          gets the TopicSpace this Topic is part of
 boolean isReference()
          Is this a topic reference?
 void publish(java.lang.Object msg)
          Publish a notification message to this topic.
 void setTopicPath(java.util.List topicPath)
          Set the topic path.
 void setTopicReference(TopicExpression topicPath)
          Set the topic expression that resolves to a set of topics that this topic references.
 void setTopicSpace(TopicSpace topicSpace)
          Set the TopicSpace this Topic is part of
 
Methods inherited from interface org.apache.ws.notification.topics.TopicSet
addTopic, addTopic, containsTopic, getTopic, removeTopic, topicIterator
 
Methods inherited from interface org.apache.ws.notification.topics.TopicListenerList
addTopicListener, removeTopicListener, topicListenerIterator
 

Method Detail

getName

public java.lang.String getName()
Get the name of this topic.

Returns:
the name of this topic

getCurrentMessage

public java.lang.Object getCurrentMessage()
Get the latest notification message published to this topic.

Returns:
an Object representing the latest notification message published to this topic, or null if no messages have yet been published

setTopicReference

public void setTopicReference(TopicExpression topicPath)
Set the topic expression that resolves to a set of topics that this topic references. Only used for reference topics.

Parameters:
topicPath - The topic expression to set.

getTopicReference

public TopicExpression getTopicReference()
Get the topic expression for the topic(s) that this topic references.

Returns:
The topic expression that this topic reference or null if this topic is not a reference.

setTopicPath

public void setTopicPath(java.util.List topicPath)
Set the topic path. The topic path is represented as a ordered list of topic names

Parameters:
topicPath - The topic path to associate with this topic

getTopicPath

public java.util.List getTopicPath()
Get the topic path. The topic path is represented as a ordered list of topic names

Returns:
The topic path of this topic

publish

public void publish(java.lang.Object msg)
             throws java.lang.Exception
Publish a notification message to this topic.

Parameters:
msg - the notification message to be published
Throws:
java.lang.Exception - on error

isReference

public boolean isReference()
Is this a topic reference?

Returns:
true if this topic is a reference to another topic, false if not

setTopicSpace

public void setTopicSpace(TopicSpace topicSpace)
Set the TopicSpace this Topic is part of

Parameters:
topicSpace - The TopicSpace this Topic is part of

getTopicSpace

public TopicSpace getTopicSpace()
gets the TopicSpace this Topic is part of

Returns:
The TopicSpace this Topic is part of


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.