com.esf.device.network.service
Class NetworkDeviceContainer

java.lang.Object
  extended by com.esf.device.network.service.NetworkDeviceContainer

public class NetworkDeviceContainer
extends java.lang.Object

Container class for @INetworkDevice parameters Copyright � 2009 Eurotech Inc. All rights reserved.


Constructor Summary
NetworkDeviceContainer()
          Constructor to define an empty @NetworknetDeviceContainer
NetworkDeviceContainer(java.lang.String iface)
          Constructor to define a fully populated DHCP @NetworkDeviceContainer
NetworkDeviceContainer(java.lang.String iface, int type)
          Constructor to define a fully populated DHCP @NetworkDeviceContainer
NetworkDeviceContainer(java.lang.String iface, int type, java.lang.String ipAddress, java.lang.String netmask, java.lang.String network, java.lang.String broadcast, java.lang.String gateway, java.lang.String primaryDns, java.lang.String secondaryDns)
          Constructor to define a fully populated STATIC @NetworkDeviceContainer
 
Method Summary
 java.lang.String getBroadcast()
          Gets the broadcast address for this interface
 java.lang.String getGateway()
          Gets the gateway address associated with this interface
 int getGatewayMetric()
          gets the gateway metric number associated with this interface
 java.lang.String getIface()
          Gets the interface associated with this interface
 java.lang.String getIpAddress()
          Gets the IP address associated with this interface
 java.lang.String getNetmask()
          Gets the network mask for this interface
 java.lang.String getNetwork()
          Gets the network that is currently defined for this interface
 java.lang.String getPrimaryDns()
          Gets the primary DNS address associated with this interface
 java.lang.String getSecondaryDns()
          Gets the secondary DNS address associated with this interface
 int getType()
          Gets the type associated with this interface
 boolean isOnBoot()
          checks to see if the flag is set to denote the interface should come up on boot
 void setBroadcast(java.lang.String broadcast)
          Sets the broadcast address for this interface
 void setGateway(java.lang.String gateway)
          Sets the gateway address for this interface
 void setGatewayMetric(int gatewayMetric)
          sets the gateway metric number to be associated with this interface
 void setIface(java.lang.String iface)
          Sets the interface associated with this interface
 void setIpAddress(java.lang.String ipAddress)
          Sets the IP address for this interface
 void setNetmask(java.lang.String netmask)
          Sets the network mask for this interface
 void setNetwork(java.lang.String network)
          Sets the network for this interface
 void setOnBoot(boolean onBoot)
          sets the flag to denote this interface should come up on boot
 void setPrimaryDns(java.lang.String primaryDns)
          Sets the primary DNS address for this interface
 void setSecondaryDns(java.lang.String secondaryDns)
          Sets the secondary DNS address for this interface
 void setType(int type)
          Sets the type to be associated with this interface
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkDeviceContainer

public NetworkDeviceContainer(java.lang.String iface,
                              int type,
                              java.lang.String ipAddress,
                              java.lang.String netmask,
                              java.lang.String network,
                              java.lang.String broadcast,
                              java.lang.String gateway,
                              java.lang.String primaryDns,
                              java.lang.String secondaryDns)
                       throws java.lang.Exception
Constructor to define a fully populated STATIC @NetworkDeviceContainer

Parameters:
iface - the logical interface name for a given network device
type - the type of a addressing that will be used for this @NetworkDeviceContainer, either @INetworkDeviceService.DHCP or
ipAddress - the IP address to be assigned to this interface. This is only valid if type is STATIC
netmask - the network mask to be assigned to this interface. This is only valid if type is STATIC
network - the network to be assigned to this interface. This is only valid if type is STATIC
broadcast - the broadcast address to be assigned to this interface. This is only valid if type is STATIC
gateway - the gateway to be assigned to this interface. This is only valid if type is STATIC
primaryDns - the primary DNS to be assigned to this interface. This is only valid if type is STATIC
secondaryDns - the secondary DNS to be assigned to this interface. This is only valid if type is STATIC
Throws:
java.lang.Exception - if the parameters are invalid

NetworkDeviceContainer

public NetworkDeviceContainer(java.lang.String iface,
                              int type)
                       throws java.lang.Exception
Constructor to define a fully populated DHCP @NetworkDeviceContainer

Parameters:
iface - the logical interface name for a given Ethernet device
type - the type of a addressing that will be used for this @NetworkDeviceContainer, either @INetworkDeviceService.DHCP or
Throws:
java.lang.Exception - if the parameters are invalid

NetworkDeviceContainer

public NetworkDeviceContainer(java.lang.String iface)
Constructor to define a fully populated DHCP @NetworkDeviceContainer

