Class NetworkTimeServer

java.lang.Object
org.episteme.social.history.clock.TimeServer
org.episteme.social.history.clock.NetworkTimeServer

public class NetworkTimeServer extends TimeServer
A time server that synchronizes with a network source (e.g., NTP server). Periodically fetches time from the specified host and notifies listeners. * @version 1.1
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • NetworkTimeServer

      public NetworkTimeServer(String host)
      Creates a new NetworkTimeServer for the specified pool.
      Parameters:
      host - the NTP server hostname (e.g., "pool.ntp.org")
    • NetworkTimeServer

      public NetworkTimeServer(String host, long poolIntervalMs)
      Creates a new NetworkTimeServer with custom host and interval.
      Parameters:
      host - hostname
      poolIntervalMs - polling frequency
      Throws:
      NullPointerException - if host is null
  • Method Details

    • start

      public void start()
      Description copied from class: TimeServer
      Activates the time server, initiating update broadcasts.
      Specified by:
      start in class TimeServer
    • stop

      public void stop()
      Description copied from class: TimeServer
      Deactivates the time server, halting all broadcasts.
      Specified by:
      stop in class TimeServer
    • getHost

      public String getHost()
      Returns the target synchronization host.
      Returns:
      hostname