|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Manages Ethernet device configurations.
Field Summary | |
static java.lang.String |
SERVICE_NAME
Reports the class name representing this interface. |
static int |
TYPE_DHCP
definition for an Ethernet interface that uses DHCP for configuration |
static int |
TYPE_NULL
definition for an Ethernet interface that is not configured |
static int |
TYPE_STATIC
definition for an Ethernet interface that is statically configured |
Method Summary | |
void |
bringInterfaceDown(EthernetDevice ethernetDevice)
brings an Ethernet interface down |
void |
bringInterfaceDown(java.lang.String ifaceName)
brings an Ethernet interface down |
void |
bringInterfaceUp(EthernetDevice ethernetDevice,
int state)
brings an Ethernet interface up using the parameters currently set in in the specified Persistence field. |
java.lang.String |
getBroadcast(java.lang.String iface,
int state)
gets the broadcast address associated with this interface and state |
java.lang.String |
getGateway(java.lang.String iface,
int state)
gets the gateway address associated with this interface and state |
java.util.ArrayList |
getIfaceNames()
returns a list of interface names present on this system |
java.lang.String |
getIpAddress(java.lang.String iface,
int state)
gets the IP address associated with this interface and state |
java.lang.String |
getNetmask(java.lang.String iface,
int state)
gets the network mask associated with this interface and state |
java.lang.String |
getNetwork(java.lang.String iface,
int state)
gets the network associated with this interface and state |
EthernetDevice |
getParameters(java.lang.String iface,
int state)
gets all of the parameters that make up an EthernetDevice for a specified state. |
int |
getType(java.lang.String iface,
int state)
gets the defined type (DHCP or STATIC) from either the OS configuration, the ESF configuration, or the currently running configuration |
boolean |
isIfaceUp(java.lang.String iface)
gets the state of an Ethernet interface |
void |
setBroadcast(java.lang.String iface,
int persistence,
java.lang.String broadcast)
sets the broadcast for an interface that has been defined to be statically defined |
void |
setGateway(java.lang.String iface,
int persistence,
java.lang.String gateway)
sets the default gateway for an interface that has been defined to be statically defined |
void |
setIpAddress(java.lang.String iface,
int persistence,
java.lang.String ipAddress)
sets the IP address for an interface that has been defined to be statically defined |
void |
setNetmask(java.lang.String iface,
int persistence,
java.lang.String netmask)
sets the network mask for an interface that has been defined to be statically defined |
void |
setNetwork(java.lang.String iface,
int persistence,
java.lang.String network)
sets the network definition for an interface that has been defined to be statically defined |
void |
setToDhcp(java.lang.String iface,
int persistence)
sets the method used to configure a particular interface to use either DHCP. |
void |
setToNull(java.lang.String iface,
int persistence)
removes the configuration currently set for a specified persistence level |
void |
setToStatic(java.lang.String iface,
int persistence,
java.lang.String ipAddress,
java.lang.String netmask,
java.lang.String network,
java.lang.String broadcast,
java.lang.String gateway)
sets the parameters of a statically defined Ethernet interface. |
Field Detail |
public static final java.lang.String SERVICE_NAME
public static final int TYPE_DHCP
public static final int TYPE_STATIC
public static final int TYPE_NULL
Method Detail |
public java.util.ArrayList getIfaceNames() throws java.lang.Exception
java.lang.Exception
- if the platform is improperly defined, not supported, or not definedpublic void setToDhcp(java.lang.String iface, int persistence) throws java.lang.Exception
iface
- the interface being set as either DHCP or staticpersistence
- should use the definition in com.esf.core.persistence.service.Persistence. This allows configuration to be saved
to OS config files, the ESF config files, or both. It also defines whether or not the new settings should take
affect immediately or just be stored to their respective configuration files.
java.lang.Exception
- if any parameters are invalid or the iface can not be foundpublic void setToStatic(java.lang.String iface, int persistence, java.lang.String ipAddress, java.lang.String netmask, java.lang.String network, java.lang.String broadcast, java.lang.String gateway) throws java.lang.Exception
iface
- the interface to configurepersistence
- should use the definition in com.esf.core.persistence.service.Persistence. This allows configuration to be saved
to OS config files, the ESF config files, or both. It also defines whether or not the new settings should take
affect immediately or just be stored to their respective configuration files.ipAddress
- the static IP address to setnetmask
- the network mask to setnetwork
- the network to set (for example 192.168.1.0)broadcast
- the broadcast address to setgateway
- the gateway to use
java.lang.Exception
- if any parameters are invalid or if any errors occur in making the changes persistentpublic void setIpAddress(java.lang.String iface, int persistence, java.lang.String ipAddress) throws java.lang.Exception
iface
- the interface to configurepersistence
- should use the definition in com.esf.core.persistence.service.Persistence. This allows configuration to be saved
to OS config files, the ESF config files, or both. It also defines whether or not the new settings should take
affect immediatly or just be stored to their respective configuration files.ipAddress
- the new static IP address to set
java.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCP or if takeEffectNow is true and the interface is not uppublic void setToNull(java.lang.String iface, int persistence) throws java.lang.Exception
iface
- the interface to delete the configuration ofpersistence
- the persistence level for which the configuration should be deleted
java.lang.Exception
- if the parameters are invalidpublic void setNetmask(java.lang.String iface, int persistence, java.lang.String netmask) throws java.lang.Exception
iface
- the interface to configurepersistence
- should use the definition in com.esf.core.persistence.service.Persistence. This allows configuration to be saved
to OS config files, the ESF config files, or both. It also defines whether or not the new settings should take
affect immediately or just be stored to their respective configuration files.netmask
- the new network mask to use
java.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCP or if takeEffectNow is true and the interface is not uppublic void setNetwork(java.lang.String iface, int persistence, java.lang.String network) throws java.lang.Exception
iface
- the interface to configurepersistence
- should use the definition in com.esf.core.persistence.service.Persistence. This allows configuration to be saved
to OS config files, the ESF config files, or both. It also defines whether or not the new settings should take
affect immediately or just be stored to their respective configuration files.network
- the new network definition to use
java.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCP or if takeEffectNow is true and the interface is not uppublic void setBroadcast(java.lang.String iface, int persistence, java.lang.String broadcast) throws java.lang.Exception
iface
- the interface to configurepersistence
- should use the definition in com.esf.core.persistence.service.Persistence. This allows configuration to be saved
to OS config files, the ESF config files, or both. It also defines whether or not the new settings should take
affect immediateely or just be stored to their respective configuration files.broadcast
- the new broadcast definition to use
java.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCP or if takeEffectNow is true and the interface is not uppublic void setGateway(java.lang.String iface, int persistence, java.lang.String gateway) throws java.lang.Exception
iface
- the interface to configurepersistence
- should use the definition in com.esf.core.persistence.service.Persistence. This allows configuration to be saved
to OS config files, the ESF config files, or both. It also defines whether or not the new settings should take
affect immediately or just be stored to their respective configuration files.gateway
- the new gateway to use
java.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCP or if takeEffectNow is true and the interface is not uppublic int getType(java.lang.String iface, int state) throws java.lang.Exception
iface
- the interface to get the type fromstate
- the type of configuration to get. Must be either Persistence.OS_STATE, Persistence.ESF_STATE, or Persistence.CURRENT_STATE
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validpublic EthernetDevice getParameters(java.lang.String iface, int state) throws java.lang.Exception
iface
- the interface to get the configuration ofstate
- the state of configuration to get. This is either Persistence.OS_STATE, Persistence.ESF_STATE, or Persistence.CURRENT_STATE
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validpublic java.lang.String getIpAddress(java.lang.String iface, int state) throws java.lang.Exception
iface
- the interface to get the IP address ofstate
- the state of configuration to get. This is either Persistence.OS_STATE, Persistence.ESF_STATE, or Persistence.CURRENT_STATE
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validpublic java.lang.String getNetmask(java.lang.String iface, int state) throws java.lang.Exception
iface
- the interface to get the network mask ofstate
- the state of configuration to get. This is either Persistence.OS_STATE, Persistence.ESF_STATE, or Persistence.CURRENT_STATE
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validpublic java.lang.String getNetwork(java.lang.String iface, int state) throws java.lang.Exception
iface
- the interface to get the network ofstate
- the state of configuration to get. This is either Persistence.OS_STATE, Persistence.ESF_STATE, or Persistence.CURRENT_STATE
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validpublic java.lang.String getBroadcast(java.lang.String iface, int state) throws java.lang.Exception
iface
- the interface to get the broadcast address ofstate
- the state of configuration to get. This is either Persistence.OS_STATE, Persistence.ESF_STATE, or Persistence.CURRENT_STATE
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validpublic java.lang.String getGateway(java.lang.String iface, int state) throws java.lang.Exception
iface
- the interface to get the gateway address ofstate
- the state of configuration to get. This is either Persistence.OS_STATE, Persistence.ESF_STATE, or Persistence.CURRENT_STATE
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validpublic void bringInterfaceUp(EthernetDevice ethernetDevice, int state) throws java.lang.Exception
ethernetDevice
- the EthernetDevice to bring upstate
- the persistence state to use when bringing up the interface
java.lang.Exception
- if the iface is invalid or if the interface is not properly configuredpublic void bringInterfaceDown(EthernetDevice ethernetDevice) throws java.lang.Exception
ethernetDevice
- the EthernetDevice to bring down
java.lang.Exception
- if the iface is invalid or if the interface is not uppublic void bringInterfaceDown(java.lang.String ifaceName) throws java.lang.Exception
ifaceName
- the interface name to bring down
java.lang.Exception
- if the ifaceName is invalid or if the interface is not uppublic boolean isIfaceUp(java.lang.String iface) throws java.lang.Exception
iface
- the interface to check for its status
java.lang.Exception
- if the interface is invalid
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |