|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.floodlightcontroller.devicemanager.internal.DeviceIndex
public abstract class DeviceIndex
An index that maps key fields of an entity to device keys
| Field Summary | |
|---|---|
protected java.util.EnumSet<IDeviceService.DeviceField> |
keyFields
The key fields for this index |
| Constructor Summary | |
|---|---|
DeviceIndex(java.util.EnumSet<IDeviceService.DeviceField> keyFields)
Construct a new device index using the provided key fields |
|
| Method Summary | |
|---|---|
abstract java.util.Iterator<java.lang.Long> |
getAll()
Get all device keys in the index. |
abstract java.util.Iterator<java.lang.Long> |
queryByEntity(Entity entity)
Find all device keys in the index that match the given entity on all the key fields for this index |
abstract void |
removeEntity(Entity entity)
Remove the entry for the given entity |
abstract void |
removeEntity(Entity entity,
java.lang.Long deviceKey)
Remove the given device key from the index for the given entity |
void |
removeEntityIfNeeded(Entity entity,
java.lang.Long deviceKey,
java.util.Collection<Entity> others)
Remove the give device from the index only if this the collection of others does not contain an entity that is identical on all the key fields for this index. |
abstract boolean |
updateIndex(Device device,
java.lang.Long deviceKey)
Attempt to update an index with the entities in the provided Device. |
abstract void |
updateIndex(Entity entity,
java.lang.Long deviceKey)
Add a mapping from the given entity to the given device key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.EnumSet<IDeviceService.DeviceField> keyFields
| Constructor Detail |
|---|
public DeviceIndex(java.util.EnumSet<IDeviceService.DeviceField> keyFields)
keyFields - the key fields to use| Method Detail |
|---|
public abstract java.util.Iterator<java.lang.Long> queryByEntity(Entity entity)
e - the entity to search for
public abstract java.util.Iterator<java.lang.Long> getAll()
public abstract boolean updateIndex(Device device,
java.lang.Long deviceKey)
Device. If the update fails because of a concurrent update,
will return false.
device - the device to updatedeviceKey - the device key for the device
public abstract void updateIndex(Entity entity,
java.lang.Long deviceKey)
device - the device to updatedeviceKey - the device key for the devicepublic abstract void removeEntity(Entity entity)
entity - the entity to remove
public abstract void removeEntity(Entity entity,
java.lang.Long deviceKey)
entity - the entity to search fordeviceKey - the key to remove
public void removeEntityIfNeeded(Entity entity,
java.lang.Long deviceKey,
java.util.Collection<Entity> others)
entity - the entity to search fordeviceKey - the key to removeothers - the others against which to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||