+ private static Map<TxIdEntry,Date> txIdToRequestTypeMap = new ConcurrentHashMap<TxIdEntry,Date>();
+ /*
+ * 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<TxIdEntry,Short> txIdTotableIdMap = new ConcurrentHashMap<TxIdEntry,Short>();
+
+ private final int NUMBER_OF_WAIT_CYCLES =2;
+
+ class TxIdEntry{
+ private final TransactionId txId;
+ private final NodeId nodeId;
+ private final StatsRequestType requestType;
+
+ public TxIdEntry(NodeId nodeId, TransactionId txId, StatsRequestType requestType){
+ this.txId = txId;
+ this.nodeId = nodeId;
+ this.requestType = requestType;
+ }
+ public TransactionId getTxId() {
+ return txId;
+ }
+ public NodeId getNodeId() {
+ return nodeId;
+ }
+ public StatsRequestType getRequestType() {
+ return requestType;
+ }
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + getOuterType().hashCode();
+ result = prime * result + ((nodeId == null) ? 0 : nodeId.hashCode());
+ result = prime * result + ((txId == null) ? 0 : txId.hashCode());
+ return result;
+ }
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (!(obj instanceof TxIdEntry)) {
+ return false;
+ }
+ TxIdEntry other = (TxIdEntry) obj;
+ if (!getOuterType().equals(other.getOuterType())) {
+ return false;
+ }
+ if (nodeId == null) {
+ if (other.nodeId != null) {
+ return false;
+ }
+ } else if (!nodeId.equals(other.nodeId)) {
+ return false;
+ }
+ if (txId == null) {
+ if (other.txId != null) {
+ return false;
+ }
+ } else if (!txId.equals(other.txId)) {
+ return false;
+ }
+ return true;
+ }
+ private MultipartMessageManager getOuterType() {
+ return MultipartMessageManager.this;
+ }
+ @Override
+ public String toString() {
+ return "TxIdEntry [txId=" + txId + ", nodeId=" + nodeId + ", requestType=" + requestType + "]";
+ }
+ }
+