com.esf.net.dhcp.server.service
Interface IDhcpServerService

All Known Subinterfaces:
IDhcpServerExtService

public interface IDhcpServerService

The IDhcpService is used to set up dhcpserver on a particular adapter. To setup the dhcp server for first time use setDhcpServer(String adapter,int defaultLeaseTime, int maximumLeaseTime, String subnetMask, String rangeFrom, String rangeTo, boolean passDnsServers) method call followed by runDhcpServer(string adapter) method call which sets up the conf file. the dhcp server can be started stopped or restarted by start,stop and restart methods to take effect respectively.


Field Summary
static java.lang.String SERVICE_NAME
          service name of this interface for the bundle activator com.esf.net.dhcp.server.service
 
Method Summary
 boolean disableDhcpServer(java.lang.String adapter)
          Shuts down the Dhcp server for this Ethernet adapter.
 boolean enableDhcpServer(java.lang.String adapter)
          Reports the whether this adapter has been configured to provide DHCP server service.
 int getDhcpServerDefaultLeaseTime(java.lang.String adapter)
          Reports the default lease time to be used by the DHCP server service on this Ethernet adapter.
 int getDhcpServerMaximumLeaseTime(java.lang.String adapter)
          Reports the maximum lease time to be used by the DHCP server service on this Ethernet adapter.
 java.lang.String getDhcpServerRangeFrom(java.lang.String adapter)
          Reports the IP address representing the beginning of the range of addresses to be served by the DHCP server service on this Ethernet adapter.
 java.lang.String getDhcpServerRangeTo(java.lang.String adapter)
          Reports the IP address representing the end of the range of addresses to be served by the DHCP server service on this Ethernet adapter.
 java.lang.String getDhcpServerSubnetMask(java.lang.String adapter)
          Reports the IP subnet mask to be used by the DHCP server service on this Ethernet adapter.
 boolean isDhcpServerConfigured(java.lang.String adapter)
          Reports whether or not the specified adapter is configured to be a DHCP server.
 void setDhcpServer(java.lang.String adapter, int defaultLeaseTime, int maximumLeaseTime, java.lang.String subnetMask, java.lang.String rangeFrom, java.lang.String rangeTo, boolean passDnsServers)
          Deprecated. As of ESF 1.1.0 this was replaced by the more extensive setDhcpServer method sets the dhcp server parameters of a statically defined Ethernet interface
 void setDhcpServer(java.lang.String adapter, java.lang.String ipAddress, int defaultLeaseTime, java.lang.String subnetMask, java.lang.String rangeFrom, java.lang.String rangeTo, boolean passDnsServers, java.lang.String primaryDns, java.lang.String secondaryDns)
          sets the DHCP server parameters of a statically defined Ethernet interface
 void setDhcpServerDefaultLeaseTime(java.lang.String adapter, int defaultleasetime)
          sets the default lease time to be used by the DHCP server service on this Ethernet adapter.
 void setDhcpServerMaximumLeaseTime(java.lang.String adapter, int maximumleasetime)
          Deprecated. As of ESF 1.1.0 this should not be used. This never worked and should not be used. Sets the maximum lease time to be used by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.
 void setDhcpServerRangeFrom(java.lang.String adapter, java.lang.String serverRangefrom)
          Sets the IP address representing the beginning of the range of addresses to be served by the DHCP server service on this Ethernet adapter.
 void setDhcpServerRangeTo(java.lang.String adapter, java.lang.String serverRangeto)
          Sets the IP address representing the end of the range of addresses to be served by the DHCP server service on this Ethernet adapter.
 void setDhcpServerSubnetMask(java.lang.String adapter, java.lang.String subnetMask)
          Sets the IP subnet mask to be used by the DHCP server service on this Ethernet adapter.
 boolean willDhcpServerPassDnsServers(java.lang.String adapter)
          Reports whether the DHCP server service will pass DNS server addresses for this Ethernet adapter.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
service name of this interface for the bundle activator com.esf.net.dhcp.server.service

Method Detail

setDhcpServer

void setDhcpServer(java.lang.String adapter,
                   int defaultLeaseTime,
                   int maximumLeaseTime,
                   java.lang.String subnetMask,
                   java.lang.String rangeFrom,
                   java.lang.String rangeTo,
                   boolean passDnsServers)
                   throws java.lang.Exception
Deprecated. As of ESF 1.1.0 this was replaced by the more extensive setDhcpServer method sets the dhcp server parameters of a statically defined Ethernet interface

Parameters:
adapter - = requested adapter.
defaultLeaseTime - the default lease time to configure in seconds,
maximumLeaseTime - maximum lease time to be used by the server in seconds,
subnetMask - the IP subnet mask to be used
rangeFrom - IP address representing the beginning of the range of addresses to be served by the DHCP server
rangeTo - IP address representing the end of the range of addresses to be served by the DHCP server
passDnsServers - 0 for no dnsserver pass and 1 to pass dnsserver
Throws:
java.lang.Exception - if any parameters are invalid

setDhcpServer

void setDhcpServer(java.lang.String adapter,
                   java.lang.String ipAddress,
                   int defaultLeaseTime,
                   java.lang.String subnetMask,
                   java.lang.String rangeFrom,
                   java.lang.String rangeTo,
                   boolean passDnsServers,
                   java.lang.String primaryDns,
                   java.lang.String secondaryDns)
                   throws java.lang.Exception
sets the DHCP server parameters of a statically defined Ethernet interface

