com.eurotech.framework.linux.net.rh
Class NetworkServiceImpl

java.lang.Object
  extended by com.eurotech.framework.linux.net.rh.NetworkServiceImpl
All Implemented Interfaces:
NetworkService, org.osgi.service.event.EventHandler

public class NetworkServiceImpl
extends Object
implements NetworkService, org.osgi.service.event.EventHandler


Field Summary
static String PPP_PEERS_DIR
           
 
Constructor Summary
NetworkServiceImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
           
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
           
 List<NetInterface<? extends NetInterfaceAddress>> getActiveNetworkInterfaces()
          Return the active NetworkIntefaces which have active connections for the system.
 List<String> getAllNetworkInterfaceNames()
          Gets the names of all the network interface attached to the system.
 List<WifiAccessPoint> getAllWifiAccessPoints()
          Returns the list of all available WifiAccessPoints as seen from the system.
 String getModemPppPort(ModemDevice modemDevice)
          Given a usb port address, look up the associated ppp interface name
 String getModemUsbPort(String interfaceName)
          Given an interface name (e.g.
 NetInterface<? extends NetInterfaceAddress> getNetworkInterface(String interfaceName)
           
 List<NetInterface<? extends NetInterfaceAddress>> getNetworkInterfaces()
          Gets the names of all the network interface attached to the system.
 NetworkState getState()
          Returns the overall state of the networking subsystem
 NetInterfaceState getState(String interfaceName)
          Returns the state of a specific network interface
 List<WifiAccessPoint> getWifiAccessPoints(String wifiInterfaceName)
          Returns the list of the WifiAccessPoints visible from the specified wifi network interface.
 void handleEvent(org.osgi.service.event.Event event)
           
 void setEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)
           
 void setUsbService(UsbService usbService)
           
 void unsetEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)
           
 void unsetUsbService(UsbService usbService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PPP_PEERS_DIR

public static final String PPP_PEERS_DIR
See Also:
Constant Field Values
Constructor Detail

NetworkServiceImpl

public NetworkServiceImpl()
Method Detail

setEventAdmin

public void setEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)

unsetEventAdmin

public void unsetEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)

setUsbService

public void setUsbService(UsbService usbService)

unsetUsbService

public void unsetUsbService(UsbService usbService)

activate

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

deactivate

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

getState

public NetworkState getState()
                      throws EsfException
Description copied from interface: NetworkService
Returns the overall state of the networking subsystem

Specified by:
getState in interface NetworkService
Throws:
EsfException

getState

public NetInterfaceState getState(String interfaceName)
                           throws EsfException
Description copied from interface: NetworkService
Returns the state of a specific network interface

Specified by:
getState in interface NetworkService
Throws:
EsfException

getAllNetworkInterfaceNames

public List<String> getAllNetworkInterfaceNames()
                                         throws EsfException
Description copied from interface: NetworkService
Gets the names of all the network interface attached to the system.

Specified by:
getAllNetworkInterfaceNames in interface NetworkService
Returns:
the names of all interfaces regardless of 'up' status
Throws:
EsfException

getNetworkInterfaces

public List<NetInterface<? extends NetInterfaceAddress>> getNetworkInterfaces()
                                                                       throws EsfException
Description copied from interface: NetworkService
Gets the names of all the network interface attached to the system. For each returned NetworkInterface, its currently active InterfaceAddresses are returned.

Specified by:
getNetworkInterfaces in interface NetworkService
Returns:
all NetworkInterfaces
Throws:
EsfException

getAllWifiAccessPoints

public List<WifiAccessPoint> getAllWifiAccessPoints()
                                             throws EsfException
Description copied from interface: NetworkService
Returns the list of all available WifiAccessPoints as seen from the system.

Specified by:
getAllWifiAccessPoints in interface NetworkService
Returns:
all access points accessible from the system.
Throws:
EsfException

getWifiAccessPoints

public List<WifiAccessPoint> getWifiAccessPoints(String wifiInterfaceName)
                                          throws EsfException
Description copied from interface: NetworkService
Returns the list of the WifiAccessPoints visible from the specified wifi network interface. If this wifiInterfaceName is in Master mode it will return a List with one WifiAccessPoint which is itself.

Specified by:
getWifiAccessPoints in interface NetworkService
Parameters:
wifiInterfaceName - name of the interface used to scan for the available access points
Returns:
the list of the WifiAccessPoints visible from the specified wifi network interface.
Throws:
EsfException

getActiveNetworkInterfaces

public List<NetInterface<? extends NetInterfaceAddress>> getActiveNetworkInterfaces()
                                                                             throws EsfException
Description copied from interface: NetworkService
Return the active NetworkIntefaces which have active connections for the system.

Specified by:
getActiveNetworkInterfaces in interface NetworkService
Returns:
Throws:
EsfException

getNetworkInterface

public NetInterface<? extends NetInterfaceAddress> getNetworkInterface(String interfaceName)
                                                                throws EsfException
Throws:
EsfException

handleEvent

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

getModemUsbPort

public String getModemUsbPort(String interfaceName)
Given an interface name (e.g. 'ppp0'), look up the associated usb port using the ppp peers config files

Specified by:
getModemUsbPort in interface NetworkService

getModemPppPort

public String getModemPppPort(ModemDevice modemDevice)
                       throws EsfException
Given a usb port address, look up the associated ppp interface name

Specified by:
getModemPppPort in interface NetworkService
Throws:
EsfException


Copyright © 2013. All Rights Reserved.