org.apache.commons.net.ntp

## Interface NtpV3Packet

- All Known Implementing Classes:
    NtpV3Impl

      public interface NtpV3Packet

  Interface for a NtpV3Packet with get/set methods corresponding to the fields in the NTP Data Message Header described in RFC 1305.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `LI_ALARM_CONDITION` 3
    `static int` | `LI_LAST_MINUTE_HAS_59_SECONDS` 2
    `static int` | `LI_LAST_MINUTE_HAS_61_SECONDS` 1
    `static int` | `LI_NO_WARNING` 0
    `static int` | `MODE_BROADCAST` Mode option 5.
    `static int` | `MODE_CLIENT` Mode option 3.
    `static int` | `MODE_CONTROL_MESSAGE` Mode option 6.
    `static int` | `MODE_PRIVATE` Mode option 7.
    `static int` | `MODE_RESERVED` Mode option 0.
    `static int` | `MODE_SERVER` Mode option 4.
    `static int` | `MODE_SYMMETRIC_ACTIVE` Mode option 1.
    `static int` | `MODE_SYMMETRIC_PASSIVE` Mode option 2.
    `static int` | `NTP_MAXCLOCK` 10
    `static int` | `NTP_MAXPOLL` 14
    `static int` | `NTP_MINCLOCK` 1
    `static int` | `NTP_MINPOLL` 4
    `static int` | `NTP_PORT` Standard NTP UDP port
    `static String` | `TYPE_DAYTIME` "DAYTIME"
    `static String` | `TYPE_ICMP` "ICMP"
    `static String` | `TYPE_NTP` "NTP"
    `static String` | `TYPE_TIME` "TIME"
    `static int` | `VERSION_3` 3
    `static int` | `VERSION_4` 4

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `DatagramPacket` | `getDatagramPacket()` Gets a datagram packet with the NTP parts already filled in.
    `int` | `getLeapIndicator()` Gets the leap indicator as defined in RFC-1305.
    `int` | `getMode()` Gets the mode as defined in RFC-1305.
    `String` | `getModeName()` Gets the mode as human readable string; for example, 3=Client.
    `TimeStamp` | `getOriginateTimeStamp()` Gets the `originate` time as defined in RFC-1305.
    `int` | `getPoll()` Gets the poll interval as defined in RFC-1305.
    `int` | `getPrecision()` Gets the precision as defined in RFC-1305.
    `TimeStamp` | `getReceiveTimeStamp()` Gets the `receive` time as defined in RFC-1305.
    `int` | `getReferenceId()` Gets the reference id (32-bit code) as defined in RFC-1305.
    `String` | `getReferenceIdString()` Gets the reference ID string.
    `TimeStamp` | `getReferenceTimeStamp()` Gets the reference time as defined in RFC-1305.
    `int` | `getRootDelay()` Gets the root delay as defined in RFC-1305.
    `double` | `getRootDelayInMillisDouble()` Gets root delay in milliseconds.
    `int` | `getRootDispersion()` Gets the root dispersion as defined in RFC-1305.
    `long` | `getRootDispersionInMillis()` Gets the the root dispersion in milliseconds.
    `double` | `getRootDispersionInMillisDouble()` Gets the root dispersion in milliseconds.
    `int` | `getStratum()` Gets the stratum as defined in RFC-1305.
    `TimeStamp` | `getTransmitTimeStamp()` Gets the `transmit` timestamp as defined in RFC-1305.
    `String` | `getType()` Gets the type of time packet.
    `int` | `getVersion()` Gets version as defined in RFC-1305.
    `void` | `setDatagramPacket(DatagramPacket dp)` Sets the contents of this object from the datagram packet
    `void` | `setLeapIndicator(int li)` Sets leap indicator.
    `void` | `setMode(int mode)` Sets mode as defined in RFC-1305
    `void` | `setOriginateTimeStamp(TimeStamp ts)` Sets originate timestamp given NTP TimeStamp object.
    `void` | `setPoll(int poll)` Sets poll interval as defined in RFC-1305.
    `void` | `setPrecision(int precision)` Sets precision as defined in RFC-1305
    `void` | `setReceiveTimeStamp(TimeStamp ts)` Sets receive timestamp given NTP TimeStamp object.
    `void` | `setReferenceId(int refId)` Sets reference clock identifier field.
    `void` | `setReferenceTime(TimeStamp ts)` Sets the reference timestamp given NTP TimeStamp object.
    `void` | `setRootDelay(int delay)` Sets root delay as defined in RFC-1305
    `void` | `setRootDispersion(int dispersion)` Sets the dispersion value.
    `void` | `setStratum(int stratum)` Sets stratum as defined in RFC-1305
    `void` | `setTransmitTime(TimeStamp ts)` Sets the `transmit` timestamp given NTP TimeStamp object.
    `void` | `setVersion(int version)` Sets version as defined in RFC-1305