Parameters:
adapter - the requested adapter
ipAddress - the static address of this adapter
defaultLeaseTime - the default lease time in seconds
subnetMask - the IP subnet mask
rangeFrom - the starting IP address for the DHCP server to issue to DHCP requests
rangeTo - the ending IP address for the DHCP server to issue to DHCP requests
passDnsServers - whether or not to pass DNS servers to clients
primaryDns - the primary DNS is passDnsServers is true (required if passDnsServers is true)
secondaryDns - the secondary DNS is passDnsServers is true (optional if passDnsServers is true but must be null if passDnsServers is false)
Throws:
java.lang.Exception - if there is an error with the parameters passed in

enableDhcpServer

boolean enableDhcpServer(java.lang.String adapter)
Reports the whether this adapter has been configured to provide DHCP server service.

Parameters:
adapter - = requested adapter.
Returns:
false if DHCP server service is not configured. Requesting an invalid adapter number will return false.

disableDhcpServer

boolean disableDhcpServer(java.lang.String adapter)
                          throws java.lang.Exception
Shuts down the Dhcp server for this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter
Returns:
true if shutdown,false otherwise. Requesting an invalid adapter number will return false.
Throws:
java.lang.Exception

getDhcpServerDefaultLeaseTime

int getDhcpServerDefaultLeaseTime(java.lang.String adapter)
                                  throws java.lang.Exception
Reports the default lease time to be used by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
Returns:
-1 if not configured, otherwise the lease time in seconds. Requesting an invalid adapter number will also return -1.
Throws:
java.lang.Exception

getDhcpServerMaximumLeaseTime

int getDhcpServerMaximumLeaseTime(java.lang.String adapter)
                                  throws java.lang.Exception
Reports the maximum lease time to be used by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
Returns:
-1 if not configured, otherwise the lease time in seconds Requesting an invalid adapter number will also return -1.
Throws:
java.lang.Exception

getDhcpServerSubnetMask

java.lang.String getDhcpServerSubnetMask(java.lang.String adapter)
                                         throws java.lang.Exception
Reports the IP subnet mask to be used by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
Returns:
null if not configured, otherwise the subnet mask. Requesting an invalid adapter number will return null.
Throws:
java.lang.Exception

getDhcpServerRangeFrom

java.lang.String getDhcpServerRangeFrom(java.lang.String adapter)
                                        throws java.lang.Exception
Reports the IP address representing the beginning of the range of addresses to be served by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
Returns:
null if not configured, otherwise the IP address. Requesting an invalid adapter number will return null.
Throws:
java.lang.Exception

getDhcpServerRangeTo

java.lang.String getDhcpServerRangeTo(java.lang.String adapter)
                                      throws java.lang.Exception
Reports the IP address representing the end of the range of addresses to be served by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
Returns:
null if not configured, otherwise the IP address. Requesting an invalid adapter number will return null.
Throws:
java.lang.Exception

setDhcpServerDefaultLeaseTime

void setDhcpServerDefaultLeaseTime(java.lang.String adapter,
                                   int defaultleasetime)
                                   throws java.lang.Exception
sets the default lease time to be used by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
defaultleasetime - = default lease time to set in seconds,
Throws:
java.lang.Exception - if any parameters are invalid

setDhcpServerMaximumLeaseTime

void setDhcpServerMaximumLeaseTime(java.lang.String adapter,
                                   int maximumleasetime)
                                   throws java.lang.Exception
Deprecated. As of ESF 1.1.0 this should not be used. This never worked and should not be used. Sets the maximum lease time to be used by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
maximumleasetime - = maximum lease time to set in seconds
Throws:
java.lang.Exception - if any parameters are invalid

setDhcpServerSubnetMask

void setDhcpServerSubnetMask(java.lang.String adapter,
                             java.lang.String subnetMask)
                             throws java.lang.Exception
Sets the IP subnet mask to be used by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
subnetMask - = the subnet mask ip address to be set
Throws:
java.lang.Exception - if any parameters are invalid

setDhcpServerRangeFrom

void setDhcpServerRangeFrom(java.lang.String adapter,
                            java.lang.String serverRangefrom)
                            throws java.lang.Exception
Sets the IP address representing the beginning of the range of addresses to be served by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
serverRangefrom - = starting ip address of the DHCP server range
Throws:
java.lang.Exception - if any parameters are invalid

setDhcpServerRangeTo

void setDhcpServerRangeTo(java.lang.String adapter,
                          java.lang.String serverRangeto)
                          throws java.lang.Exception
Sets the IP address representing the end of the range of addresses to be served by the DHCP server service on this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter.
serverRangeto - = Ending ip address of the DHCP server range
Throws:
java.lang.Exception - if any parameters are invalid

willDhcpServerPassDnsServers

boolean willDhcpServerPassDnsServers(java.lang.String adapter)
                                     throws java.lang.Exception
Reports whether the DHCP server service will pass DNS server addresses for this Ethernet adapter. This method is useful only if runDhcpServer() reports true.

Parameters:
adapter - = requested adapter
Returns:
false if not configured, otherwise the boolean choice. Requesting an invalid adapter number will return false.
Throws:
java.lang.Exception

isDhcpServerConfigured

boolean isDhcpServerConfigured(java.lang.String adapter)
Reports whether or not the specified adapter is configured to be a DHCP server. This does not report the running state of the adapter, only whether or not it is configured to be one.

Parameters:
adapter - the requested adapter
Returns:
true if configured to be a DHCP server, false otherwise