public interface INetworkDeviceService
IEthernetDeviceService
and
the IWifiDeviceService
which are then in turn implemented.
Copyright (c) 2009 Eurotech Inc. All rights reserved.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVICE_NAME
Reports the class name representing this interface.
|
static int |
TYPE_DHCP
Definition for an interface that uses DHCP for configuration
|
static int |
TYPE_L2
Definition for an interface that specified 'DEVICE' only.
|
static int |
TYPE_NULL
Definition for an interface that is not configured
|
static int |
TYPE_STATIC
Definition for an interface that is statically configured
|
Modifier and Type | Method and Description |
---|---|
void |
bringInterfaceDown(NetworkDeviceContainer networkDeviceContainer)
Brings an interface down
|
void |
bringInterfaceDown(java.lang.String ifaceName)
Brings an interface down
|
void |
bringInterfaceUp(NetworkDeviceContainer device)
Brings an interface up using the parameters currently set.
|
void |
bringInterfaceUp(java.lang.String ifaceName)
Brings an interface up using the parameters currently set.
|
java.lang.String |
getBroadcast(java.lang.String iface)
Gets the broadcast address currently associated with this interface
|
java.lang.String |
getGateway(java.lang.String iface)
Gets the gateway address currently associated with this interface
|
java.util.ArrayList |
getIfaceNames()
Returns a list of interface names present on this system
|
java.lang.String |
getIpAddress(java.lang.String iface)
Gets the IP address currently associated with this interface
|
java.lang.String |
getMacAddress(java.lang.String ifaceName)
Gets the MAC address of a specified interfaces
|
java.lang.String |
getNetmask(java.lang.String iface)
Gets the network mask currently associated with this interface
|
java.lang.String |
getNetwork(java.lang.String iface)
Gets the network currently associated with this interface
|
NetworkDeviceContainer |
getParameters(java.lang.String iface)
Gets all of the parameters that currently make up an EthernetDevice.
|
java.lang.String |
getPrimaryDns(java.lang.String iface)
Gets the primary DNS address currently associated with this interface
|
java.lang.String |
getSecondaryDns(java.lang.String iface)
Gets the secondary DNS address currently associated with this interface
|
int |
getType(java.lang.String iface)
Gets the defined type (DHCP or STATIC) from the currently running configuration
|
boolean |
isIfaceUp(java.lang.String iface)
Gets the state of an interface
|
void |
setBroadcast(java.lang.String iface,
java.lang.String broadcast)
Sets the broadcast for an interface that has been defined to be statically defined.
|
void |
setGateway(java.lang.String iface,
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,
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,
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,
java.lang.String network)
Sets the network definition for an interface that has been defined to be statically defined.
|
void |
setNetworkDevice(java.util.ArrayList containers)
Sets network device based on supplied network device containers.
|
void |
setNetworkDevice(NetworkDeviceContainer container)
Sets network device based on supplied network device container.
|
void |
setNetworkDevice(NetworkDeviceContainer[] containers)
Sets network device based on supplied network device containers.
|
void |
setPrimaryDns(java.lang.String iface,
java.lang.String primaryDns)
Sets the primary DNS for an interface that has been defined to be statically defined.
|
void |
setSecondaryDns(java.lang.String iface,
java.lang.String secondaryDns)
Sets the secondary DNS for an interface that has been defined to be statically defined.
|
void |
setToDhcp(java.lang.String iface)
Sets the method used to configure a particular interface to use either DHCP.
|
void |
setToNull(java.lang.String iface)
Removes the configuration currently set and disables the interface.
|
void |
setToStatic(java.lang.String iface,
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)
Sets the parameters of a statically defined interface.
|
static final java.lang.String SERVICE_NAME
static final int TYPE_DHCP
static final int TYPE_STATIC
static final int TYPE_NULL
static final int TYPE_L2
java.util.ArrayList getIfaceNames() throws java.lang.Exception
ArrayList
of String
representing the interface names present on this systemjava.lang.Exception
- if the platform is improperly defined, not supported, or not definedvoid setToDhcp(java.lang.String iface) throws java.lang.Exception
iface
- the interface being set as either DHCP or staticjava.lang.Exception
- if any parameters are invalid or the iface can not be foundvoid setToStatic(java.lang.String iface, 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
iface
- the interface to configureipAddress
- 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 useprimaryDns
- the primary DNS to usesecondaryDns
- the secondary DNS to usejava.lang.Exception
- if any parameters are invalidvoid setNetworkDevice(NetworkDeviceContainer container) throws java.lang.Exception
container
- - network device container as NetworkDeviceContainer
java.lang.Exception
void setNetworkDevice(NetworkDeviceContainer[] containers) throws java.lang.Exception
containers
- - network device containers as NetworkDeviceContainer
java.lang.Exception
void setNetworkDevice(java.util.ArrayList containers) throws java.lang.Exception
containers
- - network device containers as ArrayList
java.lang.Exception
void setIpAddress(java.lang.String iface, java.lang.String ipAddress) throws java.lang.Exception
iface
- the interface to configureipAddress
- the new static IP address to setjava.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCPvoid setToNull(java.lang.String iface) throws java.lang.Exception
iface
- the interface which will have its current running configuration deletedjava.lang.Exception
- if the parameters are invalid.void setNetmask(java.lang.String iface, java.lang.String netmask) throws java.lang.Exception
iface
- the interface to configurenetmask
- the new network mask to usejava.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCPvoid setNetwork(java.lang.String iface, java.lang.String network) throws java.lang.Exception
iface
- the interface to configurenetwork
- the new network definition to usejava.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCPvoid setBroadcast(java.lang.String iface, java.lang.String broadcast) throws java.lang.Exception
iface
- the interface to configurebroadcast
- the new broadcast definition to usejava.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCPvoid setGateway(java.lang.String iface, java.lang.String gateway) throws java.lang.Exception
iface
- the interface to configuregateway
- the new gateway to usejava.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCPvoid setPrimaryDns(java.lang.String iface, java.lang.String primaryDns) throws java.lang.Exception
iface
- the interface to configureprimaryDns
- the new primary DNS to usejava.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCPvoid setSecondaryDns(java.lang.String iface, java.lang.String secondaryDns) throws java.lang.Exception
iface
- the interface to configuresecondaryDns
- the new secondary DNS to usejava.lang.Exception
- if any parameters are invalid, if the interface to set is configured to use DHCPint getType(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the type fromIEthernetDeviceService.TYPE_DHCP
or IEthernetDeviceService.TYPE_STATIC
java.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validNetworkDeviceContainer getParameters(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the configuration ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validjava.lang.String getIpAddress(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the IP address ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validjava.lang.String getNetmask(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the network mask ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validjava.lang.String getNetwork(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the network ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validjava.lang.String getBroadcast(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the broadcast address ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validjava.lang.String getGateway(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the gateway address ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validjava.lang.String getPrimaryDns(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the primary DNS address ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validjava.lang.String getSecondaryDns(java.lang.String iface) throws java.lang.Exception
iface
- the interface to get the secondary DNS address ofjava.lang.Exception
- if there is an error, the type is not defined, or if the interface is not validvoid bringInterfaceUp(NetworkDeviceContainer device) throws java.lang.Exception
bringInterfaceDown(String iface)
before bringing the interface up. This ensures it comes up in a clean state.
The interface will come up using the parameters set for this interface.device
- the NetworkDeviceContainer
to bring upjava.lang.Exception
- if the iface is invalid or if the interface is not properly configuredvoid bringInterfaceUp(java.lang.String ifaceName) throws java.lang.Exception
bringInterfaceDown(String iface)
before bringing the interface up. This ensures it comes up in a clean state.
The interface will come up using the parameters set for this interface.ifaceName
- the interface name to bring upjava.lang.Exception
- if the iface is invalid or if the interface is not properly configuredvoid bringInterfaceDown(NetworkDeviceContainer networkDeviceContainer) throws java.lang.Exception
networkDeviceContainer
- the NetworkDeviceContainer
to bring downjava.lang.Exception
- if the iface is invalid or if the interface is not upvoid bringInterfaceDown(java.lang.String ifaceName) throws java.lang.Exception
ifaceName
- the interface name to bring downjava.lang.Exception
- if the ifaceName is invalid or if the interface is not upboolean isIfaceUp(java.lang.String iface) throws java.lang.Exception
iface
- the interface to check for its statusjava.lang.Exception
- if the interface is invalidjava.lang.String getMacAddress(java.lang.String ifaceName) throws java.lang.Exception
ifaceName
- the interface to get the MAC id ofjava.lang.Exception
Copyright © 2009 Eurotech Inc. All rights reserved.