Package 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
  Description
  `static final int`
  `LI_ALARM_CONDITION`
  `static final int`
  `LI_LAST_MINUTE_HAS_59_SECONDS`
  `static final int`
  `LI_LAST_MINUTE_HAS_61_SECONDS`
  `static final int`
  `LI_NO_WARNING`
  `static final int`
  `MODE_BROADCAST`
  Mode option 5.
  `static final int`
  `MODE_CLIENT`
  Mode option 3.
  `static final int`
  `MODE_CONTROL_MESSAGE`
  Mode option 6.
  `static final int`
  `MODE_PRIVATE`
  Mode option 7.
  `static final int`
  `MODE_RESERVED`
  Mode option 0.
  `static final int`
  `MODE_SERVER`
  Mode option 4.
  `static final int`
  `MODE_SYMMETRIC_ACTIVE`
  Mode option 1.
  `static final int`
  `MODE_SYMMETRIC_PASSIVE`
  Mode option 2.
  `static final int`
  `NTP_MAXCLOCK`
  `static final int`
  `NTP_MAXPOLL`
  `static final int`
  `NTP_MINCLOCK`
  `static final int`
  `NTP_MINPOLL`
  `static final int`
  `NTP_PORT`
  Standard NTP UDP port
  `static final String`
  `TYPE_DAYTIME`
  `static final String`
  `TYPE_ICMP`
  `static final String`
  `TYPE_NTP`
  `static final String`
  `TYPE_TIME`
  `static final int`
  `VERSION_3`
  `static final int`
  `VERSION_4`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DatagramPacket`
  `getDatagramPacket()`
  `int`
  `getLeapIndicator()`
  `int`
  `getMode()`
  `String`
  `getModeName()`
  `TimeStamp`
  `getOriginateTimeStamp()`
  `int`
  `getPoll()`
  `int`
  `getPrecision()`
  `TimeStamp`
  `getReceiveTimeStamp()`
  `int`
  `getReferenceId()`
  `String`
  `getReferenceIdString()`
  `TimeStamp`
  `getReferenceTimeStamp()`
  `int`
  `getRootDelay()`
  `double`
  `getRootDelayInMillisDouble()`
  `int`
  `getRootDispersion()`
  `long`
  `getRootDispersionInMillis()`
  `double`
  `getRootDispersionInMillisDouble()`
  `int`
  `getStratum()`
  `TimeStamp`
  `getTransmitTimeStamp()`
  `String`
  `getType()`
  Return type of time packet.
  `int`
  `getVersion()`
  `void`
  `setDatagramPacket(DatagramPacket dp)`
  Set the contents of this object from the datagram packet
  `void`
  `setLeapIndicator(int li)`
  Set leap indicator.
  `void`
  `setMode(int mode)`
  Set mode as defined in RFC-1305
  `void`
  `setOriginateTimeStamp(TimeStamp ts)`
  Set originate timestamp given NTP TimeStamp object.
  `void`
  `setPoll(int poll)`
  Set poll interval as defined in RFC-1305.
  `void`
  `setPrecision(int precision)`
  Set precision as defined in RFC-1305
  `void`
  `setReceiveTimeStamp(TimeStamp ts)`
  Set receive timestamp given NTP TimeStamp object.
  `void`
  `setReferenceId(int refId)`
  Set reference clock identifier field.
  `void`
  `setReferenceTime(TimeStamp ts)`
  Set the reference timestamp given NTP TimeStamp object.
  `void`
  `setRootDelay(int delay)`
  Set root delay as defined in RFC-1305
  `void`
  `setRootDispersion(int dispersion)`
  `void`
  `setStratum(int stratum)`
  Set stratum as defined in RFC-1305
  `void`
  `setTransmitTime(TimeStamp ts)`
  Set the `transmit` timestamp given NTP TimeStamp object.
  `void`
  `setVersion(int version)`
  Set version as defined in RFC-1305

- ## Field Details

  - ### NTP_PORT

    static final int NTP_PORT
    Standard NTP UDP port
    See Also:
      - Constant Field Values

  - ### LI_NO_WARNING

    static final int LI_NO_WARNING
    See Also:
      - Constant Field Values

  - ### LI_LAST_MINUTE_HAS_61_SECONDS

    static final int LI_LAST_MINUTE_HAS_61_SECONDS
    See Also:
      - Constant Field Values

  - ### LI_LAST_MINUTE_HAS_59_SECONDS

    static final int LI_LAST_MINUTE_HAS_59_SECONDS
    See Also:
      - Constant Field Values

  - ### LI_ALARM_CONDITION

    static final int LI_ALARM_CONDITION
    See Also:
      - Constant Field Values

  - ### MODE_RESERVED

    static final int MODE_RESERVED
    Mode option 0.
    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

  - ### MODE_CLIENT

    static final int MODE_CLIENT
    Mode option 3.
    See Also:
      - Constant Field Values

  - ### MODE_SERVER

    static final int MODE_SERVER
    Mode option 4.
    See Also:
      - Constant Field Values

  - ### MODE_BROADCAST

    static final int MODE_BROADCAST
    Mode option 5.
    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

  - ### NTP_MINPOLL

    static final int NTP_MINPOLL
    See Also:
      - Constant Field Values

  - ### NTP_MAXPOLL

    static final int NTP_MAXPOLL
    See Also:
      - Constant Field Values

  - ### NTP_MINCLOCK

    static final int NTP_MINCLOCK
    See Also:
      - Constant Field Values

  - ### NTP_MAXCLOCK

    static final int NTP_MAXCLOCK
    See Also:
      - Constant Field Values

  - ### VERSION_3

    static final int VERSION_3
    See Also:
      - Constant Field Values

  - ### VERSION_4

    static final int VERSION_4
    See Also:
      - Constant Field Values

  - ### TYPE_NTP

    static final String TYPE_NTP
    See Also:
      - Constant Field Values

  - ### TYPE_ICMP

    static final String TYPE_ICMP
    See Also:
      - Constant Field Values

  - ### TYPE_TIME

    static final String TYPE_TIME
    See Also:
      - Constant Field Values

  - ### TYPE_DAYTIME

    static final String TYPE_DAYTIME
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getDatagramPacket

    DatagramPacket getDatagramPacket()
    Returns:
      a datagram packet with the NTP parts already filled in

  - ### getLeapIndicator

    int getLeapIndicator()
    Returns:
      leap indicator as defined in RFC-1305

  - ### getMode

    int getMode()
    Returns:
      mode as defined in RFC-1305

  - ### getModeName

    String getModeName()
    Returns:
      mode as human readable string; e.g. 3=Client

  - ### getOriginateTimeStamp

    TimeStamp getOriginateTimeStamp()
    Returns:
      the `originate` time as defined in RFC-1305

  - ### getPoll

    int getPoll()
    Returns:
      poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.

  - ### getPrecision

    int getPrecision()
    Returns:
      precision as defined in RFC-1305

  - ### getReceiveTimeStamp

    TimeStamp getReceiveTimeStamp()
    Returns:
      the `receive` time as defined in RFC-1305

  - ### getReferenceId

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

  - ### getReferenceIdString

    String getReferenceIdString()
    Returns:
      the reference id string

  - ### getReferenceTimeStamp

    TimeStamp getReferenceTimeStamp()
    Returns:
      the reference time as defined in RFC-1305

  - ### getRootDelay

    int getRootDelay()
    Returns:
      root delay as defined in RFC-1305

  - ### getRootDelayInMillisDouble

    double getRootDelayInMillisDouble()
    Returns:
      root delay in milliseconds

  - ### getRootDispersion

    int getRootDispersion()
    Returns:
      root dispersion as defined in RFC-1305

  - ### getRootDispersionInMillis

    long getRootDispersionInMillis()
    Returns:
      root dispersion in milliseconds

  - ### getRootDispersionInMillisDouble

    double getRootDispersionInMillisDouble()
    Returns:
      root dispersion in milliseconds

  - ### getStratum

    int getStratum()
    Returns:
      stratum as defined in RFC-1305

  - ### getTransmitTimeStamp

    TimeStamp getTransmitTimeStamp()
    Returns:
      the `transmit` timestamp as defined in RFC-1305

  - ### getType

    String getType()
    Return 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()
    Returns:
      version as defined in RFC-1305

  - ### setDatagramPacket

    void setDatagramPacket(DatagramPacket dp)
    Set the contents of this object from the datagram packet
    Parameters:
      `dp` - the packet

  - ### setLeapIndicator

    void setLeapIndicator(int li)
    Set leap indicator.
    Parameters:
      `li` - - leap indicator code

  - ### setMode

    void setMode(int mode)
    Set mode as defined in RFC-1305
    Parameters:
      `mode` - the mode to set

  - ### setOriginateTimeStamp

    void setOriginateTimeStamp(TimeStamp ts)
    Set originate timestamp given NTP TimeStamp object.
    Parameters:
      `ts` - - timestamp

  - ### setPoll

    void setPoll(int poll)
    Set 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)
    Set precision as defined in RFC-1305
    Parameters:
      `precision` - Precision
    Since:
      3.4

  - ### setReceiveTimeStamp

    void setReceiveTimeStamp(TimeStamp ts)
    Set receive timestamp given NTP TimeStamp object.
    Parameters:
      `ts` - - timestamp

  - ### setReferenceId

    void setReferenceId(int refId)
    Set reference clock identifier field.
    Parameters:
      `refId` - the clock id field to set

  - ### setReferenceTime

    void setReferenceTime(TimeStamp ts)
    Set the reference timestamp given NTP TimeStamp object.
    Parameters:
      `ts` - - timestamp

  - ### setRootDelay

    void setRootDelay(int delay)
    Set root delay as defined in RFC-1305
    Parameters:
      `delay` - the delay to set
    Since:
      3.4

  - ### setRootDispersion

    void setRootDispersion(int dispersion)
    Parameters:
      `dispersion` - the value to set
    Since:
      3.4

  - ### setStratum

    void setStratum(int stratum)
    Set stratum as defined in RFC-1305
    Parameters:
      `stratum` - the stratum to set

  - ### setTransmitTime

    void setTransmitTime(TimeStamp ts)
    Set the `transmit` timestamp given NTP TimeStamp object.
    Parameters:
      `ts` - - timestamp

  - ### setVersion

    void setVersion(int version)
    Set version as defined in RFC-1305
    Parameters:
      `version` - the version to set