com.eurotech.framework.net.admin
Class NetworkAdminServiceImpl

java.lang.Object
  extended by com.eurotech.framework.net.admin.NetworkAdminServiceImpl
All Implemented Interfaces:
NetworkAdminService, org.osgi.service.event.EventHandler

public class NetworkAdminServiceImpl
extends Object
implements NetworkAdminService, org.osgi.service.event.EventHandler


Constructor Summary
NetworkAdminServiceImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
           
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
           
 void disableInterface(String interfaceName)
          Disables the specified interface.
 void enableInterface(String interfaceName, boolean dhcp)
          Enables the specified interface.
 List<NetConfig> getFirewallConfiguration()
          Gets the firewall configuration of the system as currently specified
 List<? extends NetInterfaceConfig<? extends NetInterfaceAddressConfig>> getNetworkInterfaceConfigs()
          Returns a list of all of the configurations associated with all of the interfaces on the system.
 List<NetConfig> getNetworkInterfaceConfigs(String interfaceName)
          Returns the configuration information for the specified NetworkInterface name.
 void handleEvent(org.osgi.service.event.Event event)
           
 void manageDhcpServer(String interfaceName, boolean enable)
          Used to control DHCP servers on specified interfaces.
 void manageFirewall(String gatewayIface)
          Updates the Firewall configuration based on current environmental conditions.
 void renewDhcpLease(String interfaceName)
          Releases current IP address and acquires a new lease for the provided interface.
 void setConfigurationService(ConfigurationService configurationService)
           
 void setFirewallOpenPortConfiguration(List<FirewallOpenPortConfigIP<? extends IPAddress>> firewallConfiguration)
          Sets the 'open port' portion of the firewall configuration
 void setFirewallPortForwardingConfiguration(List<FirewallPortForwardConfigIP<? extends IPAddress>> firewallConfiguration)
          Sets the 'port forwarding' portion of the firewall configuration
 void setNetworkConfigurationService(NetworkConfigurationService networkConfigurationService)
           
 void unNetworkConfigurationService(NetworkConfigurationService networkConfigurationService)
           
 void unsetConfigurationService(ConfigurationService configurationService)
           
 void updateEthernetInterfaceConfig(String interfaceName, boolean autoConnect, int mtu, List<NetConfig> netConfigs)
          Updates the configuration of the specified EthernetInterface.
 void updateModemInterfaceConfig(String interfaceName, String serialNum, String modemId, int pppNumber, boolean autoConnect, int mtu, List<NetConfig> netConfigs)
          Updates the configuration of the specified ModemInterface.
 void updateWifiInterfaceConfig(String interfaceName, boolean autoConnect, WifiAccessPoint accessPoint, List<NetConfig> netConfigs)
          Updates the configuration of the specified WifiInterface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkAdminServiceImpl

public NetworkAdminServiceImpl()
Method Detail

setConfigurationService

public void setConfigurationService(ConfigurationService configurationService)

unsetConfigurationService

public void unsetConfigurationService(ConfigurationService configurationService)

setNetworkConfigurationService

public void setNetworkConfigurationService(NetworkConfigurationService networkConfigurationService)

unNetworkConfigurationService

public void unNetworkConfigurationService(NetworkConfigurationService networkConfigurationService)

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)

deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)

getNetworkInterfaceConfigs

public List<? extends NetInterfaceConfig<? extends NetInterfaceAddressConfig>> getNetworkInterfaceConfigs()
                                                                                                   throws EsfException
Description copied from interface: NetworkAdminService
Returns a list of all of the configurations associated with all of the interfaces on the system.

Specified by:
getNetworkInterfaceConfigs in interface NetworkAdminService
Returns:
list of NetInterfaceConfigs on the system
Throws:
EsfException

getNetworkInterfaceConfigs

public List<NetConfig> getNetworkInterfaceConfigs(String interfaceName)
                                           throws EsfException
Description copied from interface: NetworkAdminService
Returns the configuration information for the specified NetworkInterface name. The returned NetConfig captured how the interface was configured; the returned list will have a NetConfig4 instance for IPv4 and an NetConfig6 instance for IPv6. This should not be confused with the currently active NetInterfaceAddress associated with the NetInterface.

Specified by:
getNetworkInterfaceConfigs in interface NetworkAdminService
Returns:
list of NetConfig for this interface.
Throws:
EsfException

updateEthernetInterfaceConfig

public void updateEthernetInterfaceConfig(String interfaceName,
                                          boolean autoConnect,
                                          int mtu,
                                          List<NetConfig> netConfigs)
                                   throws EsfException
Description copied from interface: NetworkAdminService
Updates the configuration of the specified EthernetInterface.

Specified by:
updateEthernetInterfaceConfig in interface NetworkAdminService
Parameters:
interfaceName - - name of the Ethernet interface
autoConnect - - specifies the auto-connect value for the interface
mtu - - required MTU for the interface, -1 to keep the automatic default
Throws:
EsfException

