Merge "BUG-2188 :To report (TCP) port number (for the OpenFlow connection) for switch...
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / rpc / RpcManagerImpl.java
index 063ea26ef08ea1bd94244572241a863b9e820133..3619e66e914d0f15eeaf0ba0940fc4b27ddac12f 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.rpc;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Verify;
 import com.google.common.collect.Iterators;
@@ -91,4 +92,14 @@ public class RpcManagerImpl implements RpcManager {
     public void setDeviceTerminationPhaseHandler(final DeviceTerminationPhaseHandler handler) {
         this.deviceTerminPhaseHandler = handler;
     }
+
+    /**
+     * This method is only for testing
+     */
+    @VisibleForTesting
+    void addRecordToContexts(NodeId nodeId, RpcContext rpcContexts) {
+        if(!contexts.containsKey(nodeId)) {
+            this.contexts.put(nodeId,rpcContexts);
+        }
+    }
 }