Package org.apache.commons.net.ntp
Class NtpUtils
java.lang.Object
org.apache.commons.net.ntp.NtpUtils
Common NtpUtils Helper class.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringgetHostAddress(int address) Returns 32-bit integer address to IPv4 address string "%d.%d.%d.%d" format.static StringgetModeName(int mode) Return human-readable name of message mode type (RFC 1305).static StringgetRefAddress(NtpV3Packet packet) Returns NTP packet reference identifier as IP address.static StringgetReferenceClock(NtpV3Packet message) Gets refId as reference clock string (e.g.
- 
Constructor Details- 
NtpUtilspublic NtpUtils()
 
- 
- 
Method Details- 
getHostAddressReturns 32-bit integer address to IPv4 address string "%d.%d.%d.%d" format.- Parameters:
- address- the 32-bit address
- Returns:
- the raw IP address in a string format.
 
- 
getModeNameReturn human-readable name of message mode type (RFC 1305).- Parameters:
- mode- the mode type
- Returns:
- mode name
 
- 
getRefAddressReturns NTP packet reference identifier as IP address.- Parameters:
- packet- NTP packet
- Returns:
- the packet reference id (as IP address) in "%d.%d.%d.%d" format.
 
- 
getReferenceClockGets refId as reference clock string (e.g. GPS, WWV, LCL). If string is invalid (non-ASCII character) then returns empty string "". For details refer to the Comprehensive List of Clock Drivers.- Parameters:
- message- the message to check
- Returns:
- reference clock string if primary NTP server
 
 
-