|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ros.internal.node.server.XmlRpcServer org.ros.internal.node.server.master.MasterServer
public class MasterServer
The MasterServer
provides naming and registration services to the
rest of the Node
s in the ROS system. It tracks Publisher
s and
Subscriber
s to TopicSystemState
s as well as
ServiceServer
s. The role of the MasterServer
is to enable
individual ROS Node
s to locate one another. Once these Node
s
have located each other they communicate with each other peer-to-peer.
Field Summary | |
---|---|
static int |
SYSTEM_STATE_PUBLISHERS
Position in the getSystemState() for publisher information. |
static int |
SYSTEM_STATE_SERVICES
Position in the getSystemState() for service information. |
static int |
SYSTEM_STATE_SUBSCRIBERS
Position in the getSystemState() for subscriber information. |
Constructor Summary | |
---|---|
MasterServer(BindAddress bindAddress,
AdvertiseAddress advertiseAddress)
|
Method Summary | |
---|---|
protected void |
contactSubscriberForPublisherUpdate(java.net.URI subscriberSlaveUri,
GraphName topicName,
java.util.List<java.net.URI> publisherUris)
Contact a subscriber and send it a publisher update. |
java.util.List<java.lang.Object> |
getPublishedTopics(GraphName caller,
GraphName subgraph)
Get a list of all topics published for the give subgraph. |
java.util.List<java.lang.Object> |
getSystemState()
Get the state of the ROS graph. |
java.util.List<java.util.List<java.lang.String>> |
getTopicTypes(GraphName calledId)
Get a List of all TopicSystemState message types. |
java.net.URI |
lookupNode(GraphName nodeName)
Returns a NodeIdentifier for the Node with the given name. |
java.net.URI |
lookupService(GraphName serviceName)
Lookup the provider of a particular service. |
void |
onNodeReplacement(NodeRegistrationInfo nodeInfo)
A node is being replaced. |
java.util.List<java.net.URI> |
registerPublisher(GraphName nodeName,
java.net.URI nodeSlaveUri,
GraphName topicName,
java.lang.String topicMessageType)
Register the caller as a Publisher of the specified topic. |
void |
registerService(GraphName nodeName,
java.net.URI nodeSlaveUri,
GraphName serviceName,
java.net.URI serviceUri)
Register a service with the master. |
java.util.List<java.net.URI> |
registerSubscriber(GraphName nodeName,
java.net.URI nodeSlaveUri,
GraphName topicName,
java.lang.String topicMessageType)
Subscribe the caller to the specified topic. |
void |
start()
Start the MasterServer . |
boolean |
unregisterPublisher(GraphName nodeName,
GraphName topicName)
Unregister a Publisher . |
boolean |
unregisterService(GraphName nodeName,
GraphName serviceName,
java.net.URI serviceUri)
Unregister a service from the master. |
boolean |
unregisterSubscriber(GraphName nodeName,
GraphName topicName)
Unregister a Subscriber . |
Methods inherited from class org.ros.internal.node.server.XmlRpcServer |
---|
awaitStart, awaitStart, getAddress, getAdvertiseAddress, getPid, getUri, shutdown, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SYSTEM_STATE_PUBLISHERS
getSystemState()
for publisher information.
public static final int SYSTEM_STATE_SUBSCRIBERS
getSystemState()
for subscriber information.
public static final int SYSTEM_STATE_SERVICES
getSystemState()
for service information.
Constructor Detail |
---|
public MasterServer(BindAddress bindAddress, AdvertiseAddress advertiseAddress)
Method Detail |
---|
public void start()
MasterServer
.
public void registerService(GraphName nodeName, java.net.URI nodeSlaveUri, GraphName serviceName, java.net.URI serviceUri)
nodeName
- the GraphName
of the Node
offering the servicenodeSlaveUri
- the URI
of the Node
's SlaveServer
serviceName
- the GraphName
of the serviceserviceUri
- the URI
of the servicepublic boolean unregisterService(GraphName nodeName, GraphName serviceName, java.net.URI serviceUri)
nodeName
- the GraphName
of the Node
offering the serviceserviceName
- the GraphName
of the serviceserviceUri
- the URI
of the service
true
if the service was registeredpublic java.util.List<java.net.URI> registerSubscriber(GraphName nodeName, java.net.URI nodeSlaveUri, GraphName topicName, java.lang.String topicMessageType)
nodeName
- the GraphName
of the Node
offering the servicenodeSlaveUri
- the URI
of the Node
's SlaveServer
topicName
- the GraphName
of the subscribed TopicParticipant
topicMessageType
- the message type of the topic
List
of XMLRPC API URI
s for nodes currently
publishing the specified topicpublic boolean unregisterSubscriber(GraphName nodeName, GraphName topicName)
Subscriber
.
nodeName
- the GraphName
of the Node
offering the servicetopicName
- the GraphName
of the subscribed TopicParticipant
true
if the Subscriber
was registeredpublic java.util.List<java.net.URI> registerPublisher(GraphName nodeName, java.net.URI nodeSlaveUri, GraphName topicName, java.lang.String topicMessageType)
Publisher
of the specified topic.
nodeName
- the GraphName
of the Node
offering the servicenodeSlaveUri
- the URI
of the Node
's SlaveServer
topicName
- the GraphName
of the subscribed TopicParticipant
topicMessageType
- the message type of the topic
List
of the current Subscriber
s to the
Publisher
's TopicSystemState
in the form of XML-RPC
URI
s for each Subscriber
's SlaveServer
protected void contactSubscriberForPublisherUpdate(java.net.URI subscriberSlaveUri, GraphName topicName, java.util.List<java.net.URI> publisherUris)
subscriberSlaveUri
- the slave URI of the subscriber to contacttopicName
- the name of the topic whose publisher URIs are being updatedpublisherUris
- the new list of publisher URIs to be sent to the subscriberpublic boolean unregisterPublisher(GraphName nodeName, GraphName topicName)
Publisher
.
nodeName
- the GraphName
of the Node
offering the servicetopicName
- the GraphName
of the subscribed TopicParticipant
true
if the Publisher
was unregisteredpublic java.net.URI lookupNode(GraphName nodeName)
NodeIdentifier
for the Node
with the given name.
This API is for looking information about Publisher
s and
Subscriber
s. Use lookupService(GraphName)
instead to
lookup ROS-RPC URI
s for ServiceServer
s.
nodeName
- name of Node
to lookup
URI
for the Node
slave server with the given
name, or null
if there is no Node
with the given
namepublic java.util.List<java.util.List<java.lang.String>> getTopicTypes(GraphName calledId)
List
of all TopicSystemState
message types.
calledId
- the Node
name of the caller
public java.util.List<java.lang.Object> getSystemState()
This includes information about publishers, subscribers, and services.
public java.net.URI lookupService(GraphName serviceName)
serviceName
- name of service
URI
of the SlaveServer
with the provided name, or
null
if there is no such service.public java.util.List<java.lang.Object> getPublishedTopics(GraphName caller, GraphName subgraph)
caller
- name of the callersubgraph
- subgraph containing the requested TopicSystemState
s,
relative to caller
List
of List
s where the nested List
s
contain, in order, the TopicSystemState
name and
TopicSystemState
message typepublic void onNodeReplacement(NodeRegistrationInfo nodeInfo)
MasterRegistrationListener
The information object is about to be trashed, so it should not be hung onto.
onNodeReplacement
in interface MasterRegistrationListener
nodeInfo
- the node being replaced
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |