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.
    • Method Detail

      • getDatagramPacket

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

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

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

        java.lang.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​(java.net.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
        Since:
        3.4
      • 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
        Since:
        3.4
      • setRootDispersion

        void setRootDispersion​(int dispersion)
        Sets the dispersion value.
        Parameters:
        dispersion - the value.
        Since:
        3.4
      • 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