org.ros.node
Class NodeConfiguration

java.lang.Object
  extended by org.ros.node.NodeConfiguration

public class NodeConfiguration
extends java.lang.Object

Stores configuration information (e.g. ROS master URI) for Nodes.

See Also:
Node documentation

Field Summary
static java.net.URI DEFAULT_MASTER_URI
          The default master URI.
 
Method Summary
static NodeConfiguration copyOf(NodeConfiguration nodeConfiguration)
           
 java.net.URI getMasterUri()
           
 MessageSerializationFactory getMessageSerializationFactory()
           
 GraphName getNodeName()
           
 NameResolver getParentResolver()
           
 java.util.List<java.io.File> getRosPackagePath()
          These ordered paths tell the ROS system where to search for more ROS packages.
 java.io.File getRosRoot()
           
 ServiceDescriptionFactory getServiceDescriptionFactory()
           
 MessageFactory getServiceRequestMessageFactory()
           
 MessageFactory getServiceResponseMessageFactory()
           
 AdvertiseAddress getTcpRosAdvertiseAddress()
           
 AdvertiseAddressFactory getTcpRosAdvertiseAddressFactory()
           
 BindAddress getTcpRosBindAddress()
           
 TimeProvider getTimeProvider()
           
 TopicDescriptionFactory getTopicDescriptionFactory()
           
 MessageFactory getTopicMessageFactory()
           
 AdvertiseAddress getXmlRpcAdvertiseAddress()
           
 AdvertiseAddressFactory getXmlRpcAdvertiseAddressFactory()
           
 BindAddress getXmlRpcBindAddress()
           
static NodeConfiguration newPrivate()
          Creates a new NodeConfiguration for a Node that is only accessible on the local host.
static NodeConfiguration newPrivate(java.net.URI masterUri)
          Creates a new NodeConfiguration for a Node that is only accessible on the local host.
static NodeConfiguration newPublic(java.lang.String host)
          Creates a new NodeConfiguration for a publicly accessible Node.
