コード例 #1
0
 /**
  * Creates a new {@link NodeConfiguration} for a {@link Node} that is only accessible on the local
  * host.
  *
  * @param masterUri the {@link URI} for the master that the {@link Node} will register with
  * @return a new {@link NodeConfiguration} for a private {@link Node}
  */
 public static NodeConfiguration newPrivate(URI masterUri) {
   NodeConfiguration configuration = new NodeConfiguration();
   configuration.setXmlRpcBindAddress(BindAddress.newPrivate());
   configuration.setXmlRpcAdvertiseAddressFactory(new PrivateAdvertiseAddressFactory());
   configuration.setTcpRosBindAddress(BindAddress.newPrivate());
   configuration.setTcpRosAdvertiseAddressFactory(new PrivateAdvertiseAddressFactory());
   configuration.setMasterUri(masterUri);
   return configuration;
 }
コード例 #2
0
 /**
  * Creates a new {@link NodeConfiguration} for a publicly accessible {@link Node}.
  *
  * @param host the host that the {@link Node} will run on
  * @param masterUri the {@link URI} for the master that the {@link Node} will register with
  * @return a new {@link NodeConfiguration} for a publicly accessible {@link Node}
  */
 public static NodeConfiguration newPublic(String host, URI masterUri) {
   NodeConfiguration configuration = new NodeConfiguration();
   configuration.setXmlRpcBindAddress(BindAddress.newPublic());
   configuration.setXmlRpcAdvertiseAddressFactory(new PublicAdvertiseAddressFactory(host));
   configuration.setTcpRosBindAddress(BindAddress.newPublic());
   configuration.setTcpRosAdvertiseAddressFactory(new PublicAdvertiseAddressFactory(host));
   configuration.setMasterUri(masterUri);
   return configuration;
 }