- - ### Field Detail

    - #### LI_ALARM_CONDITION

          static final int LI_ALARM_CONDITION

      3
      See Also:
        Constant Field Values

    - #### LI_LAST_MINUTE_HAS_59_SECONDS

          static final int LI_LAST_MINUTE_HAS_59_SECONDS

      2
      See Also:
        Constant Field Values

    - #### LI_LAST_MINUTE_HAS_61_SECONDS

          static final int LI_LAST_MINUTE_HAS_61_SECONDS

      1
      See Also:
        Constant Field Values

    - #### LI_NO_WARNING

          static final int LI_NO_WARNING

      0
      See Also:
        Constant Field Values

    - #### MODE_BROADCAST

          static final int MODE_BROADCAST

      Mode option 5.
      See Also:
        Constant Field Values

    - #### MODE_CLIENT

          static final int MODE_CLIENT

      Mode option 3.
      See Also:
        Constant Field Values

    - #### MODE_CONTROL_MESSAGE

          static final int MODE_CONTROL_MESSAGE

      Mode option 6.
      See Also:
        Constant Field Values

    - #### MODE_PRIVATE

          static final int MODE_PRIVATE

      Mode option 7.
      See Also:
        Constant Field Values

    - #### MODE_RESERVED

          static final int MODE_RESERVED

      Mode option 0.
      See Also:
        Constant Field Values

    - #### MODE_SERVER

          static final int MODE_SERVER

      Mode option 4.
      See Also:
        Constant Field Values

    - #### MODE_SYMMETRIC_ACTIVE

          static final int MODE_SYMMETRIC_ACTIVE

      Mode option 1.
      See Also:
        Constant Field Values

    - #### MODE_SYMMETRIC_PASSIVE

          static final int MODE_SYMMETRIC_PASSIVE

      Mode option 2.
      See Also:
        Constant Field Values

    - #### NTP_MAXCLOCK

          static final int NTP_MAXCLOCK

      10
      See Also:
        Constant Field Values

    - #### NTP_MAXPOLL

          static final int NTP_MAXPOLL

      14
      See Also:
        Constant Field Values

    - #### NTP_MINCLOCK

          static final int NTP_MINCLOCK

      1
      See Also:
        Constant Field Values

    - #### NTP_MINPOLL

          static final int NTP_MINPOLL

      4
      See Also:
        Constant Field Values

    - #### NTP_PORT

          static final int NTP_PORT

      Standard NTP UDP port
      See Also:
        Constant Field Values

    - #### TYPE_DAYTIME

          static final String TYPE_DAYTIME

      "DAYTIME"
      See Also:
        Constant Field Values

    - #### TYPE_ICMP

          static final String TYPE_ICMP

      "ICMP"
      See Also:
        Constant Field Values

    - #### TYPE_NTP

          static final String TYPE_NTP

      "NTP"
      See Also:
        Constant Field Values

    - #### TYPE_TIME

          static final String TYPE_TIME

      "TIME"
      See Also:
        Constant Field Values

    - #### VERSION_3

          static final int VERSION_3

      3
      See Also:
        Constant Field Values

    - #### VERSION_4

          static final int VERSION_4

      4
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getDatagramPacket

          DatagramPacket getDatagramPacket()

      Gets a datagram packet with the NTP parts already filled in.
      Returns:
        a datagram packet with the NTP parts already filled in.

    - #### getLeapIndicator

          int getLeapIndicator()

      Gets the leap indicator as defined in RFC-1305.
      Returns:
        the leap indicator as defined in RFC-1305.

    - #### getMode

          int getMode()

      Gets the mode as defined in RFC-1305.
      Returns:
        the mode as defined in RFC-1305.

    - #### getModeName

          String getModeName()

      Gets the mode as human readable string; for example, 3=Client.
      Returns:
        the mode as human readable string; for example, 3=Client.

    - #### getOriginateTimeStamp

          TimeStamp getOriginateTimeStamp()

      Gets the `originate` time as defined in RFC-1305.
      Returns:
        the `originate` time as defined in RFC-1305.

    - #### getPoll

          int getPoll()

      Gets the poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.
      Returns:
        the poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.

    - #### getPrecision

          int getPrecision()

      Gets the precision as defined in RFC-1305.
      Returns:
        the precision as defined in RFC-1305.

    - #### getReceiveTimeStamp

          TimeStamp getReceiveTimeStamp()

      Gets the `receive` time as defined in RFC-1305.
      Returns:
        the `receive` time as defined in RFC-1305.

    - #### getReferenceId

          int getReferenceId()

      Gets the reference id (32-bit code) as defined in RFC-1305.
      Returns:
        the reference id (32-bit code) as defined in RFC-1305.

    - #### getReferenceIdString

          String getReferenceIdString()

      Gets the reference ID string.
      Returns:
        the reference ID string.

    - #### getReferenceTimeStamp

          TimeStamp getReferenceTimeStamp()

      Gets the reference time as defined in RFC-1305.
      Returns:
        the reference time as defined in RFC-1305.

    - #### getRootDelay

          int getRootDelay()

      Gets the root delay as defined in RFC-1305.
      Returns:
        the root delay as defined in RFC-1305.

    - #### getRootDelayInMillisDouble

          double getRootDelayInMillisDouble()

      Gets root delay in milliseconds.
      Returns:
        root delay in milliseconds.

    - #### getRootDispersion

          int getRootDispersion()

      Gets the root dispersion as defined in RFC-1305.
      Returns:
        the root dispersion as defined in RFC-1305.

    - #### getRootDispersionInMillis

          long getRootDispersionInMillis()

      Gets the the root dispersion in milliseconds.
      Returns:
        the root dispersion in milliseconds.

    - #### getRootDispersionInMillisDouble

          double getRootDispersionInMillisDouble()

      Gets the root dispersion in milliseconds.
      Returns:
        the root dispersion in milliseconds.

    - #### getStratum

          int getStratum()

      Gets the stratum as defined in RFC-1305.
      Returns:
        the stratum as defined in RFC-1305.

    - #### getTransmitTimeStamp

          TimeStamp getTransmitTimeStamp()

      Gets the `transmit` timestamp as defined in RFC-1305.
      Returns:
        the `transmit` timestamp as defined in RFC-1305.

    - #### getType

          String getType()

      Gets the type of time packet. The values (e.g. NTP, TIME, ICMP, ...) correspond to the protocol used to obtain the timing information.
      Returns:
        packet type string identifier

    - #### getVersion

          int getVersion()

      Gets version as defined in RFC-1305.
      Returns:
        version as defined in RFC-1305.

    - #### setDatagramPacket

          void setDatagramPacket(DatagramPacket dp)

      Sets the contents of this object from the datagram packet
      Parameters:
        `dp` - the packet

    - #### setLeapIndicator

          void setLeapIndicator(int li)

      Sets leap indicator.
      Parameters:
        `li` - leap indicator code

    - #### setMode

          void setMode(int mode)

      Sets mode as defined in RFC-1305
      Parameters:
        `mode` - the mode to set

    - #### setOriginateTimeStamp

          void setOriginateTimeStamp(TimeStamp ts)

      Sets originate timestamp given NTP TimeStamp object.
      Parameters:
        `ts` - timestamp

    - #### setPoll

          void setPoll(int poll)

      Sets poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.
      Parameters:
        `poll` - the interval to set

    - #### setPrecision

          void setPrecision(int precision)

      Sets precision as defined in RFC-1305
      Parameters:
        `precision` - Precision

    - #### setReceiveTimeStamp

          void setReceiveTimeStamp(TimeStamp ts)

      Sets receive timestamp given NTP TimeStamp object.
      Parameters:
        `ts` - timestamp

    - #### setReferenceId

          void setReferenceId(int refId)

      Sets reference clock identifier field.
      Parameters:
        `refId` - the clock id field to set

    - #### setReferenceTime

          void setReferenceTime(TimeStamp ts)

      Sets the reference timestamp given NTP TimeStamp object.
      Parameters:
        `ts` - timestamp

    - #### setRootDelay

          void setRootDelay(int delay)

      Sets root delay as defined in RFC-1305
      Parameters:
        `delay` - the delay to set

    - #### setRootDispersion

          void setRootDispersion(int dispersion)

      Sets the dispersion value.
      Parameters:
        `dispersion` - the value.

    - #### setStratum

          void setStratum(int stratum)

      Sets stratum as defined in RFC-1305
      Parameters:
        `stratum` - the stratum to set

    - #### setTransmitTime

          void setTransmitTime(TimeStamp ts)

      Sets the `transmit` timestamp given NTP TimeStamp object.
      Parameters:
        `ts` - timestamp

    - #### setVersion

          void setVersion(int version)

      Sets version as defined in RFC-1305
      Parameters:
        `version` - the version to set