static NodeConfiguration newPublic(java.lang.String host, java.net.URI masterUri)
          Creates a new NodeConfiguration for a publicly accessible Node.
 NodeConfiguration setDefaultNodeName(GraphName nodeName)
          Sets the name of the Node if the name has not already been set.
 NodeConfiguration setDefaultNodeName(java.lang.String nodeName)
          Sets the name of the Node if the name has not already been set.
 NodeConfiguration setMasterUri(java.net.URI masterUri)
           
 NodeConfiguration setMessageSerializationFactory(MessageSerializationFactory messageSerializationFactory)
           
 NodeConfiguration setNodeName(GraphName nodeName)
           
 NodeConfiguration setNodeName(java.lang.String nodeName)
           
 NodeConfiguration setParentResolver(NameResolver resolver)
           
 NodeConfiguration setRosPackagePath(java.util.List<java.io.File> rosPackagePath)
          These ordered paths tell the ROS system where to search for more ROS packages.
 NodeConfiguration setRosRoot(java.io.File rosRoot)
           
 NodeConfiguration setServiceDescriptionFactory(ServiceDescriptionFactory serviceDescriptionFactory)
           
 NodeConfiguration setServiceRequestMessageFactory(ServiceRequestMessageFactory serviceRequestMessageFactory)
           
 NodeConfiguration setServiceResponseMessageFactory(ServiceResponseMessageFactory serviceResponseMessageFactory)
           
 NodeConfiguration setTcpRosAdvertiseAddressFactory(AdvertiseAddressFactory tcpRosAdvertiseAddressFactory)
           
 NodeConfiguration setTcpRosBindAddress(BindAddress tcpRosBindAddress)
           
 NodeConfiguration setTimeProvider(TimeProvider timeProvider)
          Sets the TimeProvider that Nodes will use.
 NodeConfiguration setTopicDescriptionFactory(TopicDescriptionFactory topicDescriptionFactory)
           
 NodeConfiguration setTopicMessageFactory(MessageFactory topicMessageFactory)
           
 NodeConfiguration setXmlRpcAdvertiseAddressFactory(AdvertiseAddressFactory xmlRpcAdvertiseAddressFactory)
           
 NodeConfiguration setXmlRpcBindAddress(BindAddress xmlRpcBindAddress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MASTER_URI

public static final java.net.URI DEFAULT_MASTER_URI
The default master URI.

Method Detail

copyOf

public static NodeConfiguration copyOf(NodeConfiguration nodeConfiguration)
Parameters:
nodeConfiguration - the NodeConfiguration to copy
Returns:
a copy of the supplied NodeConfiguration

newPublic

public static NodeConfiguration newPublic(java.lang.String host,
                                          java.net.URI masterUri)
Creates a new NodeConfiguration for a publicly accessible Node.

Parameters:
host - the host that the Node will run on
masterUri - the URI for the master that the Node will register with
Returns:
a new NodeConfiguration for a publicly accessible Node

newPublic

public static NodeConfiguration newPublic(java.lang.String host)
Creates a new NodeConfiguration for a publicly accessible Node.

Parameters:
host - the host that the Node will run on
Returns:
a new NodeConfiguration for a publicly accessible Node

newPrivate

public static NodeConfiguration newPrivate(java.net.URI masterUri)
Creates a new NodeConfiguration for a Node that is only accessible on the local host.

Parameters:
masterUri - the URI for the master that the Node will register with
Returns:
a new NodeConfiguration for a private Node

newPrivate

public static NodeConfiguration newPrivate()
Creates a new NodeConfiguration for a Node that is only accessible on the local host.

Returns:
a new NodeConfiguration for a private Node

getParentResolver

public NameResolver getParentResolver()
Returns:
the NameResolver for the Node's parent namespace

setParentResolver

public NodeConfiguration setParentResolver(NameResolver resolver)
Parameters:
resolver - the NameResolver for the Node's parent namespace
Returns:
this NodeConfiguration

getMasterUri

public java.net.URI getMasterUri()
Returns:
the URI of the master that the Node will register with
See Also:
ROS_MASTER_URI documentation

setMasterUri

public NodeConfiguration setMasterUri(java.net.URI masterUri)
Parameters:
masterUri - the URI of the master that the Node will register with
Returns:
this NodeConfiguration
See Also:
ROS_MASTER_URI documentation

getRosRoot

public java.io.File getRosRoot()
Returns:
the location where the ROS core packages are installed
See Also:
ROS_ROOT documentation

setRosRoot

public NodeConfiguration setRosRoot(java.io.File rosRoot)
Parameters:
rosRoot - the location where the ROS core packages are installed
Returns:
this NodeConfiguration
See Also:
ROS_ROOT documentation

getRosPackagePath

public java.util.List<java.io.File> getRosPackagePath()
These ordered paths tell the ROS system where to search for more ROS packages. If there are multiple packages of the same name, ROS will choose the one that appears in the List first.

Returns:
the List of paths where the system will look for ROS packages
See Also:
ROS_PACKAGE_PATH documentation

setRosPackagePath

public NodeConfiguration setRosPackagePath(java.util.List<java.io.File> rosPackagePath)
These ordered paths tell the ROS system where to search for more ROS packages. If there are multiple packages of the same name, ROS will choose the one that appears in the List first.

Parameters:
rosPackagePath - the List of paths where the system will look for ROS packages
Returns:
this NodeConfiguration
See Also:
ROS_PACKAGE_PATH documentation

getNodeName

public GraphName getNodeName()
Returns:
the name of the Node

setNodeName

public NodeConfiguration setNodeName(GraphName nodeName)
Parameters:
nodeName - the name of the Node
Returns:
this NodeConfiguration

setNodeName

public NodeConfiguration setNodeName(java.lang.String nodeName)
Parameters:
nodeName - the name of the Node
Returns:
this NodeConfiguration

setDefaultNodeName

public NodeConfiguration setDefaultNodeName(GraphName nodeName)
Sets the name of the Node if the name has not already been set.

Parameters:
nodeName - the name of the Node
Returns:
this NodeConfiguration

setDefaultNodeName

public NodeConfiguration setDefaultNodeName(java.lang.String nodeName)
Sets the name of the Node if the name has not already been set.

Parameters:
nodeName - the name of the Node
Returns:
this NodeConfiguration

getMessageSerializationFactory

public MessageSerializationFactory getMessageSerializationFactory()
Returns:
the MessageSerializationFactory for the Node

setMessageSerializationFactory

public NodeConfiguration setMessageSerializationFactory(MessageSerializationFactory messageSerializationFactory)
Parameters:
messageSerializationFactory - the MessageSerializationFactory for the Node
Returns:
this NodeConfiguration

setTopicMessageFactory

public NodeConfiguration setTopicMessageFactory(MessageFactory topicMessageFactory)
Parameters:
topicMessageFactory - the MessageFactory for the Node
Returns:
this NodeConfiguration

getTopicMessageFactory

public MessageFactory getTopicMessageFactory()

setServiceRequestMessageFactory

public NodeConfiguration setServiceRequestMessageFactory(ServiceRequestMessageFactory serviceRequestMessageFactory)
Parameters:
serviceRequestMessageFactory - the ServiceRequestMessageFactory for the Node
Returns:
this NodeConfiguration

getServiceRequestMessageFactory

public MessageFactory getServiceRequestMessageFactory()

setServiceResponseMessageFactory

public NodeConfiguration setServiceResponseMessageFactory(ServiceResponseMessageFactory serviceResponseMessageFactory)
Parameters:
serviceResponseMessageFactory - the ServiceResponseMessageFactory for the Node
Returns:
this NodeConfiguration

getServiceResponseMessageFactory

public MessageFactory getServiceResponseMessageFactory()

setTopicDescriptionFactory

public NodeConfiguration setTopicDescriptionFactory(TopicDescriptionFactory topicDescriptionFactory)
Parameters:
topicDescriptionFactory - the TopicDescriptionFactory for the Node
Returns:
this NodeConfiguration

getTopicDescriptionFactory

public TopicDescriptionFactory getTopicDescriptionFactory()

setServiceDescriptionFactory

public NodeConfiguration setServiceDescriptionFactory(ServiceDescriptionFactory serviceDescriptionFactory)
Parameters:
serviceDescriptionFactory - the ServiceDescriptionFactory for the Node
Returns:
this NodeConfiguration

getServiceDescriptionFactory

public ServiceDescriptionFactory getServiceDescriptionFactory()

getTcpRosBindAddress

public BindAddress getTcpRosBindAddress()
Returns:
the BindAddress for the Node's TCPROS server
See Also:
TCPROS documentation

setTcpRosBindAddress

public NodeConfiguration setTcpRosBindAddress(BindAddress tcpRosBindAddress)
Parameters:
tcpRosBindAddress - the BindAddress for the Node's TCPROS server
See Also:
TCPROS documentation

getTcpRosAdvertiseAddressFactory

public AdvertiseAddressFactory getTcpRosAdvertiseAddressFactory()
Returns:
the AdvertiseAddressFactory for the Node's TCPROS server
See Also:
TCPROS documentation

setTcpRosAdvertiseAddressFactory

public NodeConfiguration setTcpRosAdvertiseAddressFactory(AdvertiseAddressFactory tcpRosAdvertiseAddressFactory)
Parameters:
tcpRosAdvertiseAddressFactory - the AdvertiseAddressFactory for the Node's TCPROS server
Returns:
this NodeConfiguration
See Also:
TCPROS documentation

getTcpRosAdvertiseAddress

public AdvertiseAddress getTcpRosAdvertiseAddress()
Returns:
the AdvertiseAddress for the Node's TCPROS server
See Also:
TCPROS documentation

getXmlRpcBindAddress

public BindAddress getXmlRpcBindAddress()
Returns:
the BindAddress for the Node's XML-RPC server
See Also:
Node documentation

setXmlRpcBindAddress

public NodeConfiguration setXmlRpcBindAddress(BindAddress xmlRpcBindAddress)
Parameters:
xmlRpcBindAddress - the BindAddress for the Node's XML-RPC server
See Also:
Node documentation

getXmlRpcAdvertiseAddress

public AdvertiseAddress getXmlRpcAdvertiseAddress()
Returns:
the AdvertiseAddress for the Node's XML-RPC server
See Also:
Node documentation

getXmlRpcAdvertiseAddressFactory

public AdvertiseAddressFactory getXmlRpcAdvertiseAddressFactory()
Returns:
the AdvertiseAddressFactory for the Node's XML-RPC server
See Also:
Node documentation

setXmlRpcAdvertiseAddressFactory

public NodeConfiguration setXmlRpcAdvertiseAddressFactory(AdvertiseAddressFactory xmlRpcAdvertiseAddressFactory)
Parameters:
xmlRpcAdvertiseAddressFactory - the AdvertiseAddressFactory for the Node's XML-RPC server
See Also:
Node documentation

getTimeProvider

public TimeProvider getTimeProvider()
Returns:
the configured TimeProvider

setTimeProvider

public NodeConfiguration setTimeProvider(TimeProvider timeProvider)
Sets the TimeProvider that Nodes will use. By default, the WallTimeProvider is used.

Parameters:
timeProvider - the TimeProvider that Nodes will use