MD-SAL Statistics Manager - Added sending request and caching response 87/2787/1
authorAnil Vishnoi <avishnoi@in.ibm.com>
Thu, 14 Nov 2013 22:50:09 +0000 (04:20 +0530)
committerAnil Vishnoi <avishnoi@in.ibm.com>
Fri, 15 Nov 2013 19:25:57 +0000 (00:55 +0530)
Change-Id: I283a543a3a9e7ec3ea74c1018a82e51990ce03f9
Signed-off-by: Anil Vishnoi <avishnoi@in.ibm.com>
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/group-statistics.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/meter-statistics.yang
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/NodeStatistics.java [new file with mode: 0644]
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsProvider.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/StatisticsUpdateCommiter.java

index 043b007..c1740d8 100644 (file)
@@ -18,10 +18,9 @@ module opendaylight-group-statistics {
     grouping group-stats-response {
         uses "inv:node-context-ref";
 
-        leaf group-stats-id {
-            type group-stats-ref;
+        list group-statistics{
+               uses group-types:group-statistics;
         }
-        uses group-types:group-statistics;
     }
 
     typedef group-features-ref {
@@ -31,9 +30,6 @@ module opendaylight-group-statistics {
     grouping group-features-response {
         uses "inv:node-context-ref";
 
-        leaf group-features-id {
-            type group-features-ref;
-        }
         uses group-types:group-features;
     }
 
@@ -44,10 +40,23 @@ module opendaylight-group-statistics {
     grouping group-desc-response {
         uses "inv:node-context-ref";
 
-        leaf group-desc-id {
-            type group-desc-ref;
+        list group-desc-stats {
+               uses group-types:group-desc-stats;
         }
-        uses group-types:group-desc-stats;
+    }
+    
+    container group-all-statistics {
+       container group-stats {
+               uses group-stats-response;
+       }
+       
+       container group-features {
+                       uses group-features-response;
+               }
+               
+               container group-desc {
+                       uses group-desc-response;
+               }
     }
 
        // RPC calls
@@ -56,9 +65,7 @@ module opendaylight-group-statistics {
             uses inv:node-context-ref;
         }
         output {
-            list group-statistics {
-                uses group-stats-response;
-            }
+               uses group-stats-response;
             uses tr:transaction-aware;
         }
        
@@ -81,9 +88,6 @@ module opendaylight-group-statistics {
        rpc get-group-description {
                input {
             uses inv:node-context-ref;
-            leaf group-id{
-               type group-types:group-id;
-            }
         }
         output {
             uses group-desc-response;
@@ -94,9 +98,6 @@ module opendaylight-group-statistics {
        rpc get-group-features {
                input {
             uses inv:node-context-ref;
-            leaf group-id{
-               type group-types:group-id;
-            }
         }
         output {
             uses group-features-response;
@@ -108,16 +109,28 @@ module opendaylight-group-statistics {
        //Notification calls
        
        notification group-statistics-updated {
+           leaf group-stats-id {
+            type group-stats-ref;
+        }
+               
                uses group-stats-response;
         uses tr:transaction-aware;
        }
        
        notification group-desc-stats-updated {
+               leaf group-desc-id {
+            type group-desc-ref;
+        }
+       
                uses group-desc-response;
         uses tr:transaction-aware;
        }
 
        notification group-features-updated {
+               leaf group-features-id {
+            type group-features-ref;
+        }
+       
                uses group-features-response;
         uses tr:transaction-aware;
        }
index 18dd60d..3561e4f 100644 (file)
@@ -19,10 +19,9 @@ module opendaylight-meter-statistics {
     grouping meter-stats-response {
         uses "inv:node-context-ref";
 
-        leaf meter-stats-id {
-            type meter-stats-ref;
+        list meter-statistics {
+               uses meter-types:meter-statistics;
         }
-        uses meter-types:meter-statistics;
     }
 
     typedef meter-config-ref {
@@ -32,10 +31,9 @@ module opendaylight-meter-statistics {
     grouping meter-config-response {
         uses "inv:node-context-ref";
 
-        leaf meter-config-id {
-            type meter-config-ref;
+        list meter-config-stats {
+               uses meter-types:meter-config-stats;
         }
-        uses meter-types:meter-config-stats;
     }
 
     typedef meter-features-ref {
@@ -45,28 +43,35 @@ module opendaylight-meter-statistics {
     grouping meter-features-response {
         uses "inv:node-context-ref";
 
-        leaf meter-features-id {
-            type meter-features-ref;
-        }
         uses meter-types:meter-features;
     }
 
+       container meter-all-stats {
+               container meter-stats {
+                       uses meter-stats-response;
+               }
+               
+               container meter-config {
+                       uses meter-config-response;
+               }
+               
+               container meter-features {
+                       uses meter-features-response;
+               }
+       }
        // RPC calls
        rpc get-all-meter-statistics {
                input {
             uses inv:node-context-ref;
         }
         output {
-            list meter-statistics {
-                uses meter-stats-response;
-                uses tr:transaction-aware;
-            }
+                       uses meter-stats-response;
+                       uses tr:transaction-aware;
         }
        
        }
        
        rpc get-meter-statistics {
-               description "RPC Method to send meter statistics request to the give switch for specific meter"; 
                input {
             uses inv:node-context-ref;
             leaf meter-id{
@@ -80,12 +85,9 @@ module opendaylight-meter-statistics {
        
        }
        
-       rpc get-meter-config-statistics {
+       rpc get-all-meter-config-statistics {
                input {
             uses inv:node-context-ref;
-            leaf meter-id{
-               type meter-types:meter-id;
-            }
         }
         output {
                uses meter-config-response;
@@ -96,9 +98,6 @@ module opendaylight-meter-statistics {
        rpc get-meter-features {
                input {
             uses inv:node-context-ref;
-            leaf meter-id{
-               type meter-types:meter-id;
-               }
         }
         output {
                uses meter-features-response;
@@ -110,16 +109,27 @@ module opendaylight-meter-statistics {
        //Notification calls
        
        notification meter-statistics-updated {
-               uses meter-stats-response;
+           leaf meter-stats-id {
+            type meter-stats-ref;
+        }
+       uses meter-stats-response;
         uses tr:transaction-aware;
        }
        
        notification meter-config-stats-updated {
+               leaf meter-config-id {
+            type meter-config-ref;
+        }
+       
                uses meter-config-response;
         uses tr:transaction-aware;
        }
 
        notification meter-features-updated {
+           leaf meter-features-id {
+            type meter-features-ref;
+        }
+       
                uses meter-features-response;
         uses tr:transaction-aware;
        }
diff --git a/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/NodeStatistics.java b/opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/NodeStatistics.java
new file mode 100644 (file)
index 0000000..8507324
--- /dev/null
@@ -0,0 +1,89 @@
+package org.opendaylight.controller.md.statistics.manager;
+
+import java.util.List;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.desc.response.GroupDescStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.stats.response.GroupStatistics;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.meter.config.response.MeterConfigStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.meter.stats.response.MeterStatistics;
+
+public class NodeStatistics {
+
+    private NodeRef targetNode;
+    
+    private List<GroupStatistics> groupStatistics;
+    
+    private List<MeterStatistics> meterStatistics;
+    
+    private List<GroupDescStats> groupDescStats;
+    
+    private List<MeterConfigStats> meterConfigStats;
+    
+    private List<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.features.GroupFeatures> groupFeatures;
+    
+    private List<org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.features.MeterFeatures> meterFeatures;
+    
+    public NodeStatistics(){
+        
+    }
+
+    public NodeRef getTargetNode() {
+        return targetNode;
+    }
+
+    public void setTargetNode(NodeRef targetNode) {
+        this.targetNode = targetNode;
+    }
+
+    public List<GroupStatistics> getGroupStatistics() {
+        return groupStatistics;
+    }
+
+    public void setGroupStatistics(List<GroupStatistics> groupStatistics) {
+        this.groupStatistics = groupStatistics;
+    }
+
+    public List<MeterStatistics> getMeterStatistics() {
+        return meterStatistics;
+    }
+
+    public void setMeterStatistics(List<MeterStatistics> meterStatistics) {
+        this.meterStatistics = meterStatistics;
+    }
+
+    public List<GroupDescStats> getGroupDescStats() {
+        return groupDescStats;
+    }
+
+    public void setGroupDescStats(List<GroupDescStats> groupDescStats) {
+        this.groupDescStats = groupDescStats;
+    }
+
+    public List<MeterConfigStats> getMeterConfigStats() {
+        return meterConfigStats;
+    }
+
+    public void setMeterConfigStats(List<MeterConfigStats> meterConfigStats) {
+        this.meterConfigStats = meterConfigStats;
+    }
+
+    public List<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.features.GroupFeatures> getGroupFeatures() {
+        return groupFeatures;
+    }
+
+    public void setGroupFeatures(
+            List<org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.features.GroupFeatures> groupFeatures) {
+        this.groupFeatures = groupFeatures;
+    }
+
+    public List<org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.features.MeterFeatures> getMeterFeatures() {
+        return meterFeatures;
+    }
+
+    public void setMeterFeatures(
+            List<org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.meter.features.MeterFeatures> meterFeatures) {
+        this.meterFeatures = meterFeatures;
+    }
+    
+}
index 073d43e..5c02b6c 100644 (file)
@@ -1,13 +1,36 @@
 package org.opendaylight.controller.md.statistics.manager;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.Future;
+
 import org.eclipse.xtext.xbase.lib.Exceptions;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetAllGroupStatisticsOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupDescriptionOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GetGroupFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterConfigStatisticsOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetAllMeterStatisticsOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.GetMeterFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsService;
 import org.opendaylight.yangtools.concepts.Registration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.NotificationListener;
+import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -23,6 +46,15 @@ public class StatisticsProvider implements AutoCloseable {
     
     private OpendaylightMeterStatisticsService meterStatsService;
     
+    private Thread statisticsRequesterThread;
+    
+    private final  InstanceIdentifier<Nodes> nodesIdentifier = InstanceIdentifier.builder().node(Nodes.class).toInstance();
+    
+    //Local caching of stats
+    
+    private final ConcurrentMap<NodeRef,NodeStatistics> statisticsCache = 
+            new ConcurrentHashMap<NodeRef,NodeStatistics>();
+    
     public DataProviderService getDataService() {
       return this.dps;
     }
@@ -50,10 +82,28 @@ public class StatisticsProvider implements AutoCloseable {
         this.listenerRegistration = registerNotificationListener;
         
         // Get Group/Meter statistics service instance
-        groupStatsService = StatisticsManagerActivator.getProviderContext().getRpcService(OpendaylightGroupStatisticsService.class);
+        groupStatsService = StatisticsManagerActivator.getProviderContext().
+                getRpcService(OpendaylightGroupStatisticsService.class);
         
-        meterStatsService = StatisticsManagerActivator.getProviderContext().getRpcService(OpendaylightMeterStatisticsService.class);
+        meterStatsService = StatisticsManagerActivator.getProviderContext().
+                getRpcService(OpendaylightMeterStatisticsService.class);
+
+        statisticsRequesterThread = new Thread( new Runnable(){
 
+            @Override
+            public void run() {
+                while(true){
+                    try {
+                        statsRequestSender();
+                        
+                        Thread.sleep(5000);
+                    }catch (Exception e){
+                        spLogger.error("Exception occurred while sending stats request : {}",e.getMessage());
+                        e.printStackTrace();
+                    }
+                }
+            }
+        });
         spLogger.info("Statistics Provider started.");
     }
     
@@ -63,6 +113,100 @@ public class StatisticsProvider implements AutoCloseable {
         return dps.beginTransaction();
     }
     
+    private void statsRequestSender(){
+        
+        //Need to call API to receive all the nodes connected to controller.
+        
+        List<NodeRef> targetNodes = new ArrayList<NodeRef>();
+        
+        for (NodeRef targetNode : targetNodes){
+            
+            sendAllGroupStatisticsRequest(targetNode);
+            
+            sendAllMeterStatisticsRequest(targetNode);
+
+            //We need to add check, so see if groups/meters are supported
+            //by the target node.
+            sendGroupDescriptionRequest(targetNode);
+            
+            sendGroupFeaturesRequest(targetNode);
+            
+            sendMeterConfigStatisticsRequest(targetNode);
+            
+            sendMeterFeaturesRequest(targetNode);
+        }
+    }
+    
+    private void sendAllGroupStatisticsRequest(NodeRef targetNode){
+        
+        GetAllGroupStatisticsInputBuilder input = new GetAllGroupStatisticsInputBuilder();
+        
+        input.setNode(targetNode);
+
+        Future<RpcResult<GetAllGroupStatisticsOutput>> response = 
+                groupStatsService.getAllGroupStatistics(input.build());
+    }
+    
+    private void sendGroupDescriptionRequest(NodeRef targetNode){
+        GetGroupDescriptionInputBuilder input = new GetGroupDescriptionInputBuilder();
+        
+        input.setNode(targetNode);
+        
+        Future<RpcResult<GetGroupDescriptionOutput>> response = 
+                groupStatsService.getGroupDescription(input.build());
+    }
+    
+    private void sendGroupFeaturesRequest(NodeRef targetNode){
+        
+        GetGroupFeaturesInputBuilder input = new GetGroupFeaturesInputBuilder();
+        
+        input.setNode(targetNode);
+        
+        Future<RpcResult<GetGroupFeaturesOutput>> response = 
+                groupStatsService.getGroupFeatures(input.build());
+    }
+    
+    private void sendAllMeterStatisticsRequest(NodeRef targenetNode){
+        
+        GetAllMeterStatisticsInputBuilder input = new GetAllMeterStatisticsInputBuilder();
+        
+        input.setNode(targenetNode);
+        
+        Future<RpcResult<GetAllMeterStatisticsOutput>> response = 
+                meterStatsService.getAllMeterStatistics(input.build());
+    }
+    
+    private void sendMeterConfigStatisticsRequest(NodeRef targetNode){
+        
+        GetAllMeterConfigStatisticsInputBuilder input = new GetAllMeterConfigStatisticsInputBuilder();
+        
+        input.setNode(targetNode);
+        
+        Future<RpcResult<GetAllMeterConfigStatisticsOutput>> response = 
+                meterStatsService.getAllMeterConfigStatistics(input.build());
+        
+    }
+    private void sendMeterFeaturesRequest(NodeRef targetNode){
+     
+        GetMeterFeaturesInputBuilder input = new GetMeterFeaturesInputBuilder();
+        
+        input.setNode(targetNode);
+        
+        Future<RpcResult<GetMeterFeaturesOutput>> response = 
+                meterStatsService.getMeterFeatures(input.build());
+    }
+    
+    public ConcurrentMap<NodeRef, NodeStatistics> getStatisticsCache() {
+        return statisticsCache;
+    }
+    
+    private List<Node> getAllConnectedNodes(){
+        
+        Nodes nodes = (Nodes) dps.readOperationalData(nodesIdentifier);
+        return nodes.getNode();
+    }
+
+    @SuppressWarnings("deprecation")
     @Override
     public void close(){
         
@@ -71,6 +215,8 @@ public class StatisticsProvider implements AutoCloseable {
             if (this.listenerRegistration != null) {
               
                 this.listenerRegistration.close();
+                
+                this.statisticsRequesterThread.destroy();
             
             }
           } catch (Throwable e) {
index f952124..cba039f 100644 (file)
@@ -1,13 +1,30 @@
 package org.opendaylight.controller.md.statistics.manager;
 
+import java.util.concurrent.ConcurrentMap;
+
+import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupDescRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupDescStatsUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupFeaturesRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupFeaturesUpdated;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupStatisticsUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupStatsRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.OpendaylightGroupStatisticsListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.all.statistics.GroupDescBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.all.statistics.GroupFeaturesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.all.statistics.GroupStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterConfigRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterConfigStatsUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterFeaturesRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterFeaturesUpdated;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatisticsUpdated;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatsRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.OpendaylightMeterStatisticsListener;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.meter.all.stats.MeterConfigBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.meter.all.stats.MeterFeaturesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.meter.all.stats.MeterStatsBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsListener,
         OpendaylightMeterStatisticsListener {
@@ -23,35 +40,135 @@ public class StatisticsUpdateCommiter implements OpendaylightGroupStatisticsList
     }
     @Override
     public void onMeterConfigStatsUpdated(MeterConfigStatsUpdated notification) {
-        // TODO Auto-generated method stub
+        //Add statistics to local cache
+        ConcurrentMap<NodeRef, NodeStatistics> cache = this.statisticsManager.getStatisticsCache();
+        if(!cache.containsKey(notification.getNode())){
+            cache.put(notification.getNode(), new NodeStatistics());
+        }
+        cache.get(notification.getNode()).setMeterConfigStats(notification.getMeterConfigStats());
+        
+        //Publish data to configuration data store
+        DataModificationTransaction it = this.statisticsManager.startChange();
+        MeterConfigRef ref = notification.getMeterConfigId();
+
+        MeterConfigBuilder meterConfig = new MeterConfigBuilder();
+        meterConfig.setNode(notification.getNode());
+        meterConfig.setMeterConfigStats(notification.getMeterConfigStats());
+        
+        InstanceIdentifier<? extends Object> refValue = ref.getValue();
+        it.putRuntimeData(refValue, meterConfig.build());
+        it.commit();
     }
 
     @Override
     public void onMeterStatisticsUpdated(MeterStatisticsUpdated notification) {
-        // TODO Auto-generated method stub
+        //Add statistics to local cache
+        ConcurrentMap<NodeRef, NodeStatistics> cache = this.statisticsManager.getStatisticsCache();
+        if(!cache.containsKey(notification.getNode())){
+            cache.put(notification.getNode(), new NodeStatistics());
+        }
+        cache.get(notification.getNode()).setMeterStatistics(notification.getMeterStatistics());
+        
+        //Publish data to configuration data store
+        DataModificationTransaction it = this.statisticsManager.startChange();
+        MeterStatsRef ref = notification.getMeterStatsId();
 
+        MeterStatsBuilder meterStats = new MeterStatsBuilder();
+        meterStats.setNode(notification.getNode());
+        meterStats.setMeterStatistics(notification.getMeterStatistics());
+        
+        InstanceIdentifier<? extends Object> refValue = ref.getValue();
+        it.putRuntimeData(refValue, meterStats.build());
+        it.commit();
     }
 
     @Override
     public void onGroupDescStatsUpdated(GroupDescStatsUpdated notification) {
-        // TODO Auto-generated method stub
+        //Add statistics to local cache
+        ConcurrentMap<NodeRef, NodeStatistics> cache = this.statisticsManager.getStatisticsCache();
+        if(!cache.containsKey(notification.getNode())){
+            cache.put(notification.getNode(), new NodeStatistics());
+        }
+        cache.get(notification.getNode()).setGroupDescStats(notification.getGroupDescStats());
+        
+        //Publish data to configuration data store
+        DataModificationTransaction it = this.statisticsManager.startChange();
+        GroupDescRef ref = notification.getGroupDescId();
 
+        GroupDescBuilder descStats = new GroupDescBuilder();
+        descStats.setNode(notification.getNode());
+        descStats.setGroupDescStats(notification.getGroupDescStats());
+        
+        InstanceIdentifier<? extends Object> refValue = ref.getValue();
+        it.putRuntimeData(refValue, descStats.build());
+        it.commit();
     }
 
     @Override
     public void onGroupStatisticsUpdated(GroupStatisticsUpdated notification) {
-        // TODO Auto-generated method stub
+        
+        //Add statistics to local cache
+        ConcurrentMap<NodeRef, NodeStatistics> cache = this.statisticsManager.getStatisticsCache();
+        if(!cache.containsKey(notification.getNode())){
+            cache.put(notification.getNode(), new NodeStatistics());
+        }
+        cache.get(notification.getNode()).setGroupStatistics(notification.getGroupStatistics());
+        
+        //Publish data to configuration data store
+        DataModificationTransaction it = this.statisticsManager.startChange();
+        GroupStatsRef ref = notification.getGroupStatsId();
 
+        GroupStatsBuilder groupStats = new GroupStatsBuilder();
+        groupStats.setNode(notification.getNode());
+        groupStats.setGroupStatistics(notification.getGroupStatistics());
+        
+        InstanceIdentifier<? extends Object> refValue = ref.getValue();
+        it.putRuntimeData(refValue, groupStats.build());
+        it.commit();
     }
     @Override
     public void onMeterFeaturesUpdated(MeterFeaturesUpdated notification) {
-        // TODO Auto-generated method stub
+
+        //Add statistics to local cache
+        ConcurrentMap<NodeRef, NodeStatistics> cache = this.statisticsManager.getStatisticsCache();
+        if(!cache.containsKey(notification.getNode())){
+            cache.put(notification.getNode(), new NodeStatistics());
+        }
+        cache.get(notification.getNode()).setMeterFeatures(notification.getMeterFeatures());
         
+        //Publish data to configuration data store
+        DataModificationTransaction it = this.statisticsManager.startChange();
+        MeterFeaturesRef ref = notification.getMeterFeaturesId();
+
+        MeterFeaturesBuilder meterFeatures = new MeterFeaturesBuilder();
+        meterFeatures.setNode(notification.getNode());
+        meterFeatures.setMeterFeatures(notification.getMeterFeatures());
+        
+        InstanceIdentifier<? extends Object> refValue = ref.getValue();
+        it.putRuntimeData(refValue, meterFeatures.build());
+        it.commit();
     }
+    
     @Override
     public void onGroupFeaturesUpdated(GroupFeaturesUpdated notification) {
-        // TODO Auto-generated method stub
         
-    }
+        //Add statistics to local cache
+        ConcurrentMap<NodeRef, NodeStatistics> cache = this.statisticsManager.getStatisticsCache();
+        if(!cache.containsKey(notification.getNode())){
+            cache.put(notification.getNode(), new NodeStatistics());
+        }
+        cache.get(notification.getNode()).setGroupFeatures(notification.getGroupFeatures());
+        
+        //Publish data to configuration data store
+        DataModificationTransaction it = this.statisticsManager.startChange();
+        GroupFeaturesRef ref = notification.getGroupFeaturesId();
 
+        GroupFeaturesBuilder featuresStats = new GroupFeaturesBuilder();
+        featuresStats.setNode(notification.getNode());
+        featuresStats.setGroupFeatures(notification.getGroupFeatures());
+        
+        InstanceIdentifier<? extends Object> refValue = ref.getValue();
+        it.putRuntimeData(refValue, featuresStats.build());
+        it.commit();
+    }
 }