quamj.qps.util.ntp
Class NtpInfo

java.lang.Object
  |
  +--quamj.qps.util.ntp.NtpInfo

public class NtpInfo
extends java.lang.Object

This class represents a datastructure describing the useful information that can be extracted from a NtpDatagram returning from the server. Refer to rfc2030 for more details.


Field Summary
 int leapYearIndicator
          Leap year indicator.
static byte LI_ALARM_CONDITION
          Alarm condition (clock not synchrinized)
static byte LI_NEGATIVE_LEAP_SECOND
          Last minute has 59 seconds.
static byte LI_NO_WARNING
          No leap second warning.
static byte LI_POSITIVE_LEAP_SECOND
          Last minute has 61 seconds.
 int mode
          Mode of the communication with the server.
static byte MODE_BROADCAST
          Broadcast mode.
static byte MODE_CLIENT
          Client mode.
static byte MODE_RESERVED
          Reserved mode.
static byte MODE_RESERVED_FOR_NTP_CONTROL
          Reserved for NTP control message.
static byte MODE_RESERVED_FOR_PRIVATE_USE
          Reserved for private use.
static byte MODE_RESERVED_PASSIVE
          Symmetric passive mode.
static byte MODE_SERVER
          Server mode.
static byte MODE_SYMMETRIC_ACTIVE
          Symmetric active mode.
 long offset
          Offset of the local clock versus the server clock, taking into account the roundtrip delay (in milliseconds).
 int pollInterval
          Poll Interval in seconds.
 double precision
          Precision of the server clock (in milliseconds).
 java.lang.Object referenceIdentifier
          Reference Identifier.
 TimeStamp referenceTimeStamp
          Reference timestamp.
 double rootDelay
          Total roundtrip delay from the server to the primary server (in milliseconds).
 double rootDispersion
          Nominal error error relative to the primary reference source (in milliseconds).
 long roundTripDelay
          Roundtrip delay (in milliseconds).
 java.net.InetAddress serverAddress
          InetAddress of the server.
 int stratum
          The stratum.
static byte STRATUM_PRIMARY_REFERENCE
          Primary reference.
static byte STRATUM_UNSPECIFIED
          Unspecified or unavailable stratum.
 int versionNumber
          Version number of the packet.
 
Constructor Summary
NtpInfo()
           
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LI_NO_WARNING

public static final byte LI_NO_WARNING
No leap second warning.

See Also:
Constant Field Values

LI_POSITIVE_LEAP_SECOND

public static final byte LI_POSITIVE_LEAP_SECOND
Last minute has 61 seconds.

See Also:
Constant Field Values

LI_NEGATIVE_LEAP_SECOND

public static final byte LI_NEGATIVE_LEAP_SECOND
Last minute has 59 seconds.

See Also:
Constant Field Values

LI_ALARM_CONDITION

public static final byte LI_ALARM_CONDITION
Alarm condition (clock not synchrinized)

See Also:
Constant Field Values

MODE_RESERVED

public static final byte MODE_RESERVED
Reserved mode.

See Also:
Constant Field Values

MODE_SYMMETRIC_ACTIVE

public static final byte MODE_SYMMETRIC_ACTIVE
Symmetric active mode.

See Also:
Constant Field Values

MODE_RESERVED_PASSIVE

public static final byte MODE_RESERVED_PASSIVE
Symmetric passive mode.

See Also:
Constant Field Values

MODE_CLIENT

public static final byte MODE_CLIENT
Client mode.

See Also:
Constant Field Values

MODE_SERVER

public static final byte MODE_SERVER
Server mode.

See Also:
Constant Field Values

MODE_BROADCAST

public static final byte MODE_BROADCAST
Broadcast mode.

See Also:
Constant Field Values

MODE_RESERVED_FOR_NTP_CONTROL

public static final byte MODE_RESERVED_FOR_NTP_CONTROL
Reserved for NTP control message.

See Also:
Constant Field Values

MODE_RESERVED_FOR_PRIVATE_USE

public static final byte MODE_RESERVED_FOR_PRIVATE_USE
Reserved for private use.

See Also:
Constant Field Values

STRATUM_UNSPECIFIED

public static final byte STRATUM_UNSPECIFIED
Unspecified or unavailable stratum.

See Also:
Constant Field Values

STRATUM_PRIMARY_REFERENCE

public static final byte STRATUM_PRIMARY_REFERENCE
Primary reference.

See Also:
Constant Field Values

serverAddress

public java.net.InetAddress serverAddress
InetAddress of the server.


leapYearIndicator

public int leapYearIndicator
Leap year indicator.


versionNumber

public int versionNumber
Version number of the packet. In this application we always send version 3 packet to the server. The servers always seem to reply with version 3 packets (and not version 4).


mode

public int mode
Mode of the communication with the server. In our application this is MODE_CLIENT for the client and MODE_SERVER for the server.


stratum

public int stratum
The stratum. This number indicates the distance (in hops) from the server to the primary server (which is stratum 1).


pollInterval

public int pollInterval
Poll Interval in seconds. See rfc2030


precision

public double precision
Precision of the server clock (in milliseconds).


rootDelay

public double rootDelay
Total roundtrip delay from the server to the primary server (in milliseconds).


rootDispersion

public double rootDispersion
Nominal error error relative to the primary reference source (in milliseconds).


referenceIdentifier

public java.lang.Object referenceIdentifier
Reference Identifier.


referenceTimeStamp

public TimeStamp referenceTimeStamp
Reference timestamp. Indicates when the server clock was last set.


roundTripDelay

public long roundTripDelay
Roundtrip delay (in milliseconds). Calculated according to rfc2030.


offset

public long offset
Offset of the local clock versus the server clock, taking into account the roundtrip delay (in milliseconds). Calculated according to rfc2030.

Constructor Detail

NtpInfo

public NtpInfo()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object