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

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

public class MasterRegistrationManagerImpl
extends java.lang.Object

Manages all registration logic for the MasterServer.

This class is not thread-safe.


Constructor Summary
MasterRegistrationManagerImpl(MasterRegistrationListener listener)
           
 
Method Summary
 java.util.Collection<ServiceRegistrationInfo> getAllServices()
          Get all services registered.
 java.util.Collection<TopicRegistrationInfo> getAllTopics()
          Get all topics registered.
 NodeRegistrationInfo getNodeRegistrationInfo(GraphName nodeName)
          Get the information known about a node.
 ServiceRegistrationInfo getServiceRegistrationInfo(GraphName serviceName)
          Get the information known about a service.
 TopicRegistrationInfo getTopicRegistrationInfo(GraphName topicName)
          Get the information known about a topic.
 TopicRegistrationInfo registerPublisher(GraphName nodeName, java.net.URI nodeSlaveUri, GraphName topicName, java.lang.String topicMessageType)
          Register a publisher.
 ServiceRegistrationInfo registerService(GraphName nodeName, java.net.URI nodeSlaveUri, GraphName serviceName, java.net.URI serviceUri)
          Register a service.
 TopicRegistrationInfo registerSubscriber(GraphName nodeName, java.net.URI nodeSlaveUri, GraphName topicName, java.lang.String topicMessageType)
          Register a subscriber.
 boolean unregisterPublisher(GraphName nodeName, GraphName topicName)
          Unregister a publisher.
 boolean unregisterService(GraphName nodeName, GraphName serviceName, java.net.URI serviceUri)
          Unregister a service.
 boolean unregisterSubscriber(GraphName nodeName, GraphName topicName)
          Unregister a subscriber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterRegistrationManagerImpl

public MasterRegistrationManagerImpl(MasterRegistrationListener listener)
Method Detail

registerPublisher

public TopicRegistrationInfo registerPublisher(GraphName nodeName,
                                               java.net.URI nodeSlaveUri,
                                               GraphName topicName,
                                               java.lang.String topicMessageType)
Register a publisher.

Parameters:
nodeName - name of the node with the publisher
nodeSlaveUri - URI of the slave server on the node
topicName - then name of the topic
topicMessageType - message type of the topic
Returns:
The registration information for the topic.

unregisterPublisher

public boolean unregisterPublisher(GraphName nodeName,
                                   GraphName topicName)
Unregister a publisher.

Parameters:
nodeName - name of the node which has the publisher
topicName - name of the publisher's topic
Returns:
true if the publisher was actually registered before the call.

registerSubscriber

public TopicRegistrationInfo registerSubscriber(GraphName nodeName,
                                                java.net.URI nodeSlaveUri,
                                                GraphName topicName,
                                                java.lang.String topicMessageType)
Register a subscriber.

Parameters:
nodeName - name of the node with the subscriber
nodeSlaveUri - URI of the slave server on the node
topicName - then name of the topic
topicMessageType - message type of the topic
Returns:
The registration information for the topic.

unregisterSubscriber

public boolean unregisterSubscriber(GraphName nodeName,
                                    GraphName topicName)
Unregister a subscriber.

Parameters:
nodeName - name of the node which has the subscriber
topicName - name of the subscriber's topic
Returns:
true if the subscriber was actually registered before the call.

registerService

public ServiceRegistrationInfo registerService(GraphName nodeName,
                                               java.net.URI nodeSlaveUri,
                                               GraphName serviceName,
                                               java.net.URI serviceUri)
Register a service.

Parameters:
nodeName - name of the node with the service
nodeSlaveUri - URI of the slave server on the node
serviceName - the name of the service
serviceUri - URI of the service server on the node
Returns:
The registration information for the service.

unregisterService

public boolean unregisterService(GraphName nodeName,
                                 GraphName serviceName,
                                 java.net.URI serviceUri)
Unregister a service.

Parameters:
nodeName - name of the node with the service
serviceName - the name of the service
serviceUri - URI of the service server on the node
Returns:
true if the service was actually registered before the call.

getAllTopics

public java.util.Collection<TopicRegistrationInfo> getAllTopics()
Get all topics registered.

Returns:
An immutable collection of topics.

getTopicRegistrationInfo

public TopicRegistrationInfo getTopicRegistrationInfo(GraphName topicName)
Get the information known about a topic.

Parameters:
topicName - the name of the topic
Returns:
The information about the topic. Can be null if the topic was never registered.

getNodeRegistrationInfo

public NodeRegistrationInfo getNodeRegistrationInfo(GraphName nodeName)
Get the information known about a node.

Parameters:
nodeName - the name of the node
Returns:
The information about the node. Can be null if no topic was ever registered for the node.

getAllServices

public java.util.Collection<ServiceRegistrationInfo> getAllServices()
Get all services registered.

Returns:
An immutable collection of services.

getServiceRegistrationInfo

public ServiceRegistrationInfo getServiceRegistrationInfo(GraphName serviceName)
Get the information known about a service.

Parameters:
serviceName - the name of the service
Returns:
The information about the service. Can be null if there is no service registered with the given name.