Bug 2756 - Match model update
[openflowjava.git] / openflow-protocol-it / src / test / java / org / opendaylight / openflowjava / protocol / it / integration / MockPlugin.java
index f8298bbf966c12d16c552966796dd3ffd67987e2..36a8d277f564e6c73626e0ca4a90998a21daa0df 100644 (file)
@@ -18,6 +18,7 @@ import java.util.concurrent.TimeoutException;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener;
 import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler;
+import org.opendaylight.openflowjava.protocol.impl.core.SwitchConnectionProviderImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessage;
@@ -190,8 +191,8 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan
         LOGGER.debug("Reason: " + notification.getReason());
         LOGGER.debug("TableId: " + notification.getTableId());
         LOGGER.debug("Cookie: " + notification.getCookie());
-        LOGGER.debug("Class: " + notification.getMatch().getMatchEntries().get(0).getOxmClass());
-        LOGGER.debug("Field: " + notification.getMatch().getMatchEntries().get(0).getOxmMatchField());
+        LOGGER.debug("Class: " + notification.getMatch().getMatchEntry().get(0).getOxmClass());
+        LOGGER.debug("Field: " + notification.getMatch().getMatchEntry().get(0).getOxmMatchField());
         LOGGER.debug("Datasize: " + notification.getData().length);
     }
 
@@ -231,5 +232,14 @@ public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHan
         LOGGER.trace("MockPlugin().onConnectionReady()");
     }
 
-
+    /**
+     * Initiates connection to device
+     * @param switchConnectionProvider
+     * @param host - host IP
+     * @param port - port number 
+     */
+    public void initiateConnection(SwitchConnectionProviderImpl switchConnectionProvider, String host, int port) {
+        LOGGER.trace("MockPlugin().initiateConnection()");
+        switchConnectionProvider.initiateConnection(host, port);
+    }
 }