org.ros.internal.node.server.master
Class TopicRegistrationInfo

java.lang.Object
  extended by org.ros.internal.node.server.master.TopicRegistrationInfo

public class TopicRegistrationInfo
extends java.lang.Object

All information known to the manager about a topic.


Constructor Summary
TopicRegistrationInfo(GraphName topicName)
           
 
Method Summary
 void addPublisher(NodeRegistrationInfo publisher, java.lang.String messageType)
          Add a new publisher to the topic.
 void addSubscriber(NodeRegistrationInfo subscriber, java.lang.String messageType)
          Add a new subscriber to the topic.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getMessageType()
          Get the currently known message type of the topic.
 java.util.List<NodeRegistrationInfo> getPublishers()
          Get a list of all known publishers for the topic.
 java.util.List<NodeRegistrationInfo> getSubscribers()
          Get a list of all known subscribers for the topic.
 GraphName getTopicName()
           
 int hashCode()
           
 boolean hasPublishers()
          Does the topic have any publishers?
 boolean hasRegistrations()
          Does the topic have any registrations?
 boolean hasSubscribers()
          Does the topic have any subscribers?
 boolean removePublisher(NodeRegistrationInfo publisher)
          Remove a publisher to the topic.
 boolean removeSubscriber(NodeRegistrationInfo subscriber)
          Remove a subscriber to the topic.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicRegistrationInfo

public TopicRegistrationInfo(GraphName topicName)
Method Detail

getTopicName

public GraphName getTopicName()
Returns:
the topicName

getMessageType

public java.lang.String getMessageType()
Get the currently known message type of the topic.

Returns:
The message type. Can be null if unknown.

hasPublishers

public boolean hasPublishers()
Does the topic have any publishers?

Returns:
true if the topic has any publishers.

hasSubscribers

public boolean hasSubscribers()
Does the topic have any subscribers?

Returns:
true if the topic has any publishers or subscribers.

hasRegistrations

public boolean hasRegistrations()
Does the topic have any registrations?

Returns:
true if the topic has any publishers or subscribers.

getPublishers

public java.util.List<NodeRegistrationInfo> getPublishers()
Get a list of all known publishers for the topic.

Returns:
an immutable list of publishers

addPublisher

public void addPublisher(NodeRegistrationInfo publisher,
                         java.lang.String messageType)
Add a new publisher to the topic.

Parameters:
publisher - the publisher to add
messageType - the type of the message

removePublisher

public boolean removePublisher(NodeRegistrationInfo publisher)
Remove a publisher to the topic.

Parameters:
publisher - the publisher to add
Returns:
true if the publisher was registered in the first place

getSubscribers

public java.util.List<NodeRegistrationInfo> getSubscribers()
Get a list of all known subscribers for the topic.

Returns:
an immutable list of publishers

addSubscriber

public void addSubscriber(NodeRegistrationInfo subscriber,
                          java.lang.String messageType)
Add a new subscriber to the topic.

Parameters:
subscriber - the subscriber to add
messageType - the type of the message

removeSubscriber

public boolean removeSubscriber(NodeRegistrationInfo subscriber)
Remove a subscriber to the topic.

Parameters:
subscriber - the subscriber to add
Returns:
true if the subscriber was registered in the first place

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object