Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
org.ros.time.NtpTimeProvider Class Reference
Inheritance diagram for org.ros.time.NtpTimeProvider:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Time getCurrentTime ()
 NtpTimeProvider (InetAddress host, ScheduledExecutorService scheduledExecutorService)
void startPeriodicUpdates (long period, TimeUnit unit)
void stopPeriodicUpdates ()
void updateTime () throws IOException

Private Member Functions

long computeOffset () throws IOException

Private Attributes

final InetAddress host
final NTPUDPClient ntpClient
long offset
final ScheduledExecutorService scheduledExecutorService
ScheduledFuture<?> scheduledFuture
final WallTimeProvider wallTimeProvider

Static Private Attributes

static final boolean DEBUG = false
static final Log log = LogFactory.getLog(NtpTimeProvider.class)
static final int SAMPLE_SIZE = 11

Detailed Description

Provides NTP synchronized wallclock (actual) time.

Author:
damonkohler@google.com (Damon Kohler)

Definition at line 42 of file NtpTimeProvider.java.


Constructor & Destructor Documentation

org.ros.time.NtpTimeProvider.NtpTimeProvider ( InetAddress  host,
ScheduledExecutorService  scheduledExecutorService 
) [inline]
Parameters:
hostthe NTP host to use

Definition at line 61 of file NtpTimeProvider.java.


Member Function Documentation

long org.ros.time.NtpTimeProvider.computeOffset ( ) throws IOException [inline, private]

Definition at line 84 of file NtpTimeProvider.java.

Returns:
the current time of the system using rostime

Implements org.ros.time.TimeProvider.

Definition at line 138 of file NtpTimeProvider.java.

void org.ros.time.NtpTimeProvider.startPeriodicUpdates ( long  period,
TimeUnit  unit 
) [inline]

Starts periodically updating the current time offset periodically.

The first time update happens immediately.

Note that errors thrown while periodically updating time will be logged but not rethrown.

Parameters:
periodtime between updates
unitunit of period

Definition at line 114 of file NtpTimeProvider.java.

Stops periodically updating the current time offset.

Definition at line 131 of file NtpTimeProvider.java.

void org.ros.time.NtpTimeProvider.updateTime ( ) throws IOException [inline]

Update the current time offset from the configured NTP host.

Exceptions:
IOException

Definition at line 75 of file NtpTimeProvider.java.


Member Data Documentation

final boolean org.ros.time.NtpTimeProvider.DEBUG = false [static, private]

Definition at line 44 of file NtpTimeProvider.java.

final InetAddress org.ros.time.NtpTimeProvider.host [private]

Definition at line 49 of file NtpTimeProvider.java.

final Log org.ros.time.NtpTimeProvider.log = LogFactory.getLog(NtpTimeProvider.class) [static, private]

Definition at line 45 of file NtpTimeProvider.java.

final NTPUDPClient org.ros.time.NtpTimeProvider.ntpClient [private]

Definition at line 52 of file NtpTimeProvider.java.

Definition at line 54 of file NtpTimeProvider.java.

final int org.ros.time.NtpTimeProvider.SAMPLE_SIZE = 11 [static, private]

Definition at line 47 of file NtpTimeProvider.java.

final ScheduledExecutorService org.ros.time.NtpTimeProvider.scheduledExecutorService [private]

Definition at line 50 of file NtpTimeProvider.java.

ScheduledFuture<?> org.ros.time.NtpTimeProvider.scheduledFuture [private]

Definition at line 55 of file NtpTimeProvider.java.

Definition at line 51 of file NtpTimeProvider.java.


The documentation for this class was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:51