public class DeviceServiceAdapter extends Object implements DeviceService
DeviceService
API,
provided specifically for unit tests and implementers to use, to
insulate from changes in the API.Constructor and Description |
---|
DeviceServiceAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(DeviceListener listener)
Add the specified listener...
|
Device |
getDevice(DataPathId dpid)
Returns the device with the specified management Data Path Id (dpid).
|
Device |
getDevice(DeviceId id)
Returns the device with the specified id.
|
Device |
getDevice(URI uri)
Returns the device with the specified URI.
|
Iterator<Device> |
getDevices()
Returns set of all devices known to the system.
|
Iterator<Device> |
getDevices(Class<? extends Facet> facetClass)
Returns a list of all devices that support the specified device driver
facet.
|
Iterator<Device> |
getDevices(DeviceFilter filter)
Returns set of all devices that match the supplied filter.
|
Set<Device> |
getDevices(IpAddress deviceIp)
Returns the device with the specified management IP address.
|
Interface |
getInterface(DeviceId deviceId,
InterfaceId interfaceId)
Returns the interface requested with the device and interface ids.
|
List<Interface> |
getInterfaces(Device device)
Returns the list of interfaces hosted on this device.
|
VlanId |
getLinkDiscoveryVlan(DeviceId deviceId)
Get the linkDiscoveryVlan configured for the device.
|
Set<DeviceListener> |
getListeners()
Returns the set of all device update listeners.
|
void |
removeListener(DeviceListener listener)
Remove the specified listener...
|
void |
setLinkDiscoveryVlan(DeviceId deviceId,
VlanId linkDiscoveryVlan)
Assign a user provided linkDiscoveryVlan to the device.
|
void |
setName(Device device,
String name)
Assign a user provided friendly name to the device.
|
public Iterator<Device> getDevices()
DeviceService
getDevices
in interface DeviceService
public Iterator<Device> getDevices(DeviceFilter filter)
DeviceService
getDevices
in interface DeviceService
filter
- device filterpublic Device getDevice(DeviceId id)
DeviceService
getDevice
in interface DeviceService
id
- device idpublic Set<Device> getDevices(IpAddress deviceIp)
DeviceService
getDevices
in interface DeviceService
deviceIp
- management IPpublic Device getDevice(DataPathId dpid)
DeviceService
getDevice
in interface DeviceService
dpid
- management Data Path Idpublic Device getDevice(URI uri)
DeviceService
getDevice
in interface DeviceService
uri
- URI identifierpublic Iterator<Device> getDevices(Class<? extends Facet> facetClass)
DeviceService
getDevices
in interface DeviceService
facetClass
- facet class to filter bypublic List<Interface> getInterfaces(Device device)
DeviceService
getInterfaces
in interface DeviceService
device
- device descriptorpublic Interface getInterface(DeviceId deviceId, InterfaceId interfaceId)
DeviceService
getInterface
in interface DeviceService
deviceId
- device idinterfaceId
- interface idpublic void addListener(DeviceListener listener)
DeviceService
addListener
in interface DeviceService
listener
- listener to be addedpublic void removeListener(DeviceListener listener)
DeviceService
removeListener
in interface DeviceService
listener
- listener to be removedpublic Set<DeviceListener> getListeners()
DeviceService
getListeners
in interface DeviceService
public void setName(Device device, String name)
DeviceService
setName
in interface DeviceService
device
- to modifyname
- user provided friendly namepublic VlanId getLinkDiscoveryVlan(DeviceId deviceId)
DeviceService
getLinkDiscoveryVlan
in interface DeviceService
deviceId
- containing linkDiscoveryVlanpublic void setLinkDiscoveryVlan(DeviceId deviceId, VlanId linkDiscoveryVlan)
DeviceService
setLinkDiscoveryVlan
in interface DeviceService
deviceId
- to set linkDiscoveryVlan forlinkDiscoveryVlan
- user provided linkDiscoveryVlan idCopyright © 2015. All Rights Reserved.