Class ECDeviceStore

  • All Implemented Interfaces:
    org.onosproject.net.device.DeviceStore, org.onosproject.store.Store<org.onosproject.net.device.DeviceEvent,​org.onosproject.net.device.DeviceStoreDelegate>

    public class ECDeviceStore
    extends org.onosproject.store.AbstractStore<org.onosproject.net.device.DeviceEvent,​org.onosproject.net.device.DeviceStoreDelegate>
    implements org.onosproject.net.device.DeviceStore
    Manages the inventory of devices using a EventuallyConsistentMap.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.onosproject.store.cluster.messaging.ClusterCommunicationService clusterCommunicator  
      protected org.onosproject.cluster.ClusterService clusterService  
      protected org.onosproject.net.device.DeviceClockService deviceClockService  
      protected org.onosproject.mastership.MastershipService mastershipService  
      protected org.onosproject.mastership.MastershipTermService mastershipTermService  
      protected static org.onosproject.store.service.Serializer SERIALIZER  
      protected static org.onlab.util.KryoNamespace.Builder SERIALIZER_BUILDER  
      protected org.onosproject.store.service.StorageService storageService  
      • Fields inherited from class org.onosproject.store.AbstractStore

        delegate
    • Constructor Summary

      Constructors 
      Constructor Description
      ECDeviceStore()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activate()  
      org.onosproject.net.device.PortStatistics calcDeltaStats​(org.onosproject.net.DeviceId deviceId, org.onosproject.net.device.PortStatistics prvStats, org.onosproject.net.device.PortStatistics newStats)
      Calculate delta statistics by subtracting previous from new statistics.
      org.onosproject.net.device.DeviceEvent createOrUpdateDevice​(org.onosproject.net.provider.ProviderId providerId, org.onosproject.net.DeviceId deviceId, org.onosproject.net.device.DeviceDescription deviceDescription)  
      void deactivate()  
      int getAvailableDeviceCount()  
      java.lang.Iterable<org.onosproject.net.Device> getAvailableDevices()  
      org.onosproject.net.device.PortStatistics getDeltaStatisticsForPort​(org.onosproject.net.DeviceId deviceId, org.onosproject.net.PortNumber portNumber)  
      org.onosproject.net.Device getDevice​(org.onosproject.net.DeviceId deviceId)  
      int getDeviceCount()  
      java.lang.Iterable<org.onosproject.net.Device> getDevices()  
      org.onosproject.net.Port getPort​(org.onosproject.net.DeviceId deviceId, org.onosproject.net.PortNumber portNumber)  
      java.util.List<org.onosproject.net.device.PortStatistics> getPortDeltaStatistics​(org.onosproject.net.DeviceId deviceId)  
      org.onosproject.net.device.PortDescription getPortDescription​(org.onosproject.net.provider.ProviderId pid, org.onosproject.net.DeviceId deviceId, org.onosproject.net.PortNumber portNumber)  
      java.util.stream.Stream<org.onosproject.net.device.PortDescription> getPortDescriptions​(org.onosproject.net.provider.ProviderId pid, org.onosproject.net.DeviceId deviceId)  
      java.util.List<org.onosproject.net.Port> getPorts​(org.onosproject.net.DeviceId deviceId)  
      java.util.List<org.onosproject.net.device.PortStatistics> getPortStatistics​(org.onosproject.net.DeviceId deviceId)  
      org.onosproject.net.device.PortStatistics getStatisticsForPort​(org.onosproject.net.DeviceId deviceId, org.onosproject.net.PortNumber portNumber)  
      boolean isAvailable​(org.onosproject.net.DeviceId deviceId)  
      org.onosproject.net.device.DeviceEvent markOffline​(org.onosproject.net.DeviceId deviceId)  
      org.onosproject.net.device.DeviceEvent markOnline​(org.onosproject.net.DeviceId deviceId)  
      org.onosproject.net.device.DeviceEvent removeDevice​(org.onosproject.net.DeviceId deviceId)  
      java.util.List<org.onosproject.net.device.DeviceEvent> updatePorts​(org.onosproject.net.provider.ProviderId providerId, org.onosproject.net.DeviceId deviceId, java.util.List<org.onosproject.net.device.PortDescription> descriptions)  
      org.onosproject.net.device.DeviceEvent updatePortStatistics​(org.onosproject.net.provider.ProviderId providerId, org.onosproject.net.DeviceId deviceId, java.util.Collection<org.onosproject.net.device.PortStatistics> newStatsCollection)  
      org.onosproject.net.device.DeviceEvent updatePortStatus​(org.onosproject.net.provider.ProviderId providerId, org.onosproject.net.DeviceId deviceId, org.onosproject.net.device.PortDescription portDescription)  
      • 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

      • storageService

        protected org.onosproject.store.service.StorageService storageService
      • mastershipService

        protected org.onosproject.mastership.MastershipService mastershipService
      • mastershipTermService

        protected org.onosproject.mastership.MastershipTermService mastershipTermService
      • deviceClockService

        protected org.onosproject.net.device.DeviceClockService deviceClockService
      • clusterCommunicator

        protected org.onosproject.store.cluster.messaging.ClusterCommunicationService clusterCommunicator
      • clusterService

        protected org.onosproject.cluster.ClusterService clusterService
      • SERIALIZER

        protected static final org.onosproject.store.service.Serializer SERIALIZER
      • SERIALIZER_BUILDER

        protected static final org.onlab.util.KryoNamespace.Builder SERIALIZER_BUILDER
    • Constructor Detail

      • ECDeviceStore

        public ECDeviceStore()
    • Method Detail

      • activate

        public void activate()
      • deactivate

        public void deactivate()
      • getDevices

        public java.lang.Iterable<org.onosproject.net.Device> getDevices()
        Specified by:
        getDevices in interface org.onosproject.net.device.DeviceStore
      • getDeviceCount

        public int getDeviceCount()
        Specified by:
        getDeviceCount in interface org.onosproject.net.device.DeviceStore
      • getAvailableDeviceCount

        public int getAvailableDeviceCount()
        Specified by:
        getAvailableDeviceCount in interface org.onosproject.net.device.DeviceStore
      • getDevice

        public org.onosproject.net.Device getDevice​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        getDevice in interface org.onosproject.net.device.DeviceStore
      • createOrUpdateDevice

        public org.onosproject.net.device.DeviceEvent createOrUpdateDevice​(org.onosproject.net.provider.ProviderId providerId,
                                                                           org.onosproject.net.DeviceId deviceId,
                                                                           org.onosproject.net.device.DeviceDescription deviceDescription)
        Specified by:
        createOrUpdateDevice in interface org.onosproject.net.device.DeviceStore
      • markOnline

        public org.onosproject.net.device.DeviceEvent markOnline​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        markOnline in interface org.onosproject.net.device.DeviceStore
      • markOffline

        public org.onosproject.net.device.DeviceEvent markOffline​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        markOffline in interface org.onosproject.net.device.DeviceStore
      • updatePorts

        public java.util.List<org.onosproject.net.device.DeviceEvent> updatePorts​(org.onosproject.net.provider.ProviderId providerId,
                                                                                  org.onosproject.net.DeviceId deviceId,
                                                                                  java.util.List<org.onosproject.net.device.PortDescription> descriptions)
        Specified by:
        updatePorts in interface org.onosproject.net.device.DeviceStore
      • updatePortStatus

        public org.onosproject.net.device.DeviceEvent updatePortStatus​(org.onosproject.net.provider.ProviderId providerId,
                                                                       org.onosproject.net.DeviceId deviceId,
                                                                       org.onosproject.net.device.PortDescription portDescription)
        Specified by:
        updatePortStatus in interface org.onosproject.net.device.DeviceStore
      • getPorts

        public java.util.List<org.onosproject.net.Port> getPorts​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        getPorts in interface org.onosproject.net.device.DeviceStore
      • getPortDescriptions

        public java.util.stream.Stream<org.onosproject.net.device.PortDescription> getPortDescriptions​(org.onosproject.net.provider.ProviderId pid,
                                                                                                       org.onosproject.net.DeviceId deviceId)
        Specified by:
        getPortDescriptions in interface org.onosproject.net.device.DeviceStore
      • getPort

        public org.onosproject.net.Port getPort​(org.onosproject.net.DeviceId deviceId,
                                                org.onosproject.net.PortNumber portNumber)
        Specified by:
        getPort in interface org.onosproject.net.device.DeviceStore
      • getPortDescription

        public org.onosproject.net.device.PortDescription getPortDescription​(org.onosproject.net.provider.ProviderId pid,
                                                                             org.onosproject.net.DeviceId deviceId,
                                                                             org.onosproject.net.PortNumber portNumber)
        Specified by:
        getPortDescription in interface org.onosproject.net.device.DeviceStore
      • updatePortStatistics

        public org.onosproject.net.device.DeviceEvent updatePortStatistics​(org.onosproject.net.provider.ProviderId providerId,
                                                                           org.onosproject.net.DeviceId deviceId,
                                                                           java.util.Collection<org.onosproject.net.device.PortStatistics> newStatsCollection)
        Specified by:
        updatePortStatistics in interface org.onosproject.net.device.DeviceStore
      • calcDeltaStats

        public org.onosproject.net.device.PortStatistics calcDeltaStats​(org.onosproject.net.DeviceId deviceId,
                                                                        org.onosproject.net.device.PortStatistics prvStats,
                                                                        org.onosproject.net.device.PortStatistics newStats)
        Calculate delta statistics by subtracting previous from new statistics.
        Parameters:
        deviceId - device indentifier
        prvStats - previous port statistics
        newStats - new port statistics
        Returns:
        PortStatistics
      • getPortStatistics

        public java.util.List<org.onosproject.net.device.PortStatistics> getPortStatistics​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        getPortStatistics in interface org.onosproject.net.device.DeviceStore
      • getStatisticsForPort

        public org.onosproject.net.device.PortStatistics getStatisticsForPort​(org.onosproject.net.DeviceId deviceId,
                                                                              org.onosproject.net.PortNumber portNumber)
        Specified by:
        getStatisticsForPort in interface org.onosproject.net.device.DeviceStore
      • getPortDeltaStatistics

        public java.util.List<org.onosproject.net.device.PortStatistics> getPortDeltaStatistics​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        getPortDeltaStatistics in interface org.onosproject.net.device.DeviceStore
      • getDeltaStatisticsForPort

        public org.onosproject.net.device.PortStatistics getDeltaStatisticsForPort​(org.onosproject.net.DeviceId deviceId,
                                                                                   org.onosproject.net.PortNumber portNumber)
        Specified by:
        getDeltaStatisticsForPort in interface org.onosproject.net.device.DeviceStore
      • isAvailable

        public boolean isAvailable​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        isAvailable in interface org.onosproject.net.device.DeviceStore
      • getAvailableDevices

        public java.lang.Iterable<org.onosproject.net.Device> getAvailableDevices()
        Specified by:
        getAvailableDevices in interface org.onosproject.net.device.DeviceStore
      • removeDevice

        public org.onosproject.net.device.DeviceEvent removeDevice​(org.onosproject.net.DeviceId deviceId)
        Specified by:
        removeDevice in interface org.onosproject.net.device.DeviceStore