| java.lang.Object org.apache.commons.net.ntp.TimeInfo
TimeInfo | public class TimeInfo (Code) | | Wrapper class to network time packet messages (NTP, etc) that computes
related timing info and stats.
author: Jason Mathews, MITRE Corp version: $Revision: 165675 $ $Date: 2005-05-02 15:09:55 -0500 (Mon, 02 May 2005) $ |
Constructor Summary | |
public | TimeInfo(NtpV3Packet message, long returnTime) Create TimeInfo object with raw packet message and destination time received. | public | TimeInfo(NtpV3Packet message, long returnTime, List comments) Create TimeInfo object with raw packet message and destination time received. | public | TimeInfo(NtpV3Packet msgPacket, long returnTime, boolean doComputeDetails) Create TimeInfo object with raw packet message and destination time received.
Auto-computes details if computeDetails flag set otherwise this is delayed
until computeDetails() is called. | public | TimeInfo(NtpV3Packet message, long returnTime, List comments, boolean doComputeDetails) Create TimeInfo object with raw packet message and destination time received.
Auto-computes details if computeDetails flag set otherwise this is delayed
until computeDetails() is called. |
Method Summary | |
public void | addComment(String comment) Add comment (error/warning) to list of comments associated
with processing of NTP parameters. | public void | computeDetails() Compute and validate details of the NTP message packet. | public List | getComments() Return list of comments (if any) during processing of NTP packet. | public Long | getDelay() Get round-trip network delay. | public NtpV3Packet | getMessage() Returns NTP message packet. | public Long | getOffset() Get clock offset needed to adjust local clock to match remote clock. | public long | getReturnTime() Returns time at which time message packet was received by local machine. |
TimeInfo | public TimeInfo(NtpV3Packet message, long returnTime)(Code) | | Create TimeInfo object with raw packet message and destination time received.
Parameters: message - NTP message packet Parameters: returnTime - destination receive time throws: IllegalArgumentException - if message is null |
TimeInfo | public TimeInfo(NtpV3Packet message, long returnTime, List comments)(Code) | | Create TimeInfo object with raw packet message and destination time received.
Parameters: message - NTP message packet Parameters: returnTime - destination receive time Parameters: comments - List of errors/warnings identified during processing throws: IllegalArgumentException - if message is null |
TimeInfo | public TimeInfo(NtpV3Packet msgPacket, long returnTime, boolean doComputeDetails)(Code) | | Create TimeInfo object with raw packet message and destination time received.
Auto-computes details if computeDetails flag set otherwise this is delayed
until computeDetails() is called. Delayed computation is for fast
intialization when sub-millisecond timing is needed.
Parameters: msgPacket - NTP message packet Parameters: returnTime - destination receive time Parameters: doComputeDetails - flag to pre-compute delay/offset values throws: IllegalArgumentException - if message is null |
TimeInfo | public TimeInfo(NtpV3Packet message, long returnTime, List comments, boolean doComputeDetails)(Code) | | Create TimeInfo object with raw packet message and destination time received.
Auto-computes details if computeDetails flag set otherwise this is delayed
until computeDetails() is called. Delayed computation is for fast
intialization when sub-millisecond timing is needed.
Parameters: message - NTP message packet Parameters: returnTime - destination receive time Parameters: comments - list of comments used to store errors/warnings with message Parameters: doComputeDetails - flag to pre-compute delay/offset values throws: IllegalArgumentException - if message is null |
addComment | public void addComment(String comment)(Code) | | Add comment (error/warning) to list of comments associated
with processing of NTP parameters. If comment list not create
then one will be created.
Parameters: comment - |
computeDetails | public void computeDetails()(Code) | | Compute and validate details of the NTP message packet. Computed
fields include the offset and delay.
|
getComments | public List getComments()(Code) | | Return list of comments (if any) during processing of NTP packet.
List or null if not yet computed |
getDelay | public Long getDelay()(Code) | | Get round-trip network delay. If null then could not compute the delay.
Long or null if delay not available. |
getMessage | public NtpV3Packet getMessage()(Code) | | Returns NTP message packet.
NTP message packet. |
getOffset | public Long getOffset()(Code) | | Get clock offset needed to adjust local clock to match remote clock. If null then could not
compute the offset.
Long or null if offset not available. |
getReturnTime | public long getReturnTime()(Code) | | Returns time at which time message packet was received by local machine.
packet return time. |
|
|