|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.calendar.AbstractTimeSystem
com.antelmann.calendar.NTPClient
public class NTPClient
implements a simple client for the Network Time Protocol (NTP).
NTPTime| Field Summary | |
|---|---|
static int |
DEFAULT_PORT
123 |
static String |
DEFAULT_SERVER_KEY
key to obtain the default server via Settings.getProperty(String) |
static String |
DEFAULT_SERVER_LIST_KEY
key to obtain the default server list via Settings.getProperty(String) |
static double |
TIME_OFFSET
seconds between Jan-01-1990 and Jan-01-1970 |
| Fields inherited from interface com.antelmann.calendar.TimeSystem |
|---|
SYSTEM_TIME |
| Constructor Summary | |
|---|---|
NTPClient()
|
|
NTPClient(String serverName)
|
|
NTPClient(String serverName,
int port)
|
|
| Method Summary | |
|---|---|
protected long |
aquireDelta()
returns the current difference between system time and the time of this implementation in milliseconds. |
static String |
getDefaultServer()
|
static String[] |
getDefaultServerList()
|
int |
getPort()
|
String |
getServer()
|
int |
getTimeout()
|
static void |
setDefaultServer(String server)
|
static void |
setDefaultServerList(String... serverList)
|
void |
setPort(int port)
|
void |
setServer(String serverName)
|
void |
setTimeout(int timeout)
|
String |
toString()
|
| Methods inherited from class com.antelmann.calendar.AbstractTimeSystem |
|---|
adjustDelta, adjustedTimeMills, createTimerTask, currentTimeMillis, getDelta, getLastDeltaAdjustmentTime, getLastRoundTripDelay, setDelta, setLastRoundTripDelay |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_SERVER_KEY
Settings.getProperty(String)
public static final String DEFAULT_SERVER_LIST_KEY
Settings.getProperty(String)
public static final int DEFAULT_PORT
public static final double TIME_OFFSET
| Constructor Detail |
|---|
public NTPClient()
public NTPClient(String serverName)
public NTPClient(String serverName,
int port)
| Method Detail |
|---|
public String getServer()
public void setServer(String serverName)
public int getPort()
public void setPort(int port)
public void setTimeout(int timeout)
public int getTimeout()
protected long aquireDelta()
throws IOException
AbstractTimeSystem
aquireDelta in class AbstractTimeSystemIOExceptionAbstractTimeSystem.adjustDelta()public String toString()
toString in class Objectpublic static String getDefaultServer()
DEFAULT_SERVER_KEYpublic static void setDefaultServer(String server)
public static String[] getDefaultServerList()
DEFAULT_SERVER_LIST_KEYpublic static void setDefaultServerList(String... serverList)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||