Class NetworkTimeServer
java.lang.Object
org.episteme.social.history.clock.TimeServer
org.episteme.social.history.clock.NetworkTimeServer
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 Summary
ConstructorsConstructorDescriptionNetworkTimeServer(String host) Creates a new NetworkTimeServer for the specified pool.NetworkTimeServer(String host, long poolIntervalMs) Creates a new NetworkTimeServer with custom host and interval. -
Method Summary
Methods inherited from class TimeServer
addTimeListener, dispatchTimeEvent, getTimeListeners, removeTimeListener
-
Constructor Details
-
NetworkTimeServer
Creates a new NetworkTimeServer for the specified pool.- Parameters:
host- the NTP server hostname (e.g., "pool.ntp.org")
-
NetworkTimeServer
Creates a new NetworkTimeServer with custom host and interval.- Parameters:
host- hostnamepoolIntervalMs- polling frequency- Throws:
NullPointerException- if host is null
-
-
Method Details
-
start
public void start()Description copied from class:TimeServerActivates the time server, initiating update broadcasts.- Specified by:
startin classTimeServer
-
stop
public void stop()Description copied from class:TimeServerDeactivates the time server, halting all broadcasts.- Specified by:
stopin classTimeServer
-
getHost
-