Package org.onosproject.store.group.impl
Class DistributedGroupStore
- java.lang.Object
-
- org.onosproject.store.AbstractStore<org.onosproject.net.group.GroupEvent,org.onosproject.net.group.GroupStoreDelegate>
-
- org.onosproject.store.group.impl.DistributedGroupStore
-
- All Implemented Interfaces:
org.onosproject.net.group.GroupStore,org.onosproject.store.Store<org.onosproject.net.group.GroupEvent,org.onosproject.net.group.GroupStoreDelegate>
public class DistributedGroupStore extends org.onosproject.store.AbstractStore<org.onosproject.net.group.GroupEvent,org.onosproject.net.group.GroupStoreDelegate> implements org.onosproject.net.group.GroupStoreManages inventory of group entries using distributed group stores from the storage service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDistributedGroupStore.GroupStoreIdMapKeyprotected static classDistributedGroupStore.GroupStoreKeyMapKeyprotected static classDistributedGroupStore.GroupStoreMapKeyFlattened map key to be used to store group entries.
-
Field Summary
Fields Modifier and Type Field Description protected org.onosproject.cfg.ComponentConfigServicecfgServiceprotected org.onosproject.store.cluster.messaging.ClusterCommunicationServiceclusterCommunicatorprotected org.onosproject.cluster.ClusterServiceclusterServiceprotected org.onosproject.net.device.DeviceServicedeviceServiceprotected org.onosproject.net.driver.DriverServicedriverServiceprotected org.onosproject.mastership.MastershipServicemastershipServiceprotected org.onosproject.store.service.StorageServicestorageService
-
Constructor Summary
Constructors Constructor Description DistributedGroupStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(org.osgi.service.component.ComponentContext context)voidaddOrUpdateExtraneousGroupEntry(org.onosproject.net.group.Group group)voidaddOrUpdateGroupEntry(org.onosproject.net.group.Group group)Stores a new group entry, or updates an existing entry.voiddeactivate()voiddeleteGroupDescription(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey appCookie)Triggers deleting the existing group entry.voiddeviceInitialAuditCompleted(org.onosproject.net.DeviceId deviceId, boolean completed)booleandeviceInitialAuditStatus(org.onosproject.net.DeviceId deviceId)java.lang.Iterable<org.onosproject.net.group.Group>getExtraneousGroups(org.onosproject.net.DeviceId deviceId)org.onosproject.net.group.GroupgetGroup(org.onosproject.net.DeviceId deviceId, org.onosproject.core.GroupId groupId)org.onosproject.net.group.GroupgetGroup(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey appCookie)Returns the stored group entry.intgetGroupCount(org.onosproject.net.DeviceId deviceId)Returns the number of groups for the specified device in the store.java.lang.Iterable<org.onosproject.net.group.Group>getGroups(org.onosproject.net.DeviceId deviceId)Returns the groups associated with a device.voidgroupOperationFailed(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupOperation operation)voidmodified(org.osgi.service.component.ComponentContext context)voidnotifyOfFailovers(java.util.Collection<org.onosproject.net.group.Group> failoverGroups)voidpurgeGroupEntries()voidpurgeGroupEntry(org.onosproject.net.DeviceId deviceId)voidpushGroupMetrics(org.onosproject.net.DeviceId deviceId, java.util.Collection<org.onosproject.net.group.Group> groupEntries)voidremoveExtraneousGroupEntry(org.onosproject.net.group.Group group)voidremoveGroupEntry(org.onosproject.net.group.Group group)Removes the group entry from store.voidstoreGroupDescription(org.onosproject.net.group.GroupDescription groupDesc)Stores a new group entry using the information from group description.voidupdateGroupDescription(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey oldAppCookie, org.onosproject.net.group.GroupStore.UpdateType type, org.onosproject.net.group.GroupBuckets newBuckets, org.onosproject.net.group.GroupKey newAppCookie)Updates the existing group entry with the information from group description.-
Methods inherited from class org.onosproject.store.AbstractStore
hasDelegate, notifyDelegate, notifyDelegate, setDelegate, unsetDelegate
-
-
-
-
Field Detail
-
clusterCommunicator
protected org.onosproject.store.cluster.messaging.ClusterCommunicationService clusterCommunicator
-
clusterService
protected org.onosproject.cluster.ClusterService clusterService
-
storageService
protected org.onosproject.store.service.StorageService storageService
-
mastershipService
protected org.onosproject.mastership.MastershipService mastershipService
-
cfgService
protected org.onosproject.cfg.ComponentConfigService cfgService
-
deviceService
protected org.onosproject.net.device.DeviceService deviceService
-
driverService
protected org.onosproject.net.driver.DriverService driverService
-
-
Method Detail
-
activate
public void activate(org.osgi.service.component.ComponentContext context)
-
deactivate
public void deactivate()
-
modified
public void modified(org.osgi.service.component.ComponentContext context)
-
getGroupCount
public int getGroupCount(org.onosproject.net.DeviceId deviceId)
Returns the number of groups for the specified device in the store.- Specified by:
getGroupCountin interfaceorg.onosproject.net.group.GroupStore- Returns:
- number of groups for the specified device
-
getGroups
public java.lang.Iterable<org.onosproject.net.group.Group> getGroups(org.onosproject.net.DeviceId deviceId)
Returns the groups associated with a device.- Specified by:
getGroupsin interfaceorg.onosproject.net.group.GroupStore- Parameters:
deviceId- the device ID- Returns:
- the group entries
-
getGroup
public org.onosproject.net.group.Group getGroup(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey appCookie)Returns the stored group entry.- Specified by:
getGroupin interfaceorg.onosproject.net.group.GroupStore- Parameters:
deviceId- the device IDappCookie- the group key- Returns:
- a group associated with the key
-
getGroup
public org.onosproject.net.group.Group getGroup(org.onosproject.net.DeviceId deviceId, org.onosproject.core.GroupId groupId)- Specified by:
getGroupin interfaceorg.onosproject.net.group.GroupStore
-
storeGroupDescription
public void storeGroupDescription(org.onosproject.net.group.GroupDescription groupDesc)
Stores a new group entry using the information from group description.- Specified by:
storeGroupDescriptionin interfaceorg.onosproject.net.group.GroupStore- Parameters:
groupDesc- group description to be used to create group entry
-
updateGroupDescription
public void updateGroupDescription(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey oldAppCookie, org.onosproject.net.group.GroupStore.UpdateType type, org.onosproject.net.group.GroupBuckets newBuckets, org.onosproject.net.group.GroupKey newAppCookie)Updates the existing group entry with the information from group description.- Specified by:
updateGroupDescriptionin interfaceorg.onosproject.net.group.GroupStore- Parameters:
deviceId- the device IDoldAppCookie- the current group keytype- update typenewBuckets- group buckets for updatesnewAppCookie- optional new group key
-
deleteGroupDescription
public void deleteGroupDescription(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey appCookie)Triggers deleting the existing group entry.- Specified by:
deleteGroupDescriptionin interfaceorg.onosproject.net.group.GroupStore- Parameters:
deviceId- the device IDappCookie- the group key
-
addOrUpdateGroupEntry
public void addOrUpdateGroupEntry(org.onosproject.net.group.Group group)
Stores a new group entry, or updates an existing entry.- Specified by:
addOrUpdateGroupEntryin interfaceorg.onosproject.net.group.GroupStore- Parameters:
group- group entry
-
removeGroupEntry
public void removeGroupEntry(org.onosproject.net.group.Group group)
Removes the group entry from store.- Specified by:
removeGroupEntryin interfaceorg.onosproject.net.group.GroupStore- Parameters:
group- group entry
-
purgeGroupEntry
public void purgeGroupEntry(org.onosproject.net.DeviceId deviceId)
- Specified by:
purgeGroupEntryin interfaceorg.onosproject.net.group.GroupStore
-
purgeGroupEntries
public void purgeGroupEntries()
- Specified by:
purgeGroupEntriesin interfaceorg.onosproject.net.group.GroupStore
-
deviceInitialAuditCompleted
public void deviceInitialAuditCompleted(org.onosproject.net.DeviceId deviceId, boolean completed)- Specified by:
deviceInitialAuditCompletedin interfaceorg.onosproject.net.group.GroupStore
-
deviceInitialAuditStatus
public boolean deviceInitialAuditStatus(org.onosproject.net.DeviceId deviceId)
- Specified by:
deviceInitialAuditStatusin interfaceorg.onosproject.net.group.GroupStore
-
groupOperationFailed
public void groupOperationFailed(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupOperation operation)- Specified by:
groupOperationFailedin interfaceorg.onosproject.net.group.GroupStore
-
addOrUpdateExtraneousGroupEntry
public void addOrUpdateExtraneousGroupEntry(org.onosproject.net.group.Group group)
- Specified by:
addOrUpdateExtraneousGroupEntryin interfaceorg.onosproject.net.group.GroupStore
-
removeExtraneousGroupEntry
public void removeExtraneousGroupEntry(org.onosproject.net.group.Group group)
- Specified by:
removeExtraneousGroupEntryin interfaceorg.onosproject.net.group.GroupStore
-
getExtraneousGroups
public java.lang.Iterable<org.onosproject.net.group.Group> getExtraneousGroups(org.onosproject.net.DeviceId deviceId)
- Specified by:
getExtraneousGroupsin interfaceorg.onosproject.net.group.GroupStore
-
pushGroupMetrics
public void pushGroupMetrics(org.onosproject.net.DeviceId deviceId, java.util.Collection<org.onosproject.net.group.Group> groupEntries)- Specified by:
pushGroupMetricsin interfaceorg.onosproject.net.group.GroupStore
-
notifyOfFailovers
public void notifyOfFailovers(java.util.Collection<org.onosproject.net.group.Group> failoverGroups)
- Specified by:
notifyOfFailoversin interfaceorg.onosproject.net.group.GroupStore
-
-