public class DeviceServiceAdapter extends java.lang.Object implements DeviceService
| Constructor and Description |
|---|
DeviceServiceAdapter()
Default constructor.
|
DeviceServiceAdapter(java.util.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.
|
java.lang.Iterable<Device> |
getAvailableDevices()
Returns an iterable collection of all devices
currently available to the system.
|
java.lang.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.
|
java.lang.Iterable<Device> |
getDevices()
Returns a collection of the currently known infrastructure
devices.
|
java.lang.Iterable<Device> |
getDevices(Device.Type type)
Returns a collection of the currently known infrastructure
devices by device type.
|
Port |
getPort(DeviceId deviceId,
PortNumber portNumber)
Returns the port with the specified number and hosted by the given device.
|
java.util.List<PortStatistics> |
getPortDeltaStatistics(DeviceId deviceId)
Returns the list of port delta statistics associated with the device.
|
java.util.List<Port> |
getPorts(DeviceId deviceId)
Returns the list of ports associated with the device.
|
java.util.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.
|
java.lang.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(java.util.List<Port> portList)
portList - port listpublic DeviceServiceAdapter()
public int getDeviceCount()
DeviceServicegetDeviceCount in interface DeviceServicepublic int getAvailableDeviceCount()
DeviceServicegetAvailableDeviceCount in interface DeviceServicepublic java.lang.Iterable<Device> getDevices()
DeviceServicegetDevices in interface DeviceServicepublic java.lang.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 java.util.List<Port> getPorts(DeviceId deviceId)
DeviceServicegetPorts in interface DeviceServicedeviceId - device identifierpublic java.util.List<PortStatistics> getPortStatistics(DeviceId deviceId)
DeviceServicegetPortStatistics in interface DeviceServicedeviceId - device identifierpublic java.util.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 java.lang.Iterable<Device> getDevices(Device.Type type)
DeviceServicegetDevices in interface DeviceServicetype - device typepublic java.lang.Iterable<Device> getAvailableDevices(Device.Type type)
DeviceServicegetAvailableDevices in interface DeviceServicetype - device typepublic java.lang.String localStatus(DeviceId deviceId)
DeviceServicelocalStatus in interface DeviceServicedeviceId - device identifier