Class 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.GroupStore
    Manages inventory of group entries using distributed group stores from the storage service.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.onosproject.cfg.ComponentConfigService cfgService  
      protected org.onosproject.store.cluster.messaging.ClusterCommunicationService clusterCommunicator  
      protected org.onosproject.cluster.ClusterService clusterService  
      protected org.onosproject.net.device.DeviceService deviceService  
      protected org.onosproject.net.driver.DriverService driverService  
      protected org.onosproject.mastership.MastershipService mastershipService  
      protected org.onosproject.store.service.StorageService storageService  
      • Fields inherited from class org.onosproject.store.AbstractStore

        delegate
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate​(org.osgi.service.component.ComponentContext context)  
      void addOrUpdateExtraneousGroupEntry​(org.onosproject.net.group.Group group)  
      void addOrUpdateGroupEntry​(org.onosproject.net.group.Group group)
      Stores a new group entry, or updates an existing entry.
      void deactivate()  
      void deleteGroupDescription​(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey appCookie)
      Triggers deleting the existing group entry.
      void deviceInitialAuditCompleted​(org.onosproject.net.DeviceId deviceId, boolean completed)  
      boolean deviceInitialAuditStatus​(org.onosproject.net.DeviceId deviceId)  
      java.lang.Iterable<org.onosproject.net.group.Group> getExtraneousGroups​(org.onosproject.net.DeviceId deviceId)  
      org.onosproject.net.group.Group getGroup​(org.onosproject.net.DeviceId deviceId, org.onosproject.core.GroupId groupId)  
      org.onosproject.net.group.Group getGroup​(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupKey appCookie)
      Returns the stored group entry.
      int getGroupCount​(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.
      void groupOperationFailed​(org.onosproject.net.DeviceId deviceId, org.onosproject.net.group.GroupOperation operation)  
      void modified​(org.osgi.service.component.ComponentContext context)  
      void notifyOfFailovers​(java.util.Collection<org.onosproject.net.group.Group> failoverGroups)  
      void purgeGroupEntries()  
      void purgeGroupEntry​(org.onosproject.net.DeviceId deviceId)  
      void pushGroupMetrics​(org.onosproject.net.DeviceId deviceId, java.util.Collection<org.onosproject.net.group.Group> groupEntries)  
      void removeExtraneousGroupEntry​(org.onosproject.net.group.Group group)  
      void removeGroupEntry​(org.onosproject.net.group.Group group)
      Removes the group entry from store.
      void storeGroupDescription​(org.onosproject.net.group.GroupDescription groupDesc)
      Stores a new group entry using the information from group description.
      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.
      • Methods inherited from class org.onosproject.store.AbstractStore

        hasDelegate, notifyDelegate, notifyDelegate, setDelegate, unsetDelegate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.onosproject.store.Store

        hasDelegate, 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
    • Constructor Detail

      • DistributedGroupStore

        public DistributedGroupStore()
    • 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:
        getGroupCount in interface org.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:
        getGroups in interface org.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:
        getGroup in interface org.onosproject.net.group.GroupStore
        Parameters:
        deviceId - the device ID
        appCookie - 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:
        getGroup in interface org.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:
        storeGroupDescription in interface org.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:
        updateGroupDescription in interface org.onosproject.net.group.GroupStore
        Parameters:
        deviceId - the device ID
        oldAppCookie - the current group key
        type - update type
        newBuckets - group buckets for updates
        newAppCookie - 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:
        deleteGroupDescription in interface org.onosproject.net.group.GroupStore
        Parameters:
        deviceId - the device ID
        appCookie - 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:
        addOrUpdateGroupEntry in interface org.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:
        removeGroupEntry in interface org.onosproject.net.group.GroupStore
        Parameters:
        group - group entry
      • purgeGroupEntry

        public void purgeGroupEntry​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        purgeGroupEntry in interface org.onosproject.net.group.GroupStore
      • purgeGroupEntries

        public void purgeGroupEntries()
        Specified by:
        purgeGroupEntries in interface org.onosproject.net.group.GroupStore
      • deviceInitialAuditCompleted

        public void deviceInitialAuditCompleted​(org.onosproject.net.DeviceId deviceId,
                                                boolean completed)
        Specified by:
        deviceInitialAuditCompleted in interface org.onosproject.net.group.GroupStore
      • deviceInitialAuditStatus

        public boolean deviceInitialAuditStatus​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        deviceInitialAuditStatus in interface org.onosproject.net.group.GroupStore
      • groupOperationFailed

        public void groupOperationFailed​(org.onosproject.net.DeviceId deviceId,
                                         org.onosproject.net.group.GroupOperation operation)
        Specified by:
        groupOperationFailed in interface org.onosproject.net.group.GroupStore
      • addOrUpdateExtraneousGroupEntry

        public void addOrUpdateExtraneousGroupEntry​(org.onosproject.net.group.Group group)
        Specified by:
        addOrUpdateExtraneousGroupEntry in interface org.onosproject.net.group.GroupStore
      • removeExtraneousGroupEntry

        public void removeExtraneousGroupEntry​(org.onosproject.net.group.Group group)
        Specified by:
        removeExtraneousGroupEntry in interface org.onosproject.net.group.GroupStore
      • getExtraneousGroups

        public java.lang.Iterable<org.onosproject.net.group.Group> getExtraneousGroups​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        getExtraneousGroups in interface org.onosproject.net.group.GroupStore
      • pushGroupMetrics

        public void pushGroupMetrics​(org.onosproject.net.DeviceId deviceId,
                                     java.util.Collection<org.onosproject.net.group.Group> groupEntries)
        Specified by:
        pushGroupMetrics in interface org.onosproject.net.group.GroupStore
      • notifyOfFailovers

        public void notifyOfFailovers​(java.util.Collection<org.onosproject.net.group.Group> failoverGroups)
        Specified by:
        notifyOfFailovers in interface org.onosproject.net.group.GroupStore