public class NtpUtil extends Object
| Modifier and Type | Field and Description | 
|---|---|
| static String | NTP_ATTEMPTS_PROPERTYProperty to set the NTP attempts. | 
| static int | NTP_DEFAULT_ATTEMPTSDefault NTP attempts. | 
| static int | NTP_DEFAULT_PORTDefault ntp port. | 
| static String | NTP_DEFAULT_SERVERDefault NTP url. | 
| static int | NTP_DEFAULT_TIMEOUTDefault NTP timeout. | 
| static String | NTP_PORT_PROPERTYProperty to set the NTP port. | 
| static String | NTP_TIMEOUT_PROPERTYProperty to set the NTP timeout. | 
| static String | NTP_URL_PROPERTYProperty to set the NTP URL. | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | updateLocalTime()Updates the local time. | 
| static void | updateLocalTime(String url,
               int port,
               int timeout)Updates the local time. | 
public static final String NTP_ATTEMPTS_PROPERTY
public static final int NTP_DEFAULT_ATTEMPTS
public static final int NTP_DEFAULT_PORT
public static final String NTP_DEFAULT_SERVER
public static final int NTP_DEFAULT_TIMEOUT
public static final String NTP_PORT_PROPERTY
public static final String NTP_TIMEOUT_PROPERTY
public static final String NTP_URL_PROPERTY
public static void updateLocalTime()
                            throws IOException
IOException - if an error occurred.public static void updateLocalTime(String url, int port, int timeout) throws IOException
url - the ntp server url.port - the ntp server port.timeout - the timeout.IOException - if an error occurred.