MD-SAL Statistics Manager - Changed Group/Meter Augmentataion location in operational...
[controller.git] / opendaylight / md-sal / statistics-manager / src / main / java / org / opendaylight / controller / md / statistics / manager / MultipartMessageManager.java
index 11cce72ef1516655e26d7a5b28daaa37d880d5f9..998d5d8faaf24fd09e10d6a5865f1a5c169e6d96 100644 (file)
@@ -21,6 +21,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev131103.
  */
 public class MultipartMessageManager {
 
+    /*
+     *  Map for tx id and type of request, to keep track of all the request sent 
+     *  by Statistics Manager. Statistics Manager won't entertain any multipart 
+     *  response for which it didn't send the request.  
+     */
+    
+    private static Map<TransactionId,StatsRequestType> txIdToRequestTypeMap = new ConcurrentHashMap<TransactionId,StatsRequestType>();
+    /*
+     * Map to keep track of the request tx id for flow table statistics request.
+     * Because flow table statistics multi part response do not contains the table id.
+     */
     private static Map<TransactionId,Short> txIdTotableIdMap = new ConcurrentHashMap<TransactionId,Short>();
     
     public MultipartMessageManager(){}
@@ -34,4 +45,23 @@ public class MultipartMessageManager {
     public void setTxIdAndTableIdMapEntry(TransactionId id,Short tableId){
         txIdTotableIdMap.put(id, tableId);
     }
+    
+    public void addTxIdToRequestTypeEntry (TransactionId id,StatsRequestType type){
+        txIdToRequestTypeMap.put(id, type);
+    }
+    public StatsRequestType removeTxId(TransactionId id){
+        return txIdToRequestTypeMap.remove(id);
+    }
+    
+    public enum StatsRequestType{
+        ALL_FLOW,
+        AGGR_FLOW,
+        ALL_PORT,
+        ALL_FLOW_TABLE,
+        ALL_QUEUE_STATS,
+        ALL_GROUP,
+        ALL_METER,
+        GROUP_DESC,
+        METER_CONFIG
+    }
 }