Parameters:
iface - the logical interface name for a given nthernet device

NetworkDeviceContainer

public NetworkDeviceContainer()
                       throws java.lang.Exception
Constructor to define an empty @NetworknetDeviceContainer

Throws:
java.lang.Exception - if there is an error
Method Detail

getIface

public java.lang.String getIface()
Gets the interface associated with this interface

Returns:
the name of the interface, as @String

setIface

public void setIface(java.lang.String iface)
Sets the interface associated with this interface

Parameters:
iface - the new interface to assign to this @NetworkDeviceContainer

getType

public int getType()
Gets the type associated with this interface

Returns:
the type (DHCP or STATIC) associated with this @NetworkDeviceContainer

setType

public void setType(int type)
             throws java.lang.Exception
Sets the type to be associated with this interface

Parameters:
type - the type (DHCP or STATIC) to be associated with this @NetworkDeviceContainer
Throws:
java.lang.Exception - if the type is not valid

getIpAddress

public java.lang.String getIpAddress()
Gets the IP address associated with this interface

Returns:
the specified IP address with this interface

setIpAddress

public void setIpAddress(java.lang.String ipAddress)
                  throws java.lang.Exception
Sets the IP address for this interface

Parameters:
ipAddress - the IP address to specify for this interface
Throws:
java.lang.Exception - if the address is not valid or if the type is set to DHCP

getNetmask

public java.lang.String getNetmask()
Gets the network mask for this interface

Returns:
the network mask for this interface

setNetmask

public void setNetmask(java.lang.String netmask)
                throws java.lang.Exception
Sets the network mask for this interface

Parameters:
netmask - the network mask to specify for this interface
Throws:
java.lang.Exception - if the network mask is not valid or if the type is set to DHCP

getNetwork

public java.lang.String getNetwork()
Gets the network that is currently defined for this interface

Returns:
the network that is currently defined for this interface

setNetwork

public void setNetwork(java.lang.String network)
                throws java.lang.Exception
Sets the network for this interface

Parameters:
network - the network to specify for this interface
Throws:
java.lang.Exception - if the network is not valid or if the type is set to DHCP

getBroadcast

public java.lang.String getBroadcast()
Gets the broadcast address for this interface

Returns:
the broadcast address currently defined for this interface

setBroadcast

public void setBroadcast(java.lang.String broadcast)
                  throws java.lang.Exception
Sets the broadcast address for this interface

Parameters:
broadcast - the broadcast address to specify for this interface
Throws:
java.lang.Exception - if the broadcast address is not valid or if the type is set to DHCP

getGateway

public java.lang.String getGateway()
Gets the gateway address associated with this interface

Returns:
the gateway address currently defined for this interface

setGateway

public void setGateway(java.lang.String gateway)
                throws java.lang.Exception
Sets the gateway address for this interface

Parameters:
gateway - the gateway address to specify for this interface
Throws:
java.lang.Exception - if the gateway address is not valid or if the type is set to DHCP

getPrimaryDns

public java.lang.String getPrimaryDns()
Gets the primary DNS address associated with this interface

Returns:
the primary DNS address currently defined for this interface

setPrimaryDns

public void setPrimaryDns(java.lang.String primaryDns)
                   throws java.lang.Exception
Sets the primary DNS address for this interface

Parameters:
primaryDns - the primary DNS address to specify for this interface
Throws:
java.lang.Exception - if the primary DNS address is not valid or if the type is set to DHCP

getSecondaryDns

public java.lang.String getSecondaryDns()
Gets the secondary DNS address associated with this interface

Returns:
the secondary DNS address currently defined for this interface

setSecondaryDns

public void setSecondaryDns(java.lang.String secondaryDns)
                     throws java.lang.Exception
Sets the secondary DNS address for this interface

Parameters:
secondaryDns - the secondary DNS address to specify for this interface
Throws:
java.lang.Exception - if the secondary DNS address is not valid or if the type is set to DHCP

isOnBoot

public boolean isOnBoot()
checks to see if the flag is set to denote the interface should come up on boot

Returns:
true if this interface is defined to some up on boot

setOnBoot

public void setOnBoot(boolean onBoot)
sets the flag to denote this interface should come up on boot

Parameters:
onBoot - the new value to denote the the interface should come up at boot

getGatewayMetric

public int getGatewayMetric()
gets the gateway metric number associated with this interface

Returns:
an int representing the gateway metric

setGatewayMetric

public void setGatewayMetric(int gatewayMetric)
sets the gateway metric number to be associated with this interface

Parameters:
gatewayMetric - an int representing the gateway metric to set