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.
    Version:
    $Revision: 1652868 $
    • Method Detail

      • getDatagramPacket

        java.net.DatagramPacket getDatagramPacket()
        Returns:
        a datagram packet with the NTP parts already filled in
      • setDatagramPacket

        void setDatagramPacket​(java.net.DatagramPacket dp)
        Set the contents of this object from the datagram packet
        Parameters:
        dp - the packet
      • getLeapIndicator

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

        void setLeapIndicator​(int li)
        Set leap indicator.
        Parameters:
        li - - leap indicator code
      • getMode

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

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

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

        int getPoll()
        Returns:
        poll interval as defined in RFC-1305. Field range between NTP_MINPOLL and NTP_MAXPOLL.
      • 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
      • getPrecision

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

        void setPrecision​(int precision)
        Set precision as defined in RFC-1305
        Parameters:
        precision - Precision
        Since:
        3.4
      • getRootDelay

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

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

        double getRootDelayInMillisDouble()
        Returns:
        root delay in milliseconds
      • getRootDispersion

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

        void setRootDispersion​(int dispersion)
        Parameters:
        dispersion - the value to set
        Since:
        3.4
      • getRootDispersionInMillis

        long getRootDispersionInMillis()
        Returns:
        root dispersion in milliseconds
      • getRootDispersionInMillisDouble

        double getRootDispersionInMillisDouble()
        Returns:
        root dispersion in milliseconds
      • getVersion

        int getVersion()
        Returns:
        version as defined in RFC-1305
      • setVersion

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

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

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

        java.lang.String getReferenceIdString()
        Returns:
        the reference id string
      • getReferenceId

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

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

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

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

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

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

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

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

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

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

        java.lang.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