updateWifiInterfaceConfig

public void updateWifiInterfaceConfig(String interfaceName,
                                      boolean autoConnect,
                                      WifiAccessPoint accessPoint,
                                      List<NetConfig> netConfigs)
                               throws EsfException
Description copied from interface: NetworkAdminService
Updates the configuration of the specified WifiInterface.

Specified by:
updateWifiInterfaceConfig in interface NetworkAdminService
Parameters:
interfaceName - - name of the wifi interface
autoConnect - - specifies the auto-connect value for the interface
Throws:
EsfException

updateModemInterfaceConfig

public void updateModemInterfaceConfig(String interfaceName,
                                       String serialNum,
                                       String modemId,
                                       int pppNumber,
                                       boolean autoConnect,
                                       int mtu,
                                       List<NetConfig> netConfigs)
                                throws EsfException
Description copied from interface: NetworkAdminService
Updates the configuration of the specified ModemInterface.

Specified by:
updateModemInterfaceConfig in interface NetworkAdminService
Parameters:
interfaceName - - name of the Modem interface
serialNum - - the modem's serial number
modemId - - user string to identify the modem
pppNumber - - ppp number to use for this interface
autoConnect - - specifies the auto-connect value for the interface
mtu - - required MTU for the interface, -1 to keep the automatic default
netConfigs - - list of NetConfigs for this interface
Throws:
EsfException

enableInterface

public void enableInterface(String interfaceName,
                            boolean dhcp)
                     throws EsfException
Description copied from interface: NetworkAdminService
Enables the specified interface.

Specified by:
enableInterface in interface NetworkAdminService
Parameters:
interfaceName - - name of the interface to be enabled.
Throws:
EsfException

disableInterface

public void disableInterface(String interfaceName)
                      throws EsfException
Description copied from interface: NetworkAdminService
Disables the specified interface.

Specified by:
disableInterface in interface NetworkAdminService
Parameters:
interfaceName - - name of the interface to be disabled.
Throws:
EsfException

manageDhcpServer

public void manageDhcpServer(String interfaceName,
                             boolean enable)
                      throws EsfException
Description copied from interface: NetworkAdminService
Used to control DHCP servers on specified interfaces.

Specified by:
manageDhcpServer in interface NetworkAdminService
Parameters:
interfaceName - The interface of the DHCP server to modify the state
enable - Whether to enable or disable the DHCP server
Throws:
EsfException

renewDhcpLease

public void renewDhcpLease(String interfaceName)
                    throws EsfException
Description copied from interface: NetworkAdminService
Releases current IP address and acquires a new lease for the provided interface.

Specified by:
renewDhcpLease in interface NetworkAdminService
Parameters:
interfaceName - The interface on which to renew the lease
Throws:
EsfException

manageFirewall

public void manageFirewall(String gatewayIface)
                    throws EsfException
Description copied from interface: NetworkAdminService
Updates the Firewall configuration based on current environmental conditions. This is used to update the firewall in events where NAT rules need to change based on a new WAN interface coming up or going down. This ensures all downstream clients utilizing NAT on the gateway can and will maintain active Internet connections through the gateway.

Specified by:
manageFirewall in interface NetworkAdminService
Parameters:
gatewayIface - The new gateway interface that is now active as the WAN interface
Throws:
EsfException

getFirewallConfiguration

public List<NetConfig> getFirewallConfiguration()
                                         throws EsfException
Description copied from interface: NetworkAdminService
Gets the firewall configuration of the system as currently specified

Specified by:
getFirewallConfiguration in interface NetworkAdminService
Returns:
A list of NetConfigs representing the firewall configuration
Throws:
EsfException

setFirewallOpenPortConfiguration

public void setFirewallOpenPortConfiguration(List<FirewallOpenPortConfigIP<? extends IPAddress>> firewallConfiguration)
                                      throws EsfException
Description copied from interface: NetworkAdminService
Sets the 'open port' portion of the firewall configuration

Specified by:
setFirewallOpenPortConfiguration in interface NetworkAdminService
Parameters:
firewallConfiguration - A list of FirewallOpenPortConfigIP Objects representing the configuration to set
Throws:
EsfException

setFirewallPortForwardingConfiguration

public void setFirewallPortForwardingConfiguration(List<FirewallPortForwardConfigIP<? extends IPAddress>> firewallConfiguration)
                                            throws EsfException
Description copied from interface: NetworkAdminService
Sets the 'port forwarding' portion of the firewall configuration

Specified by:
setFirewallPortForwardingConfiguration in interface NetworkAdminService
Parameters:
firewallConfiguration - A list of FirewallPortForwardConfigIP Objects representing the configuration to set
Throws:
EsfException

handleEvent

public void handleEvent(org.osgi.service.event.Event event)
Specified by:
handleEvent in interface org.osgi.service.event.EventHandler


Copyright © 2013. All Rights Reserved.