com.esf.net.ntp.service
Interface INtpService


public interface INtpService

This interface provides methods for configuring the NTP Service. The NTP Service is used to synchronize the system time with a remote NTP server.

Author:
chad.kienle

Field Summary
static java.lang.String SERVICE_NAME
          Reports the class name representing this interface.
 
Method Summary
 java.lang.String getBackupURL()
          This method returns the URL of the backup NTP server that is used to synchronize the system time with.
 int getRetryAttempts()
          This method returns the number of retry attempts after a failed attempt to synchronize the system time with the NTP server.
 long getRetryInterval()
          This method returns the interval, in milliseconds, between failed attmepts to synchronize the system time with the NTP server.
 boolean getSyncAtBoot()
          This method returns whether the service will synchronize with the NTP server at boot.
 boolean getSyncHWClock()
          This method returns whether the service will synchronize the hardware clock to the system time every time the service synchronizes the system time with the NTP Server.
 long getSyncInterval()
          This method returns the interval (in milliseconds) between successful attempts to synchronize the system time with the NTP server.
 java.lang.String getURL()
          This method returns the URL of the NTP server that is used to synchronize the system time with.
 void init(java.lang.String url, java.lang.String url_backup, boolean boot_sync, boolean clock_sync, long sync_interval, long retry_interval, int retries)
          This method is used to initialize the NTP Service configuration.
 boolean isRunning()
          Check the operational status of any functional operation associated with the implementation.
 void restart()
          Perform both the action of the stop and the start methods.
 void setBackupURL(java.lang.String url2)
          This method is used to set the URL of the backup NTP server that is used to synchronize the system time.
 void setPersistent()
          Store the current configuration (through @IConfigurationManagerService or in the OS as appropriate).
 void setRetryAttempts(int retries)
          This method is used to set the number of retry attempts after a failed attempt to synchronize the system time with the NTP server.
 void setRetryInterval(long interval)
          This method is used to set the interval, in milliseconds, between failed attempts to synchronize the system time with the NTP server.
 void setSyncAtBoot(boolean sync)
          This method is used to set whether the service will synchronize with the NTP server at boot.
 void setSyncHWClock(boolean sync)
          This method is used to set whether the service will synchronize the hardware clock to the system time every time the service synchronizes the system time with the NTP Server.
 void setSyncInterval(long interval)
          This method is used to set the interval (in milliseconds) between successful attempts to synchronize the system time with the NTP server.
 void setURL(java.lang.String url)
          This method is used to set the URL of the NTP server that is used to synchronize the system time.
 void start()
          The start method will start any functional operation associated with the specific implementation.
 void stop()
          The stop method will stop any functional operation started by the start method.
 boolean sync()
          This methods issues a command to synchronize the system date with the NTP server.
 boolean syncBackup()
          This methods issues a command to synchronize the system date with the backup NTP server.
 boolean syncBackupWithRetries()
          This methods issues a command to synchronize the system date with the backup NTP server.
 boolean syncHWClock()
          This method issues a command to synchronize the hardware clock with the system time.
 boolean syncWithRetries()
          This methods issues a command to synchronize the system date with the NTP server.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Reports the class name representing this interface.

Method Detail

init

void init(java.lang.String url,
          java.lang.String url_backup,
          boolean boot_sync,
          boolean clock_sync,
          long sync_interval,
          long retry_interval,
          int retries)
This method is used to initialize the NTP Service configuration. Each parameter can also be individually set using the corresponding set method.

Parameters:
url - A String representing the URL of the NTP server.
url_backup - A String representing the URL of the backup NTP server.
boot_sync - A boolean used to determine whether to sync to the NTP server at boot.
clock_sync - A boolean used to determine whether to sync the hardware clock to system time.
sync_interval - The number of milliseconds between successful NTP server sync attempts.
retry_interval - The number of milliseconds between failed NTP server sync/retry attempts.
retries - The number of retries after a failed NTP server sync attempt.

setURL

void setURL(java.lang.String url)
This method is used to set the URL of the NTP server that is used to synchronize the system time.

Parameters:
url - A String representing the URL of the NTP server.

setBackupURL

void setBackupURL(java.lang.String url2)
This method is used to set the URL of the backup NTP server that is used to synchronize the system time.

Parameters:
url2 - A String representing the URL of the NTP server.

setSyncAtBoot

void setSyncAtBoot(boolean sync)
This method is used to set whether the service will synchronize with the NTP server at boot.

