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, boolean persist)
          This method is used to initialize the NTP Service configuration.
 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 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 attmepts 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.
 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 syncHWClock()
          This method issues a command to synchronize the hardware clock with the system time.
 

Field Detail

SERVICE_NAME

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

Method Detail

init

public 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,
                 boolean persist)
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.
persist - Boolean, whether to store the configuration to local ESF-specific storage.

setURL

public 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

public 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

public 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

public 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

public 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

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

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

setRetryAttempts

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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.

syncBackup

public 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.

syncHWClock

public 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.


Copyright © 2009 Eurotech Inc. All rights reserved.