org.ros.internal.node.client
Class MasterClient

java.lang.Object
  extended by org.ros.internal.node.client.MasterClient

public class MasterClient
extends java.lang.Object

Provides access to the XML-RPC API exposed by a MasterServer.


Field Summary
protected  T xmlRpcEndpoint
           
 
Constructor Summary
MasterClient(java.net.URI uri)
          Create a new MasterClient connected to the specified MasterServer URI.
 
Method Summary
 Response<java.util.List<TopicDeclaration>> getPublishedTopics(GraphName callerName, java.lang.String subgraph)
           
 java.net.URI getRemoteUri()
           
 Response<SystemState> getSystemState(GraphName callerName)
           
 Response<java.util.List<TopicType>> getTopicTypes(GraphName callerName)
          Get a List of all TopicSystemState message types.
 Response<java.net.URI> getUri(GraphName slaveName)
           
 Response<java.net.URI> lookupNode(GraphName slaveName, java.lang.String nodeName)
           
 Response<java.net.URI> lookupService(GraphName callerName, java.lang.String serviceName)
           
 Response<java.util.List<java.net.URI>> registerPublisher(PublisherDeclaration publisherDeclaration)
          Registers the specified PublisherDeclaration.
 Response<java.lang.Void> registerService(NodeIdentifier slave, ServiceServer<?,?> service)
          Registers the given ServiceServer.
 Response<java.util.List<java.net.URI>> registerSubscriber(NodeIdentifier slave, Subscriber<?> subscriber)
          Registers the given Subscriber.
 Response<java.lang.Integer> unregisterPublisher(PublisherIdentifier publisherIdentifier)
          Unregisters the specified PublisherDeclaration.
 Response<java.lang.Integer> unregisterService(NodeIdentifier slave, ServiceServer<?,?> service)
          Unregisters the specified ServiceServer.
 Response<java.lang.Integer> unregisterSubscriber(NodeIdentifier slave, Subscriber<?> subscriber)
          Unregisters the specified Subscriber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlRpcEndpoint

protected final T extends XmlRpcEndpoint xmlRpcEndpoint
Constructor Detail

MasterClient

public MasterClient(java.net.URI uri)
Create a new MasterClient connected to the specified MasterServer URI.

Parameters:
uri - the URI of the MasterServer to connect to
Method Detail

registerService

public Response<java.lang.Void> registerService(NodeIdentifier slave,
                                                ServiceServer<?,?> service)
Registers the given ServiceServer.

Parameters:
slave - the NodeIdentifier where the ServiceServer is running
service - the ServiceServer to register
Returns:
a void Response

unregisterService

public Response<java.lang.Integer> unregisterService(NodeIdentifier slave,
                                                     ServiceServer<?,?> service)
Unregisters the specified ServiceServer.

Parameters:
slave - the NodeIdentifier where the ServiceServer is running
service - the ServiceServer to unregister
Returns:
the number of unregistered services

registerSubscriber

public Response<java.util.List<java.net.URI>> registerSubscriber(NodeIdentifier slave,
                                                                 Subscriber<?> subscriber)
Registers the given Subscriber. In addition to receiving a list of current Publishers, the Subscribers SlaveServer will also receive notifications of new Publishers via the publisherUpdate API.

Parameters:
slave - the NodeIdentifier that the Subscriber is running on
subscriber - the Subscriber to register
Returns:
a List or SlaveServer XML-RPC API URIs for nodes currently publishing the specified topic

unregisterSubscriber

public Response<java.lang.Integer> unregisterSubscriber(NodeIdentifier slave,
                                                        Subscriber<?> subscriber)
Unregisters the specified Subscriber.

Parameters:
slave - the NodeIdentifier where the subscriber is running
subscriber - the Subscriber to unregister
Returns:
the number of unregistered Subscribers

registerPublisher

public Response<java.util.List<java.net.URI>> registerPublisher(PublisherDeclaration publisherDeclaration)
Registers the specified PublisherDeclaration.

Parameters:
publisherDeclaration - the PublisherDeclaration of the Publisher to register
Returns:
a List of the current SlaveServer URIs which have Subscribers for the published TopicSystemState

unregisterPublisher

public Response<java.lang.Integer> unregisterPublisher(PublisherIdentifier publisherIdentifier)
Unregisters the specified PublisherDeclaration.

Parameters:
publisherIdentifier - the PublisherIdentifier of the Publisher to unregister
Returns:
the number of unregistered Publishers

lookupNode

public Response<java.net.URI> lookupNode(GraphName slaveName,
                                         java.lang.String nodeName)
Parameters:
slaveName - the GraphName of the caller
nodeName - the name of the SlaveServer to lookup
Returns:
the URI of the SlaveServer with the given name

getUri

public Response<java.net.URI> getUri(GraphName slaveName)
Parameters:
slaveName - the NodeIdentifier of the caller
Returns:
the URI of the MasterServer

lookupService

public Response<java.net.URI> lookupService(GraphName callerName,
                                            java.lang.String serviceName)
Parameters:
callerName - the GraphName of the caller
serviceName - the name of the ServiceServer to look up
Returns:
the URI of the ServiceServer with the given name. ServiceServer as a result

getPublishedTopics

public Response<java.util.List<TopicDeclaration>> getPublishedTopics(GraphName callerName,
                                                                     java.lang.String subgraph)
Parameters:
callerName - the GraphName of the caller
subgraph - the subgraph of the topics
Returns:
the list of published TopicDeclarations

getTopicTypes

public Response<java.util.List<TopicType>> getTopicTypes(GraphName callerName)
Get a List of all TopicSystemState message types.

Parameters:
callerName - the GraphName of the caller
Returns:
a List of TopicTypes

getSystemState

public Response<SystemState> getSystemState(GraphName callerName)
Parameters:
callerName - the GraphName of the caller
Returns:
the current SystemState

getRemoteUri

public java.net.URI getRemoteUri()
Returns:
the URI of the remote XmlRpcServer