public class TimeInfo extends Object
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,
List<String> comments)
Create TimeInfo object with raw packet message and destination time received.
|
TimeInfo(NtpV3Packet message,
long returnTime,
List<String> comments,
boolean doComputeDetails)
Create TimeInfo object with raw packet message and destination time received.
|
Modifier and Type | Method and Description |
---|---|
void |
addComment(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(Object obj)
Compares this object against the specified object.
|
InetAddress |
getAddress()
Get host address from message datagram if available
|
List<String> |
getComments()
Return list of comments (if any) during processing of NTP packet.
|
Long |
getDelay()
Get round-trip network delay.
|
NtpV3Packet |
getMessage()
Returns NTP message packet.
|
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.
|
public TimeInfo(NtpV3Packet message, long returnTime)
message
- NTP message packetreturnTime
- destination receive timeIllegalArgumentException
- if message is nullpublic TimeInfo(NtpV3Packet msgPacket, long returnTime, boolean doComputeDetails)
msgPacket
- NTP message packetreturnTime
- destination receive timedoComputeDetails
- flag to pre-compute delay/offset valuesIllegalArgumentException
- if message is nullpublic TimeInfo(NtpV3Packet message, long returnTime, List<String> comments)
message
- NTP message packetreturnTime
- destination receive timecomments
- List of errors/warnings identified during processingIllegalArgumentException
- if message is nullpublic TimeInfo(NtpV3Packet message, long returnTime, List<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 valuesIllegalArgumentException
- if message is nullpublic void addComment(String comment)
comment
- the commentpublic void computeDetails()
public boolean equals(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.public InetAddress getAddress()
public List<String> getComments()
public Long getDelay()
public NtpV3Packet getMessage()
public Long getOffset()
public long getReturnTime()