Interface SntpConfiguration
- All Superinterfaces:
NetTimeConfiguration
Represents a configuration for a connection to a NTP-Server.
Implementations of this SPI-interface must be
immutable or at least threadsafe. Instances can be
created manually or via a ServiceLoader
.
Note: All implementations must have a public no-arg constructor.
- Since:
- 2.1
- Author:
- Meno Hochschild
- See Also:
ServiceLoader
-
Field Summary
Fields inherited from interface net.time4j.clock.NetTimeConfiguration
DEFAULT_CONNECTION_TIMEOUT
-
Method Summary
Modifier and TypeMethodDescriptionshort
Determines how often a SNTP-Client will send queries during a connection for the purpose of the calculation of an arithmetic mean value.int
Determines the rate by which a SNTP-client sends queries during a connection for the purpose of the calculation of an arithmetic mean value.boolean
isNTP4()
Determines if NTP3 or NTP4 should be used.Methods inherited from interface net.time4j.clock.NetTimeConfiguration
getClockShiftWindow, getConnectionTimeout, getTimeServerAddress, getTimeServerPort
-
Method Details
-
isNTP4
boolean isNTP4()Determines if NTP3 or NTP4 should be used.
- Returns:
true
if NTP4 shall be used elsefalse
- Since:
- 2.1
-
getRequestInterval
int getRequestInterval()Determines the rate by which a SNTP-client sends queries during a connection for the purpose of the calculation of an arithmetic mean value.
Default value is
60 * 4
(that is 4 minutes). This method is only relevant ifgetRequestCount()
yields at least the value2
. One single connection request can contain several queries this way. Note that some servers will block requests if they happen too often.- Returns:
- time distance between two messages in seconds as positive number
- Since:
- 2.1
-
getRequestCount
short getRequestCount()Determines how often a SNTP-Client will send queries during a connection for the purpose of the calculation of an arithmetic mean value.
Default value is
1
(single query). The value0
is also permitted and effectively stops any query. If any bigger value (> 1
) is configured then an asynchronous connection to the NTP-server is recommended. One single connection request can contain several queries this way. Note that some servers will block requests if they happen too often.- Returns:
- number in range
0 <= x < 1000
- Since:
- 2.1
- See Also:
NetTimeConnector.connect()
-