com.eurotech.framework.net.dhcp
Class DhcpServerConfigIP<T extends IPAddress>

java.lang.Object
  extended by com.eurotech.framework.net.dhcp.DhcpServerConfigIP<T>
Type Parameters:
T - is the an appropriate subclass of IPAddress
All Implemented Interfaces:
DhcpServerConfig, NetConfig
Direct Known Subclasses:
DhcpServerConfigIP4, DhcpServerConfigIP6

public abstract class DhcpServerConfigIP<T extends IPAddress>
extends Object
implements DhcpServerConfig

The abstract representation of a DhcpServerConfig object.

Author:
eurotech

Constructor Summary
DhcpServerConfigIP(String interfaceName, boolean enabled, T subnet, T routerAddress, T subnetMask, int defaultLeaseTime, int maximumLeaseTime, short prefix, T rangeStart, T rangeEnd, boolean passDns, List<T> dnsServers)
          The basic Constructor for a DhcpServerConfigIP
 
Method Summary
 boolean equals(Object obj)
           
 int getDefaultLeaseTime()
          Returns the default lease time offered by the DHCP server
 List<T> getDnsServers()
          Returns the DNS servers associated with this DhcpServerConfig that will be passed to DHCP clients
 String getInterfaceName()
          Returns the interface name associated with this DhcpServerConfig
 int getMaximumLeaseTime()
          Returns the maximum lease time offered by the DHCP server
 short getPrefix()
          Returns the network prefix length for this DHCP server's address range This is also known as the subnet mask in the context of IPv4 addresses.
 T getRangeEnd()
          Returns the ending DHCP server InetAddress to provide to DHCP clients.
 T getRangeStart()
          Returns the starting DHCP server InetAddress to provide to DHCP clients.
 T getRouterAddress()
          Returns the router IP address associated with this DhcpServerConfig
 T getSubnet()
          Returns the subnet associated with this DhcpServerConfig
 T getSubnetMask()
          Returns the subnet mask associated with this DhcpServerConfig
 boolean isEnabled()
          Returns the boolean status associated with this DhcpServerConfig
 boolean isPassDns()
          Returns whether or not DHCP clients should get DNS services.
 boolean isValid()
          Checks whether or not this configuration is valid.
 void setDefaultLeaseTime(int defaultLeaseTime)
          sets the default lease time for DHCP clients
 void setDnsServers(List<T> m_dnsServers)
          the DNS servers to pass to DHCP clients if passDns is set to true
 void setEnabledRouterMode(boolean enabled)
          sets the status for the DhcpServerConfig
 void setInterfaceName(String interfaceName)
          sets the interface name for the DhcpServerConfig
 void setMaximumLeaseTime(int maximumLeaseTime)
          sets the maximum lease time for DHCP clients
 void setPassDns(boolean passDns)
          whether or not to pass DNS to DHCP clients
 void setPrefix(short prefix)
          sets the network prefix for the DhcpServerConfig
 void setRangeEnd(T rangeEnd)
          sets the ending IPAddress in the pool for the DHCP clients
 void setRangeStart(T m_rangeStart)
          sets the starting IPAddress in the pool for the DHCP clients
 void setRouterAddress(T routerAddress)
          sets the router IPAddress for the DhcpServerConfig
 void setSubnet(T subnet)
          sets the subnet for the DhcpServerConfig
 void setSubnetMask(T subnetMask)
          sets the subnet mask for the DhcpServerConfig
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DhcpServerConfigIP

public DhcpServerConfigIP(String interfaceName,
                          boolean enabled,
                          T subnet,
                          T routerAddress,
                          T subnetMask,
                          int defaultLeaseTime,
                          int maximumLeaseTime,
                          short prefix,
                          T rangeStart,
                          T rangeEnd,
                          boolean passDns,
                          List<T> dnsServers)
The basic Constructor for a DhcpServerConfigIP

Parameters:
interfaceName - the interface name associated with the DhcpServerConfig
enabled - the status of the DhcpServer as a boolean
subnet - the subnet of the DhcpServerConfig
routerAddress - the router IPAddress
subnetMask - the subnet mask of the DhcpServerConfig
defaultLeaseTime - the default lease time to issue to DHCP clients
maximumLeaseTime - the maximum lease time to issue to DHCP clients
prefix - the network prefix associated with the DhcpServerConfig
rangeStart - the network starting address to issue to DHCP clients
rangeEnd - the network ending address to issue to DHCP clients
passDns - whether or not to pass DNS to DHCP clients
dnsServers - the DNS servers that will get passed to DHCP clients if passDns is true
Method Detail

getInterfaceName

public String getInterfaceName()
Description copied from interface: DhcpServerConfig
Returns the interface name associated with this DhcpServerConfig

Specified by:
getInterfaceName in interface DhcpServerConfig
Returns:
a String representing the interface name

setInterfaceName

public void setInterfaceName(String interfaceName)
sets the interface name for the DhcpServerConfig

Parameters:
interfaceName - the interface name in the form of a String

isEnabled

public boolean isEnabled()
Description copied from interface: DhcpServerConfig
Returns the boolean status associated with this DhcpServerConfig

Specified by:
isEnabled in interface DhcpServerConfig
Returns:
a boolean representing the status

setEnabledRouterMode

