public interface NetTimeConfiguration
Contains the configuration parameters of a connection to an internet time server.
Implementations of this SPI-interface must be
immutable or at least threadsafe. Instances can be
created manually or via a ServiceLoader.
NetTimeConnector,
ServiceLoader| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT
Default timeout is
60 seconds. |
| Modifier and Type | Method and Description |
|---|---|
int |
getClockShiftWindow()
Determines the time window within which an existing shift between
the local clock and the internet clock will be synchronized (after
a successful connection) if the local clock is too quick.
|
int |
getConnectionTimeout()
Determines the maximum time out when connecting to an internet
time server.
|
String |
getTimeServerAddress()
Yields the internet address of a time server.
|
int |
getTimeServerPort()
Yields the port of a time server.
|
static final int DEFAULT_CONNECTION_TIMEOUT
Default timeout is 60 seconds.
String getTimeServerAddress()
Yields the internet address of a time server.
Possible values are also addresses of older time servers which still support the elder protocol (RFC 867), for example:
Alternatively, addresses of modern NTP-servers are permitted which support the protocols NTP3 or NTP4:
int getTimeServerPort()
Yields the port of a time server.
The DAYTIME-protocol assumes as default value 13 while
NTP-protocols usually use the value 123.
int getConnectionTimeout()
Determines the maximum time out when connecting to an internet time server.
The value 0 indicates an unlimited waiting time. The
default value is internally 60 seconds.
>= 0DEFAULT_CONNECTION_TIMEOUTint getClockShiftWindow()
Determines the time window within which an existing shift between the local clock and the internet clock will be synchronized (after a successful connection) if the local clock is too quick.
The value 0 causes the immediate synchronization and is the
default. Else the local clock will only be synchronized with the
internet clock after this clock shift window has been passed. Within
this time window the local clock will be slowly adjusted to the internet
clock. The time window should always be choosen such that it is smaller
than the time between two connections. Its main purpose is slowing
down a local clock such that applications will not notice any
backwards running time within the scope of expected precision.
If the local clock is too slow however then the synchronization will happen immediately, and this configuration parameter is not applied.
>= 0)Copyright © 2014–2016. All rights reserved.