com.eurotech.framework.net
Class NetConfigIP<T extends IPAddress>

java.lang.Object
  extended by com.eurotech.framework.net.NetConfigIP<T>
Type Parameters:
T - IPv4 or IPv6 address
All Implemented Interfaces:
NetConfig
Direct Known Subclasses:
NetConfigIP4, NetConfigIP6

public abstract class NetConfigIP<T extends IPAddress>
extends Object
implements NetConfig

Base class for configuration of network interfaces. The two subclasses NetConfigIP4 and NetConfigIP6 represent configurations of IPv4 and IPv6 addresses respectively.


Method Summary
 boolean equals(Object obj)
           
 T getAddress()
          Returns the address that should be statically assigned to the interface.
 List<T> getDnsServers()
          Returns the list of Name Servers to be associated to the interface.
 List<String> getDomains()
          Returns the list of DNS domains to be associated to the interface.
 T getGateway()
          Returns the address of the gateway to be used for the interface
 short getNetworkPrefixLength()
          Return the prefix to be used for the network interface
 Map<String,Object> getProperties()
           
 NetInterfaceStatus getStatus()
          Return the NetInterfaceStatus of this configuration
 T getSubnetMask()
          Return the prefix to be used for the network interface
 int hashCode()
           
 boolean isAutoConnect()
           
 boolean isDhcp()
           
 boolean isValid()
          Checks whether or not this configuration is valid.
 void setAddress(T address)
          Sets the static address to be assigned to the interface.
 void setAutoConnect(boolean autoConnect)
           
 void setDhcp(boolean dhcp)
          Sets whether of not this configuration should be a dhcp client.
 void setDnsServers(List<T> dnsServers)
          Sets the list of Name Servers to be associated to the interface.
 void setDomains(List<String> domains)
          Sets the list of DNS domains to be associated to the interface.
 void setGateway(T gateway)
          Sets the gateway to be used for the interface
 void setNetworkPrefixLength(short networkPrefixLength)
          Sets the prefix length to be used for the network interface
 void setProperties(Map<String,Object> properties)
           
 void setStatus(NetInterfaceStatus status)
          Sets the NetInterfaceStatus to be used for the network interface
 void setSubnetMask(T subnetMask)
          Sets the subnet mask to be used for the network interface
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getStatus

public NetInterfaceStatus getStatus()
Return the NetInterfaceStatus of this configuration

Returns:

setStatus

public void setStatus(NetInterfaceStatus status)
Sets the NetInterfaceStatus to be used for the network interface

Parameters:
status -

isAutoConnect

public boolean isAutoConnect()

setAutoConnect

public void setAutoConnect(boolean autoConnect)

isDhcp

public boolean isDhcp()

setDhcp

public void setDhcp(boolean dhcp)
Sets whether of not this configuration should be a dhcp client. If dhcp is set to true it overrides and static configuration that is present in the configuration.

Parameters:
dhcp - whether or not dhcp client mode should be used

getAddress

public T getAddress()
Returns the address that should be statically assigned to the interface. The returned address is IP4Address or IP6Address depending on the NetConfigIP instance used. This is only used if dhcp is set to false.

Returns:
the static address for the interface

setAddress

public void setAddress(T address)
                throws EsfException
Sets the static address to be assigned to the interface. The address should IP4Address or IP6Address depending on the NetConfigIP instance used. This is only used if dhcp is set to false.

Parameters:
address - - address to be statically assigned to the interface
Throws:
EsfException

getNetworkPrefixLength

public short getNetworkPrefixLength()
Return the prefix to be used for the network interface

Returns:

setNetworkPrefixLength

public void setNetworkPrefixLength(short networkPrefixLength)
                            throws EsfException
Sets the prefix length to be used for the network interface

Parameters:
networkPrefixLength -
Throws:
EsfException

getSubnetMask

public T getSubnetMask()
Return the prefix to be used for the network interface

Returns:

setSubnetMask

public void setSubnetMask(T subnetMask)
                   throws EsfException
Sets the subnet mask to be used for the network interface

Parameters:
subnetMask -
Throws:
EsfException

getGateway

public T getGateway()
Returns the address of the gateway to be used for the interface

Returns:

setGateway

public void setGateway(T gateway)
Sets the gateway to be used for the interface

Parameters:
gateway -

getDnsServers

public List<T> getDnsServers()
Returns the list of Name Servers to be associated to the interface. The returned addresses are IP4Address or IP6Address depending on the NetConfigIP instance used. This is only used if dhcp is set to false.

Returns:
list of address for the DNS Servers

setDnsServers

public void setDnsServers(List<T> dnsServers)
Sets the list of Name Servers to be associated to the interface. The addresses are IP4Address or IP6Address depending on the NetConfigIP instance used. This is only used if dhcp is set to false.


getDomains

public List<String> getDomains()
Returns the list of DNS domains to be associated to the interface. This is only used if dhcp is set to false.

Returns:
- list of DNS domains

setDomains

public void setDomains(List<String> domains)
Sets the list of DNS domains to be associated to the interface. This is only used if dhcp is set to false.

Parameters:
domains -

getProperties

public Map<String,Object> getProperties()

setProperties

public void setProperties(Map<String,Object> properties)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

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


Copyright © 2013. All Rights Reserved.