|
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.NTPTime
public class NTPTime
works based on a NTPClient instance adding reliability by using multiple servers if one fails.
NTPClient| Field Summary |
|---|
| Fields inherited from interface com.antelmann.calendar.TimeSystem |
|---|
SYSTEM_TIME |
| Constructor Summary | |
|---|---|
NTPTime()
immediately activates the instance and schedules updates in the interval given. |
|
NTPTime(boolean activateNow)
Interval is 12h. |
|
NTPTime(boolean activateNow,
long updateIntervalMillis)
immediately activates the instance and schedules updates in the interval given. |
|
NTPTime(boolean activateNow,
long updateIntervalMillis,
Logger logger)
|
|
NTPTime(boolean activateNow,
long updateIntervalMillis,
NTPClient client)
|
|
NTPTime(boolean activateNow,
long updateIntervalMillis,
NTPClient client,
Logger logger)
|
|
| Method Summary | |
|---|---|
void |
activate()
activates the embedded timer for automatic updates |
boolean |
addServer(String server)
|
long |
currentTimeMillis()
returns the current time |
void |
deactivate()
deactivates the embedded timer for automatic updates |
protected void |
finalize()
|
Logger |
getLogger()
|
NTPClient |
getNtpClient()
returns the clock in use |
String[] |
getServerNames()
|
long |
getUpdateIntervalMillis()
|
boolean |
isActivated()
|
boolean |
removeServer(String server)
|
void |
setUpdateIntervalMillis(long updateIntervalMillis)
must be called while the instance is deactivated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NTPTime()
public NTPTime(boolean activateNow)
public NTPTime(boolean activateNow,
long updateIntervalMillis)
throws IllegalArgumentException
updateIntervalMillis - must represent more than a minute
IllegalArgumentException - if the interval represents less than a minute
public NTPTime(boolean activateNow,
long updateIntervalMillis,
Logger logger)
throws IllegalArgumentException
IllegalArgumentException
public NTPTime(boolean activateNow,
long updateIntervalMillis,
NTPClient client)
throws IllegalArgumentException
IllegalArgumentException
public NTPTime(boolean activateNow,
long updateIntervalMillis,
NTPClient client,
Logger logger)
throws IllegalArgumentException
activateNow - if true, the instance is immediately activatedupdateIntervalMillis - must represent more than a minuteclient - the NTPClient that is to be used with this instancelogger - used to log the scheduled delta updates for the ntp clock
IllegalArgumentException - if the interval represents less than 5 minutes| Method Detail |
|---|
public boolean isActivated()
public long getUpdateIntervalMillis()
public void setUpdateIntervalMillis(long updateIntervalMillis)
throws IllegalStateException,
IllegalArgumentException
IllegalStateException - if this instance is currently activated
IllegalArgumentException - if the interval represents less than 5 minutesisActivated()public void activate()
public void deactivate()
protected void finalize()
finalize in class Objectpublic long currentTimeMillis()
currentTimeMillis in interface TimeSystempublic NTPClient getNtpClient()
public Logger getLogger()
public String[] getServerNames()
public boolean addServer(String server)
public boolean removeServer(String server)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||