Bug 6110: Fixed bugs in statistics manager due to race condition.
[openflowplugin.git] / applications / statistics-manager / src / main / java / org / opendaylight / openflowplugin / applications / statistics / manager / StatRpcMsgManager.java
index 0ee8e346a01540349dee77b7495bbaa75a077fad..3ec705086ea86824012f6d98533f0370647c0a66 100644 (file)
@@ -9,11 +9,10 @@
 package org.opendaylight.openflowplugin.applications.statistics.manager;
 
 import java.util.List;
-import java.util.concurrent.Callable;
 import java.util.concurrent.Future;
 
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionAware;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.TransactionId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionAware;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
@@ -38,17 +37,14 @@ import com.google.common.util.concurrent.SettableFuture;
  *
  * Created: Aug 29, 2014
  */
-public interface StatRpcMsgManager extends Runnable, AutoCloseable {
-
-    interface RpcJobsQueue extends Callable<Void> {}
-
+public interface StatRpcMsgManager {
     /**
      * Transaction container is definition for Multipart transaction
      * join container for all Multipart msg with same TransactionId
      * Input {@link DataObject} is a possible light-weight DataObject
-     * which is used for identification (e.g. Flow-> Priority,Match,Cookie,FlowId)
+     * which is used for identification (e.g. Flow -&gt; Priority,Match,Cookie,FlowId)
      *
-     * @param <T> extends TransactionAware -
+     * @param <T>
      */
     interface TransactionCacheContainer<T extends TransactionAware> {
 
@@ -67,7 +63,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method is used for check a transaction registration
      * for multipart cache holder
      *
-     * @param TransactionId id
+     * @param id
      * @return true if the transaction has been correctly registered
      */
     Future<Boolean> isExpectedStatistics(TransactionId id, NodeId nodeId);
@@ -95,7 +91,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * and build all to TransactionCacheContainer Object to return. This process clean
      * all instances in Cache.
      *
-     * @param TransactionId id
+     * @param id
      * @return TransactionCacheContainer
      */
     Future<Optional<TransactionCacheContainer<?>>> getTransactionCacheContainer(TransactionId id, NodeId nodeId);
@@ -104,7 +100,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightGroupStatisticsService.getAllGroupStatistics
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllGroupsStat(NodeRef nodeRef);
 
@@ -112,7 +108,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightGroupStatisticsService.getGroupDescription
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllGroupsConfStats(NodeRef nodeRef);
 
@@ -120,7 +116,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightMeterStatisticsService.getGroupFeatures
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     void getGroupFeaturesStat(NodeRef nodeRef);
 
@@ -128,7 +124,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightMeterStatisticsService.getAllMeterStatistics
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllMetersStat(NodeRef nodeRef);
 
@@ -136,7 +132,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightMeterStatisticsService.getAllMeterConfigStatistics
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllMeterConfigStat(NodeRef nodeRef);
 
@@ -144,7 +140,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightMeterStatisticsService.getMeterFeatures
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     void getMeterFeaturesStat(NodeRef nodeRef);
 
@@ -152,7 +148,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightFlowStatisticsService.getAllFlowsStatisticsFromAllFlowTables
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllFlowsStat(NodeRef nodeRef);
 
@@ -160,8 +156,8 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightFlowStatisticsService.getAggregateFlowStatisticsFromFlowTableForAllFlows
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
-     * @param TableId tableId
+     * @param nodeRef
+     * @param tableId
      */
     void getAggregateFlowStat(NodeRef nodeRef, TableId tableId);
 
@@ -169,7 +165,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightPortStatisticsService.getAllNodeConnectorsStatistics
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllPortsStat(NodeRef nodeRef);
 
@@ -177,7 +173,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightFlowTableStatisticsService.getFlowTablesStatistics
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllTablesStat(NodeRef nodeRef);
 
@@ -185,7 +181,7 @@ public interface StatRpcMsgManager extends Runnable, AutoCloseable {
      * Method wraps OpendaylightQueueStatisticsService.getAllQueuesStatisticsFromAllPorts
      * and registers to Transaction Cache
      *
-     * @param NodeRef nodeRef
+     * @param nodeRef
      */
     Future<TransactionId> getAllQueueStat(NodeRef nodeRef);