public class DeviceSupplierServiceAdapter extends Object implements DeviceSupplierService
DeviceSupplierService
Constructor and Description |
---|
DeviceSupplierServiceAdapter() |
Modifier and Type | Method and Description |
---|---|
Device |
createOrUpdateDevice(DeviceId deviceId,
Set<URI> uris,
DeviceInfo info)
Creates, or updates, a device using the supplied discovery URIs and
device information populated with basic device identity data.
|
void |
createOrUpdateInterface(DeviceId deviceId,
List<InterfaceInfo> netInterfaces)
Create or update the interfaces associated with the device.
|
SupplierId |
getId()
Returns the supplier id assigned by the supplier's broker.
|
void |
removeDevice(DeviceId deviceId)
Removes the specified device from the inventory.
|
void |
setOnline(DeviceId deviceId,
boolean online)
Marks the device as on/off line.
|
void |
updateInterface(DeviceId deviceId,
Interface netInterface)
Update a single interface.
|
public Device createOrUpdateDevice(DeviceId deviceId, Set<URI> uris, DeviceInfo info)
DeviceSupplierService
DeviceIdentity.getUniqueId()
,
that device instance will be simply updated and returned.
Note that it is the responsibility of the caller (DeviceSupplier
to populate the info with the identity information beforehand.
createOrUpdateDevice
in interface DeviceSupplierService
deviceId
- unique identifier for the deviceuris
- set of discovery URIsinfo
- device info from the initial discovery/classificationpublic void removeDevice(DeviceId deviceId)
DeviceSupplierService
removeDevice
in interface DeviceSupplierService
deviceId
- device to be removedpublic void setOnline(DeviceId deviceId, boolean online)
DeviceSupplierService
setOnline
in interface DeviceSupplierService
deviceId
- device to be updatedonline
- true to mark device onlinepublic SupplierId getId()
DeviceSupplierService
getId
in interface DeviceSupplierService
public void createOrUpdateInterface(DeviceId deviceId, List<InterfaceInfo> netInterfaces)
DeviceSupplierService
createOrUpdateInterface
in interface DeviceSupplierService
deviceId
- device where the interfaces are associatednetInterfaces
- interfaces to associatepublic void updateInterface(DeviceId deviceId, Interface netInterface)
DeviceSupplierService
updateInterface
in interface DeviceSupplierService
deviceId
- Device that hosts the interfacenetInterface
- interface to updateCopyright © 2015. All Rights Reserved.