Note: this method is not yet implemented.

Parameters:
sync - A boolean used to determine whether to sync to the NTP server at boot.

setSyncHWClock

void setSyncHWClock(boolean sync)
This method is used to set whether the service will synchronize the hardware clock to the system time every time the service synchronizes the system time with the NTP Server.

Parameters:
sync - A boolean used to determine whether to sync the hardware clock to system time.

setSyncInterval

void setSyncInterval(long interval)
This method is used to set the interval (in milliseconds) between successful attempts to synchronize the system time with the NTP server.

Parameters:
interval - The number of milliseconds between successful NTP server sync attempts.

setRetryInterval

void setRetryInterval(long interval)
This method is used to set the interval, in milliseconds, between failed attempts to synchronize the system time with the NTP server.

Parameters:
interval - The number of milliseconds between failed NTP server sync/retry attempts.

setRetryAttempts

void setRetryAttempts(int retries)
This method is used to set the number of retry attempts after a failed attempt to synchronize the system time with the NTP server.

Parameters:
retries - The number of retries after a failed NTP server sync attempt.

getURL

java.lang.String getURL()
This method returns the URL of the NTP server that is used to synchronize the system time with.

Returns:
A String representing the URL of the NTP server.

getBackupURL

java.lang.String getBackupURL()
This method returns the URL of the backup NTP server that is used to synchronize the system time with.

Returns:
A String representing the URL of the backup NTP server.

getSyncAtBoot

boolean getSyncAtBoot()
This method returns whether the service will synchronize with the NTP server at boot.

Returns:
A boolean used to determine whether to sync to the NTP server at boot.

getSyncHWClock

boolean getSyncHWClock()
This method returns whether the service will synchronize the hardware clock to the system time every time the service synchronizes the system time with the NTP Server.

Returns:
A boolean used to determine whether to sync the hardware clock to system time.

getSyncInterval

long getSyncInterval()
This method returns the interval (in milliseconds) between successful attempts to synchronize the system time with the NTP server.

Returns:
The number of milliseconds between successful NTP server sync attempts.

getRetryInterval

long getRetryInterval()
This method returns the interval, in milliseconds, between failed attmepts to synchronize the system time with the NTP server.

Returns:
The number of milliseconds between failed NTP server sync/retry attempts.

getRetryAttempts

int getRetryAttempts()
This method returns the number of retry attempts after a failed attempt to synchronize the system time with the NTP server.

Returns:
The number of retries after a failed NTP server sync attempt.

sync

boolean sync()
This methods issues a command to synchronize the system date with the NTP server.

Returns:
True if the sync attempt succeeded, false otherwise.

syncWithRetries

boolean syncWithRetries()
This methods issues a command to synchronize the system date with the NTP server. It will retry based on the number of retry attempts specified if it fails.

Returns:
True if the sync attempt succeeded, false otherwise.

syncBackup

boolean syncBackup()
This methods issues a command to synchronize the system date with the backup NTP server.

Returns:
True if the sync attempt succeeded, false otherwise.

syncBackupWithRetries

boolean syncBackupWithRetries()
This methods issues a command to synchronize the system date with the backup NTP server. It will retry based on the number of retry attempts specified if it fails.

Returns:
True if the sync attempt succeeded, false otherwise.

syncHWClock

boolean syncHWClock()
This method issues a command to synchronize the hardware clock with the system time.

Returns:
True if the sync attempt succeeded, false otherwise.

start

void start()
           throws java.lang.Exception
The start method will start any functional operation associated with the specific implementation.

Throws:
java.lang.Exception - start failed (could be missing a configuration).

stop

void stop()
          throws java.lang.Exception
The stop method will stop any functional operation started by the start method.

Throws:
java.lang.Exception - stop failed

restart

void restart()
             throws java.lang.Exception
Perform both the action of the stop and the start methods. If the result of running the isRunning method prior to the call would be false, then restart only performs the same action as the start method.

Throws:
java.lang.Exception - restart failed (could be missing a configuration)

setPersistent

void setPersistent()
                   throws java.lang.Exception
Store the current configuration (through @IConfigurationManagerService or in the OS as appropriate).

Throws:
java.lang.Exception - no current configuration to store

isRunning

boolean isRunning()
Check the operational status of any functional operation associated with the implementation. Following a successful start, this should return true and following a successful stop, this should return false.

Returns:
true if the functional part of the implementation is running false if the functional part of the implementation is not running