|
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.TimeProtocolClient
NTPClient instead
@Deprecated public class TimeProtocolClient
implements the TimeProtocol. This simple implementation is based on a single server.
TimeProtocolServer,
AtomicTime,
NTPClient| Field Summary | |
|---|---|
static int |
DEFAULT_PORT
Deprecated. 37 |
static String |
DEFAULT_SERVER
Deprecated. 0.pool.ntp.org |
protected static String[] |
knownServerList
Deprecated. a small list of known servers besides the default one |
| Fields inherited from interface com.antelmann.calendar.TimeSystem |
|---|
SYSTEM_TIME |
| Constructor Summary | |
|---|---|
TimeProtocolClient()
Deprecated. uses time-b.nist.gov |
|
TimeProtocolClient(String serverName)
Deprecated. uses the standard port 37 |
|
TimeProtocolClient(String serverName,
int port)
Deprecated. |
|
| Method Summary | |
|---|---|
int |
adjustDelta()
Deprecated. adjusts the delta value used for getTime() through
using the server time |
TimerTask |
createTimerTask(Logger logger)
Deprecated. creates a TimerTask that will adjust the delta and log the result to the given logger. |
int |
currentDelta()
Deprecated. returns the current difference between system time and atomic time in milliseconds. |
long |
currentTimeMillis()
Deprecated. returns the system time adjusted by the delta value. |
long |
currentTimeMillisOnline()
Deprecated. returns the current time in the current locale retrieved directly from the server. |
Calendar |
getCalendar()
Deprecated. returns the calendar used to localize the time |
int |
getDelta()
Deprecated. returns the stored difference between system time and atomic time in milliseconds. |
static String[] |
getKnownServerList()
Deprecated. |
long |
getLastDeltaAdjustmentTime()
Deprecated. returns the system time when adjustDelta() has been
successfully called last time. |
int |
getPort()
Deprecated. |
String |
getServer()
Deprecated. |
int |
getTimeout()
Deprecated. |
static void |
main(String[] args)
Deprecated. console based demo app displaying the delta between the system time and the server |
protected int |
secondsSince1900()
Deprecated. returns the raw int directly from the server |
protected int |
secondsSince1900Udp()
Deprecated. |
protected int |
secondsSince190OTcp()
Deprecated. |
void |
setDelta(int delta)
Deprecated. manually sets the value used to adjust system time |
static void |
setKnownServerList(String[] newList)
Deprecated. |
void |
setPort(int port)
Deprecated. |
void |
setServer(String serverName)
Deprecated. |
void |
setTcp(boolean flag)
Deprecated. |
void |
setTimeout(int timeout)
Deprecated. |
String |
toString()
Deprecated. |
| 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
public static final int DEFAULT_PORT
protected static String[] knownServerList
| Constructor Detail |
|---|
public TimeProtocolClient()
public TimeProtocolClient(String serverName)
public TimeProtocolClient(String serverName,
int port)
| Method Detail |
|---|
public static String[] getKnownServerList()
public static void setKnownServerList(String[] newList)
public void setTcp(boolean flag)
public String getServer()
public void setServer(String serverName)
public int getPort()
public void setPort(int port)
public void setTimeout(int timeout)
public int getTimeout()
public Calendar getCalendar()
public long currentTimeMillis()
currentTimeMillis in interface TimeSystem
protected int secondsSince1900()
throws IOException
IOException
protected int secondsSince1900Udp()
throws IOException
IOException
protected int secondsSince190OTcp()
throws IOException
IOException
public long currentTimeMillisOnline()
throws IOException
IOException
public int currentDelta()
throws IOException
IOExceptionpublic int getDelta()
adjustDelta(),
setDelta(int)public void setDelta(int delta)
adjustDelta()public long getLastDeltaAdjustmentTime()
adjustDelta() has been
successfully called last time.
If no successful adjustment has taken place, yet, the method returns 0.
adjustDelta()
public int adjustDelta()
throws IOException
getTime() through
using the server time
IOExceptioncurrentTimeMillis(),
getDelta(),
setDelta(int),
getLastDeltaAdjustmentTime()public TimerTask createTimerTask(Logger logger)
adjustDelta(),
Timerpublic String toString()
toString in class Object
public static void main(String[] args)
throws IOException
IOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||