Interface SntpConfiguration

All Superinterfaces:
NetTimeConfiguration

public interface SntpConfiguration extends 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
  • Method Details

    • isNTP4

      boolean isNTP4()

      Determines if NTP3 or NTP4 should be used.

      Returns:
      true if NTP4 shall be used else false
      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 if getRequestCount() yields at least the value 2. 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 value 0 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()