net.i2p.router.time

## Class RouterTimestamper

- java.lang.Object
- - net.i2p.time.Timestamper
  - - net.i2p.router.time.RouterTimestamper

- All Implemented Interfaces:
    Runnable

      public class RouterTimestamper
      extends Timestamper

  Periodically query a series of NTP servers and update any associated listeners. It tries the NTP servers in order, contacting them using SNTP (UDP port 123).

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.i2p.time.Timestamper

      `Timestamper.UpdateListener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROP_CONCURRING_SERVERS`
    `static String` | `PROP_DISABLED`
    `static String` | `PROP_IP_COUNTRY`
    `static String` | `PROP_QUERY_FREQUENCY`
    `static String` | `PROP_SERVER_LIST`

  - ### Constructor Summary

    Constructors
    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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(Timestamper.UpdateListener lsnr)`
    `boolean` | `getIsDisabled()`
    `Timestamper.UpdateListener` | `getListener(int index)`
    `int` | `getListenerCount()`
    `int` | `getQueryFrequencyMs()`
    `String` | `getServer(int index)`
    `int` | `getServerCount()`
    `void` | `removeListener(Timestamper.UpdateListener lsnr)`
    `void` | `run()` dummy
    `void` | `startTimestamper()`
    `void` | `timestampNow()` Update the time immediately.
    `void` | `waitForInitialization()` dummy

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROP_CONCURRING_SERVERS

          public static final String PROP_CONCURRING_SERVERS

      See Also:
        Constant Field Values

    - #### PROP_DISABLED

          public static final String PROP_DISABLED

      See Also:
        Constant Field Values

    - #### PROP_IP_COUNTRY

          public static final String PROP_IP_COUNTRY

      See Also:
        Constant Field Values

    - #### PROP_QUERY_FREQUENCY

          public static final String PROP_QUERY_FREQUENCY

      See Also:
        Constant Field Values

    - #### PROP_SERVER_LIST

          public static final String PROP_SERVER_LIST

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RouterTimestamper

          public RouterTimestamper(I2PAppContext ctx)

      Does not start. Caller MUST call startTimestamper()

    - #### RouterTimestamper

          public RouterTimestamper(I2PAppContext ctx,
                                   Timestamper.UpdateListener lsnr)

      Does not start. Caller MUST call startTimestamper()

    - #### RouterTimestamper

          public RouterTimestamper(I2PAppContext ctx,
                                   Timestamper.UpdateListener lsnr,
                                   boolean daemon)

      Does not start. Caller MUST call startTimestamper()

  - ### Method Detail

    - #### addListener

          public void addListener(Timestamper.UpdateListener lsnr)

    - #### getIsDisabled

          public boolean getIsDisabled()

    - #### getListener

          public Timestamper.UpdateListener getListener(int index)

    - #### getListenerCount

          public int getListenerCount()

    - #### getQueryFrequencyMs

          public int getQueryFrequencyMs()

    - #### getServer

          public String getServer(int index)

    - #### getServerCount

          public int getServerCount()

    - #### removeListener

          public void removeListener(Timestamper.UpdateListener lsnr)

    - #### run

          public void run()

      Description copied from class: `Timestamper`
      dummy
      Specified by:
        `run` in interface `Runnable`
      Overrides:
        `run` in class `Timestamper`

    - #### startTimestamper

          public void startTimestamper()

    - #### timestampNow

          public void timestampNow()

      Update the time immediately.
      Overrides:
        `timestampNow` in class `Timestamper`

    - #### waitForInitialization

          public void waitForInitialization()

      Description copied from class: `Timestamper`
      dummy
      Overrides:
        `waitForInitialization` in class `Timestamper`