public class RouterTimestamper extends Timestamper
Timestamper.UpdateListener| Modifier and Type | Field and Description |
|---|---|
static String | PROP_CONCURRING_SERVERSPROP_CONCURRING_SERVERS. |
static String | PROP_DISABLEDPROP_DISABLED. |
static String | PROP_IP_COUNTRYPROP_IP_COUNTRY. |
static String | PROP_QUERY_FREQUENCYPROP_QUERY_FREQUENCY. |
static String | PROP_SERVER_LISTPROP_SERVER_LIST. |
| Constructor and Description |
|---|
RouterTimestamper(I2PAppContext ctx)Does not start. |
RouterTimestamper(I2PAppContext ctx,
Timestamper.UpdateListener lsnr)Does not start. |
RouterTimestamper(I2PAppContext ctx,
Timestamper.UpdateListener lsnr,
boolean daemon)Does not start. |
| Modifier and Type | Method and Description |
|---|---|
void | addListener(Timestamper.UpdateListener lsnr)Register a listener to be notified of time updates. |
boolean | getIsDisabled()Whether NTP is disabled. |
Timestamper.UpdateListener | getListener(int index)Time update listener at the given index. |
int | getListenerCount()Number of registered time update listeners. |
int | getQueryFrequencyMs()How often to query the NTP servers, in ms. |
String | getServer(int index)NTP server at the given index in the configured list. |
int | getServerCount()Number of NTP servers in the configured list. |
void | removeListener(Timestamper.UpdateListener lsnr)Unregister a listener from time update notifications. |
void | run()Run the main SNTP query loop, updating the time periodically. |
void | startTimestamper()Start the SNTP query thread, unless disabled or already initialized. |
void | timestampNow()Update the time immediately. |
void | waitForInitialization()Wait until the initial time synchronization completes, or the timeout is reached. |
public static final String PROP_CONCURRING_SERVERS
public static final String PROP_DISABLED
public static final String PROP_IP_COUNTRY
public static final String PROP_QUERY_FREQUENCY
public static final String PROP_SERVER_LIST
public RouterTimestamper(I2PAppContext ctx)
public RouterTimestamper(I2PAppContext ctx, Timestamper.UpdateListener lsnr)
public RouterTimestamper(I2PAppContext ctx, Timestamper.UpdateListener lsnr, boolean daemon)
public void addListener(Timestamper.UpdateListener lsnr)
public boolean getIsDisabled()
public Timestamper.UpdateListener getListener(int index)
public int getListenerCount()
public int getQueryFrequencyMs()
public String getServer(int index)
public int getServerCount()
public void removeListener(Timestamper.UpdateListener lsnr)
public void run()
run in interface Runnablerun in class Timestamperpublic void startTimestamper()
public void timestampNow()
timestampNow in class Timestamperpublic void waitForInitialization()
waitForInitialization in class Timestamper