+ 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")