public class DeviceServiceAdapter extends Object implements DeviceService
| Constructor and Description | 
|---|
DeviceServiceAdapter()
Default constructor. 
 | 
DeviceServiceAdapter(List<Port> portList)
Constructor with port list. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addListener(DeviceListener listener)
Adds the specified listener. 
 | 
int | 
getAvailableDeviceCount()
Returns the number of currently available devices known to the system. 
 | 
Iterable<Device> | 
getAvailableDevices()
Returns an iterable collection of all devices
 currently available to the system. 
 | 
Iterable<Device> | 
getAvailableDevices(Device.Type type)
Returns an iterable collection of all devices currently available to the system by device type. 
 | 
PortStatistics | 
getDeltaStatisticsForPort(DeviceId deviceId,
                         PortNumber portNumber)
Returns the port specific port delta statistics associated with the device and port. 
 | 
Device | 
getDevice(DeviceId deviceId)
Returns the device with the specified identifier. 
 | 
int | 
getDeviceCount()
Returns the number of infrastructure devices known to the system. 
 | 
Iterable<Device> | 
getDevices()
Returns a collection of the currently known infrastructure
 devices. 
 | 
Iterable<Device> | 
getDevices(Device.Type type)
Returns a collection of the currently known infrastructure
 devices by device type. 
 | 
long | 
getLastUpdatedInstant(DeviceId deviceId)
Indicates the time at which the given device connected or disconnected
 from this controller instance. 
 | 
Port | 
getPort(DeviceId deviceId,
       PortNumber portNumber)
Returns the port with the specified number and hosted by the given device. 
 | 
List<PortStatistics> | 
getPortDeltaStatistics(DeviceId deviceId)
Returns the list of port delta statistics associated with the device. 
 | 
List<Port> | 
getPorts(DeviceId deviceId)
Returns the list of ports associated with the device. 
 | 
List<PortStatistics> | 
getPortStatistics(DeviceId deviceId)
Returns the list of port statistics associated with the device. 
 | 
MastershipRole | 
getRole(DeviceId deviceId)
Returns the current mastership role for the specified device. 
 | 
PortStatistics | 
getStatisticsForPort(DeviceId deviceId,
                    PortNumber portNumber)
Returns the port specific port statistics associated with the device and port. 
 | 
boolean | 
isAvailable(DeviceId deviceId)
Indicates whether or not the device is presently online and available. 
 | 
String | 
localStatus(DeviceId deviceId)
Indicates how long ago the device connected or disconnected from this
 controller instance. 
 | 
void | 
removeListener(DeviceListener listener)
Removes the specified listener. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPortpublic DeviceServiceAdapter(List<Port> portList)
portList - port listpublic DeviceServiceAdapter()
public int getDeviceCount()
DeviceServicegetDeviceCount in interface DeviceServicepublic int getAvailableDeviceCount()
DeviceServicegetAvailableDeviceCount in interface DeviceServicepublic Iterable<Device> getDevices()
DeviceServicegetDevices in interface DeviceServicepublic Iterable<Device> getAvailableDevices()
DeviceServicegetAvailableDevices in interface DeviceServicepublic Device getDevice(DeviceId deviceId)
DeviceServicegetDevice in interface DeviceServicedeviceId - device identifierpublic MastershipRole getRole(DeviceId deviceId)
DeviceServicegetRole in interface DeviceServicedeviceId - device identifierpublic List<Port> getPorts(DeviceId deviceId)
DeviceServicegetPorts in interface DeviceServicedeviceId - device identifierpublic List<PortStatistics> getPortStatistics(DeviceId deviceId)
DeviceServicegetPortStatistics in interface DeviceServicedeviceId - device identifierpublic List<PortStatistics> getPortDeltaStatistics(DeviceId deviceId)
DeviceServicegetPortDeltaStatistics in interface DeviceServicedeviceId - device identifierpublic PortStatistics getStatisticsForPort(DeviceId deviceId, PortNumber portNumber)
DeviceServicegetStatisticsForPort in interface DeviceServicedeviceId - device identifierportNumber - port identifierpublic PortStatistics getDeltaStatisticsForPort(DeviceId deviceId, PortNumber portNumber)
DeviceServicegetDeltaStatisticsForPort in interface DeviceServicedeviceId - device identifierportNumber - port identifierpublic Port getPort(DeviceId deviceId, PortNumber portNumber)
DeviceServicegetPort in interface DeviceServicedeviceId - device identifierportNumber - port numberpublic boolean isAvailable(DeviceId deviceId)
DeviceServiceisAvailable in interface DeviceServicedeviceId - device identifierpublic void addListener(DeviceListener listener)
ListenerServiceaddListener in interface ListenerService<DeviceEvent,DeviceListener>listener - listener to be addedpublic void removeListener(DeviceListener listener)
ListenerServiceremoveListener in interface ListenerService<DeviceEvent,DeviceListener>listener - listener to be removedpublic Iterable<Device> getDevices(Device.Type type)
DeviceServicegetDevices in interface DeviceServicetype - device typepublic Iterable<Device> getAvailableDevices(Device.Type type)
DeviceServicegetAvailableDevices in interface DeviceServicetype - device typepublic String localStatus(DeviceId deviceId)
DeviceServicelocalStatus in interface DeviceServicedeviceId - device identifierpublic long getLastUpdatedInstant(DeviceId deviceId)
DeviceServicegetLastUpdatedInstant in interface DeviceServicedeviceId - device identifier