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.
|
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.
|
public TimeInfo(NtpV3Packet message, long returnTime)
message
- NTP message packetreturnTime
- destination receive timeIllegalArgumentException
- 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 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, 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
- public void computeDetails()
public List<String> getComments()
public Long getDelay()
public Long getOffset()
public NtpV3Packet getMessage()
public long getReturnTime()
Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.