org.ros.master.uri
Class StaticMasterUriProvider

java.lang.Object
  extended by org.ros.master.uri.StaticMasterUriProvider
All Implemented Interfaces:
MasterUriProvider

public class StaticMasterUriProvider
extends java.lang.Object
implements MasterUriProvider

A MasterUriProvider which will always return the same URI.


Constructor Summary
StaticMasterUriProvider(java.net.URI uri)
           
 
Method Summary
 java.net.URI getMasterUri()
          Get a master URI.
 java.net.URI getMasterUri(long timeout, java.util.concurrent.TimeUnit unit)
          Get a master URI within a given amount of time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticMasterUriProvider

public StaticMasterUriProvider(java.net.URI uri)
Method Detail

getMasterUri

public java.net.URI getMasterUri()
Description copied from interface: MasterUriProvider
Get a master URI.

There is no guarantee that calling this class twice will provide the same URI.

This call may or may not block until a URI is available.

Specified by:
getMasterUri in interface MasterUriProvider
Returns:
a master URI

getMasterUri

public java.net.URI getMasterUri(long timeout,
                                 java.util.concurrent.TimeUnit unit)
Description copied from interface: MasterUriProvider
Get a master URI within a given amount of time.

There is no guarantee that calling this class twice will provide the same URI.

This call may or may not block until a URI is available.

Specified by:
getMasterUri in interface MasterUriProvider
Parameters:
timeout - the amount of time to wait for a URI
unit - the time unit for the wait time
Returns:
a master URI or null if none could be obtained within the timeout