public void setEnabledRouterMode(boolean enabled)
sets the status for the DhcpServerConfig

Parameters:
enabled - the Dhcp Server status in the form of a boolean

getSubnet

public T getSubnet()
Description copied from interface: DhcpServerConfig
Returns the subnet associated with this DhcpServerConfig

Specified by:
getSubnet in interface DhcpServerConfig
Returns:
a IPAddress representing the subnet

setSubnet

public void setSubnet(T subnet)
sets the subnet for the DhcpServerConfig

Parameters:
subnet - the subnet in the form of a IPAddress

getRouterAddress

public T getRouterAddress()
Description copied from interface: DhcpServerConfig
Returns the router IP address associated with this DhcpServerConfig

Specified by:
getRouterAddress in interface DhcpServerConfig
Returns:
a IPAddress representing the router IP address

setRouterAddress

public void setRouterAddress(T routerAddress)
sets the router IPAddress for the DhcpServerConfig

Parameters:
routerAddress - the router IPAddress in the form of a IPAddress

getSubnetMask

public T getSubnetMask()
Description copied from interface: DhcpServerConfig
Returns the subnet mask associated with this DhcpServerConfig

Specified by:
getSubnetMask in interface DhcpServerConfig
Returns:
a IPAddress representing the subnet mask

setSubnetMask

public void setSubnetMask(T subnetMask)
sets the subnet mask for the DhcpServerConfig

Parameters:
subnetMask - the subnet mask in the form of a IPAddress

getDefaultLeaseTime

public int getDefaultLeaseTime()
Description copied from interface: DhcpServerConfig
Returns the default lease time offered by the DHCP server

Specified by:
getDefaultLeaseTime in interface DhcpServerConfig
Returns:
the default lease time (in seconds) offered by the DHCP server

setDefaultLeaseTime

public void setDefaultLeaseTime(int defaultLeaseTime)
sets the default lease time for DHCP clients

Parameters:
defaultLeaseTime - the default lease time

getMaximumLeaseTime

public int getMaximumLeaseTime()
Description copied from interface: DhcpServerConfig
Returns the maximum lease time offered by the DHCP server

Specified by:
getMaximumLeaseTime in interface DhcpServerConfig
Returns:
the maximum lease time (in seconds) offered by the DHCP server

setMaximumLeaseTime

public void setMaximumLeaseTime(int maximumLeaseTime)
sets the maximum lease time for DHCP clients

Parameters:
maximumLeaseTime - the maximum lease time

getPrefix

public short getPrefix()
Description copied from interface: DhcpServerConfig
Returns the network prefix length for this DHCP server's address range This is also known as the subnet mask in the context of IPv4 addresses. Typical IPv4 values would be 8 (255.0.0.0), 16 (255.255.0.0) or 24 (255.255.255.0). Typical IPv6 values would be 128 (::1/128) or 10 (fe80::203:baff:fe27:1243/10)

Specified by:
getPrefix in interface DhcpServerConfig
Returns:
a short representing the prefix length for the subnet of the DHCP server address range.

setPrefix

public void setPrefix(short prefix)
sets the network prefix for the DhcpServerConfig

Parameters:
prefix - the prefix

getRangeStart

public T getRangeStart()
Description copied from interface: DhcpServerConfig
Returns the starting DHCP server InetAddress to provide to DHCP clients.

Specified by:
getRangeStart in interface DhcpServerConfig
Returns:
the starting address to provide to DHCP clients

setRangeStart

public void setRangeStart(T m_rangeStart)
sets the starting IPAddress in the pool for the DHCP clients

Parameters:
m_rangeStart - the starting IPAddress

getRangeEnd

public T getRangeEnd()
Description copied from interface: DhcpServerConfig
Returns the ending DHCP server InetAddress to provide to DHCP clients.

Specified by:
getRangeEnd in interface DhcpServerConfig
Returns:
the ending address to provide to DHCP clients

setRangeEnd

public void setRangeEnd(T rangeEnd)
sets the ending IPAddress in the pool for the DHCP clients

Parameters:
m_rangeEnd - the ending IPAddress

isPassDns

public boolean isPassDns()
Description copied from interface: DhcpServerConfig
Returns whether or not DHCP clients should get DNS services.

Specified by:
isPassDns in interface DhcpServerConfig
Returns:
a boolean representing whether or not DHCP clients should receive DNS services.

setPassDns

public void setPassDns(boolean passDns)
whether or not to pass DNS to DHCP clients

Parameters:
passDns - true to pass, false to not

getDnsServers

public List<T> getDnsServers()
Description copied from interface: DhcpServerConfig
Returns the DNS servers associated with this DhcpServerConfig that will be passed to DHCP clients

Specified by:
getDnsServers in interface DhcpServerConfig
Returns:
a List of IPAddresses that represent the DNS servers

setDnsServers

public void setDnsServers(List<T> m_dnsServers)
the DNS servers to pass to DHCP clients if passDns is set to true

Parameters:
m_dnsServers - the DNS servers to pass

isValid

public boolean isValid()
Description copied from interface: NetConfig
Checks whether or not this configuration is valid.

Specified by:
isValid in interface NetConfig
Returns:
true if the configuration is valid, otherwise false

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013. All Rights Reserved.