All Packages Class Hierarchy This Package Previous Next Index
Class syd.remoteclock.RemoteClock
java.lang.Object
|
+----syd.remoteclock.RemoteClock
- public class RemoteClock
- extends Object
Gets in touch with a remote NTP server and holds that data about the
contact.
For details about the NTP protocol please see
rfc 1305
-
RemoteClock()
-
-
precision()
- ACCESSOR: returns the DISPERSION (sorry about the name) declared by the
server for its own clock
-
read(long, LogicalClock, String, int, long)
- MUTATOR: carries out the communication with the remote NTP server.
-
read_baseline()
- ACCESSOR: returns the baseline (computed on the
SystemClock
)
corresponding to the event of receiving the reply from the server.
-
t0()
- ACCESSOR: returns the time when the request was originated (according
to the logical clock or to the system clock).
-
t1()
- ACCESSOR: returns the time when the reply was received (according to the
logical clock or to the system clock).
-
tr()
- ACCESSOR: returns the time when the request was received by the server
(according with server's clock)
-
tx()
- ACCESSOR: returns the time when the reply was sent by the server
(according with server's clock)
RemoteClock
public RemoteClock()
read
public void read(long b,
LogicalClock lc,
String h,
int p,
long w) throws IOException, LogicalClockException
- MUTATOR: carries out the communication with the remote NTP server.
The operation is timed out using the quantity w
passed as parameter, computed from a baseline b
passed
as parameter. The timing of the operation is computed using a
LogicalClock
, also provided as a parameter. If the
LogicalClock
is not valid, the SystemClock
is used instead.
- Parameters:
- b - a long indicating the baseline upon which to count the
timeout;
- lc - the
LogicalClock
used to compute the
timing of the operation.
- h - a String containing the address (IP or symbolic) of the
server
- p - the port number at the server's end: 123 for NTP
- w - a long indicating the lapse indicating the timeout
read_baseline
public long read_baseline()
- ACCESSOR: returns the baseline (computed on the
SystemClock
)
corresponding to the event of receiving the reply from the server.
- Returns:
- the baseline (computed on the
SystemClock
)
corresponding to the event of receiving the reply from the server.
t0
public long t0()
- ACCESSOR: returns the time when the request was originated (according
to the logical clock or to the system clock).
- Returns:
- the time when the request was originated (according to the
logical clock or to the system clock).
- See Also:
- read
tr
public long tr()
- ACCESSOR: returns the time when the request was received by the server
(according with server's clock)
- Returns:
- the time when the request was received by the server (according
with server's clock)
tx
public long tx()
- ACCESSOR: returns the time when the reply was sent by the server
(according with server's clock)
- Returns:
- the time when the reply was sent by the server (according
with server's clock)
t1
public long t1()
- ACCESSOR: returns the time when the reply was received (according to the
logical clock or to the system clock).
- Returns:
- the time when the reply was received (according to the
logical clock or to the system clock).
- See Also:
- read
precision
public long precision()
- ACCESSOR: returns the DISPERSION (sorry about the name) declared by the
server for its own clock
- Returns:
- the DISPERSION (sorry about the name) declared by the server
for its own clock
All Packages Class Hierarchy This Package Previous Next Index