com.esf.device.ethernet.service
Class EthernetDevice

java.lang.Object
  extended bycom.esf.device.ethernet.service.EthernetDevice

public class EthernetDevice
extends java.lang.Object

Container class for Ethernet device parameters


Constructor Summary
EthernetDevice()
          constructor to define an empty EthernetDevice
EthernetDevice(java.lang.String iface)
          constructor to define a fully populated DHCP EthernetDevice
EthernetDevice(java.lang.String iface, int type)
          constructor to define a fully populated DHCP EthernetDevice
EthernetDevice(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)
          constructor to define a fully populated STATIC EthernetDevice
 
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
 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 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

EthernetDevice

public EthernetDevice(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)
               throws java.lang.Exception
constructor to define a fully populated STATIC EthernetDevice

Parameters:
iface - the logical interface name for a given Ethernet device
type - the type of a addressing that will be used for this EthernetDevice, either IEthernetDeviceService.DHCP or IEthernetDeviceService.STATIC
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
Throws:
java.lang.Exception - if the parameters are invalid

EthernetDevice

public EthernetDevice(java.lang.String iface,
                      int type)
               throws java.lang.Exception
constructor to define a fully populated DHCP EthernetDevice

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

EthernetDevice

public EthernetDevice(java.lang.String iface)
constructor to define a fully populated DHCP EthernetDevice

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

EthernetDevice

public EthernetDevice()
               throws java.lang.Exception
constructor to define an empty EthernetDevice

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 EthernetDevice

getType

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

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

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 EthernetDevice
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 i 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

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


Copyright © 2009 Eurotech Inc. All rights reserved.