public class DeviceStoreAdapter extends Object implements DeviceStoreService
Constructor and Description |
---|
DeviceStoreAdapter() |
Modifier and Type | Method and Description |
---|---|
boolean |
addDevice(Device device)
Persist and team this device.
|
void |
baseSystem(boolean baseSystem)
Used by DeviceSyncService to signal initialize from persist or team.
|
Set<Device> |
getDevice(DeviceFilter filter)
Retrieve the devices from fast lookup cache.
|
Device |
getDevice(DeviceId id)
Retrieve the device from team map.
|
Interface |
getInterface(DeviceId deviceId,
InterfaceId interfaceId)
Get an individual interface.
|
List<Interface> |
getInterfaces(DeviceId deviceId)
Get the interfaces for a specific device.
|
boolean |
isInitDone()
Returns the status of DataStore initialization.
|
void |
lock(DeviceId deviceId)
Lock the device for modification.
|
void |
notify(DeviceEvent event)
Notify local listeners of a device / interface event
|
void |
removeDevice(Device device)
Remove the device from teaming and persistence
|
void |
removeInterfaces(DeviceId deviceId)
Remove the interface attached to the device.
|
void |
setEventBroker(EventDispatchService dispatch)
Teamed device events will be sent to local listeners.
|
void |
setSize(long size)
Sets the size of this device store.
|
void |
unlock(DeviceId deviceId)
Unlock the device for modification.
|
void |
updateInterface(Interface netIf)
Update an individual interface in persistence and teaming.
|
void |
updateInterfaces(DeviceId deviceId,
List<Interface> toAdd,
List<Interface> toUpdate,
List<Interface> toRemove)
Update all interfaces to a device as one operation, but pre-separated
into new, update, and remove.
|
public void setEventBroker(EventDispatchService dispatch)
DeviceStoreService
setEventBroker
in interface DeviceStoreService
dispatch
- event dispatch servicepublic void notify(DeviceEvent event)
DeviceStoreService
notify
in interface DeviceStoreService
event
- action that occurredpublic boolean addDevice(Device device)
DeviceStoreService
addDevice
in interface DeviceStoreService
device
- object to team / persistpublic void removeDevice(Device device)
DeviceStoreService
removeDevice
in interface DeviceStoreService
device
- object to removepublic Set<Device> getDevice(DeviceFilter filter)
DeviceStoreService
getDevice
in interface DeviceStoreService
filter
- to apply, match method will not be usedpublic Device getDevice(DeviceId id)
DeviceStoreService
getDevice
in interface DeviceStoreService
id
- keypublic void lock(DeviceId deviceId)
DeviceStoreService
lock
in interface DeviceStoreService
deviceId
- device to lockpublic void unlock(DeviceId deviceId)
DeviceStoreService
unlock
in interface DeviceStoreService
deviceId
- device to unlockpublic void updateInterfaces(DeviceId deviceId, List<Interface> toAdd, List<Interface> toUpdate, List<Interface> toRemove)
DeviceStoreService
updateInterfaces
in interface DeviceStoreService
deviceId
- Device that the interfaces are attachedtoAdd
- interfaces to addtoUpdate
- interfaces to updatetoRemove
- interfaces to removepublic void updateInterface(Interface netIf)
DeviceStoreService
updateInterface
in interface DeviceStoreService
netIf
- interface to updatepublic void removeInterfaces(DeviceId deviceId)
DeviceStoreService
removeInterfaces
in interface DeviceStoreService
deviceId
- device referencepublic List<Interface> getInterfaces(DeviceId deviceId)
DeviceStoreService
getInterfaces
in interface DeviceStoreService
deviceId
- device referencepublic Interface getInterface(DeviceId deviceId, InterfaceId interfaceId)
DeviceStoreService
getInterface
in interface DeviceStoreService
deviceId
- device referenceinterfaceId
- interface referencepublic void baseSystem(boolean baseSystem)
DeviceStoreService
baseSystem
in interface DeviceStoreService
baseSystem
- true to load from persist, false to load from teampublic boolean isInitDone()
DeviceStoreService
isInitDone
in interface DeviceStoreService
public void setSize(long size)
DeviceStoreService
setSize
in interface DeviceStoreService
size
- the new store sizeCopyright © 2015. All Rights Reserved.