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


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. The individual dhcp server parameters can be set by using any of the set calls and can be read by using the get calls. To make changes to DHCPserver settings on the fly use the set commands and then manually restart the udhcpd daemon.


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 closeDhcpServer(java.lang.String adapter)
          Shuts down the Dhcp server for this Ethernet adapter.
 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 runDhcpServer(java.lang.String adapter)
          Reports the whether this adapter has been configured to provide DHCP server service.
 void setDhcpServer(java.lang.String adapter, int defaultLeaseTime, int maximumLeaseTime, java.lang.String subnetMask, java.lang.String rangeFrom, java.lang.String rangeTo, boolean passDnsServers)
          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)
          Sets the maximum lease time to be used by the DHCP server service on this Ethernet adapter.
 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

public 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

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

runDhcpServer

public boolean runDhcpServer(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.

getDhcpServerDefaultLeaseTime

public 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

public 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

public 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

public 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

public 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

public 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

public void setDhcpServerMaximumLeaseTime(java.lang.String adapter,
                                          int maximumleasetime)
                                   throws java.lang.Exception
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

public 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

public 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

public 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

public 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

closeDhcpServer

public boolean closeDhcpServer(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


Copyright © 2009 Eurotech Inc. All rights reserved.