Merge "Correction classes names in loggers."
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / connection / ConnectionManagerImpl.java
index 907afb6c0d88cd0b0b85204963e785b358c93631..544e7124ba44bb6627efc050820b2803a5715545 100644 (file)
@@ -1,10 +1,11 @@
 /**
  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- * <p/>
+ *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
+
 package org.opendaylight.openflowplugin.impl.connection;
 
 import java.net.InetAddress;
@@ -16,7 +17,6 @@ import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionManager;
 import org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
-import org.opendaylight.openflowplugin.api.openflow.device.handlers.MessageHandler;
 import org.opendaylight.openflowplugin.api.openflow.md.core.ConnectionConductor;
 import org.opendaylight.openflowplugin.api.openflow.md.core.HandshakeListener;
 import org.opendaylight.openflowplugin.api.openflow.md.core.HandshakeManager;
@@ -41,13 +41,19 @@ public class ConnectionManagerImpl implements ConnectionManager {
     private static final int HELLO_LIMIT = 20;
     private final boolean bitmapNegotiationEnabled = true;
     private DeviceConnectedHandler deviceConnectedHandler;
+    private final long echoReplyTimeout;
+
+    public ConnectionManagerImpl(long echoReplyTimeout) {
+        this.echoReplyTimeout = echoReplyTimeout;
+    }
+
 
     @Override
     public void onSwitchConnected(final ConnectionAdapter connectionAdapter) {
 
         LOG.trace("preparing handshake: {}", connectionAdapter.getRemoteAddress());
 
-        final int handshakeThreadLimit = 1; //TODO: move to constants/parametrize
+        final int handshakeThreadLimit = 1;
         final ThreadPoolLoggingExecutor handshakePool = createHandshakePool(
                 connectionAdapter.getRemoteAddress().toString(), handshakeThreadLimit);
 
@@ -71,7 +77,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
                 new OpenflowProtocolListenerInitialImpl(connectionContext, handshakeContext);
         connectionAdapter.setMessageListener(ofMessageListener);
 
-        final SystemNotificationsListener systemListener = new SystemNotificationsListenerImpl(connectionContext);
+        final SystemNotificationsListener systemListener = new SystemNotificationsListenerImpl(connectionContext, echoReplyTimeout);
         connectionAdapter.setSystemListener(systemListener);
 
         LOG.trace("connection ballet finished");
@@ -124,10 +130,4 @@ public class ConnectionManagerImpl implements ConnectionManager {
     public void setDeviceConnectedHandler(final DeviceConnectedHandler deviceConnectedHandler) {
         this.deviceConnectedHandler = deviceConnectedHandler;
     }
-
-    @Override
-    public void setMessageHandler(final MessageHandler arg0) {
-        // TODO Auto-generated method stub
-
-    }
 }