public class TimeInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
_comments |
private java.lang.Long |
_delay |
private boolean |
_detailsComputed
flag indicating that the TimeInfo details was processed and delay/offset were computed
|
private NtpV3Packet |
_message |
private java.lang.Long |
_offset |
private long |
_returnTime
time at which time message packet was received by local machine
|
Constructor and Description |
---|
TimeInfo(NtpV3Packet message,
long returnTime)
Create TimeInfo object with raw packet message and destination time received.
|
TimeInfo(NtpV3Packet msgPacket,
long returnTime,
boolean doComputeDetails)
Create TimeInfo object with raw packet message and destination time received.
|
TimeInfo(NtpV3Packet message,
long returnTime,
java.util.List<java.lang.String> comments)
Create TimeInfo object with raw packet message and destination time received.
|
TimeInfo(NtpV3Packet message,
long returnTime,
java.util.List<java.lang.String> comments,
boolean doComputeDetails)
Create TimeInfo object with raw packet message and destination time received.
|
Modifier and Type | Method and Description |
---|---|
void |
addComment(java.lang.String comment)
Add comment (error/warning) to list of comments associated
with processing of NTP parameters.
|
void |
computeDetails()
Compute and validate details of the NTP message packet.
|
boolean |
equals(java.lang.Object obj)
Compares this object against the specified object.
|
java.net.InetAddress |
getAddress()
Get host address from message datagram if available
|
java.util.List<java.lang.String> |
getComments()
Return list of comments (if any) during processing of NTP packet.
|
java.lang.Long |
getDelay()
Get round-trip network delay.
|
NtpV3Packet |
getMessage()
Returns NTP message packet.
|
java.lang.Long |
getOffset()
Get clock offset needed to adjust local clock to match remote clock.
|
long |
getReturnTime()
Returns time at which time message packet was received by local machine.
|
int |
hashCode()
Computes a hashcode for this object.
|
private final NtpV3Packet _message
private java.util.List<java.lang.String> _comments
private java.lang.Long _delay
private java.lang.Long _offset
private final long _returnTime
private boolean _detailsComputed
public TimeInfo(NtpV3Packet message, long returnTime)
message
- NTP message packetreturnTime
- destination receive timejava.lang.IllegalArgumentException
- if message is nullpublic TimeInfo(NtpV3Packet message, long returnTime, java.util.List<java.lang.String> comments)
message
- NTP message packetreturnTime
- destination receive timecomments
- List of errors/warnings identified during processingjava.lang.IllegalArgumentException
- if message is nullpublic TimeInfo(NtpV3Packet msgPacket, long returnTime, boolean doComputeDetails)
msgPacket
- NTP message packetreturnTime
- destination receive timedoComputeDetails
- flag to pre-compute delay/offset valuesjava.lang.IllegalArgumentException
- if message is nullpublic TimeInfo(NtpV3Packet message, long returnTime, java.util.List<java.lang.String> comments, boolean doComputeDetails)
message
- NTP message packetreturnTime
- destination receive timecomments
- list of comments used to store errors/warnings with messagedoComputeDetails
- flag to pre-compute delay/offset valuesjava.lang.IllegalArgumentException
- if message is nullpublic void addComment(java.lang.String comment)
comment
- the commentpublic void computeDetails()
public java.util.List<java.lang.String> getComments()
public java.lang.Long getDelay()
public java.lang.Long getOffset()
public NtpV3Packet getMessage()
public java.net.InetAddress getAddress()
public long getReturnTime()
public boolean equals(java.lang.Object obj)
true
if and only if the argument is
not null
and is a TimeStamp
object that
contains the same values as this object.equals
in class java.lang.Object
obj
- the object to compare with.true
if the objects are the same;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object