Copyright update
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / connection / SwitchConnectionProviderImpl.java
index cb58d14e66ee489e6c5272716504b866c3889cdb..d9e9f64ef7abad9cf751e243cf62b36e402b43a3 100644 (file)
@@ -1,4 +1,11 @@
-/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
+/*
+ * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
+ *
+ * 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.openflowjava.protocol.impl.connection;
 
@@ -10,6 +17,7 @@ import java.util.Set;
 import java.util.concurrent.Future;
 
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
+import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration.FEATURE_SUPPORT;
 import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler;
 import org.opendaylight.openflowjava.protocol.impl.core.TcpHandler;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
@@ -21,6 +29,7 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 
 /**
+ * Exposed class for server handling
  * @author mirehak
  * @author michal.polkorab
  */
@@ -41,6 +50,8 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider {
             TcpHandler server = new TcpHandler(connConfig.getAddress(), connConfig.getPort());
             server.setSwitchConnectionHandler(switchConnectionHandler);
             server.setSwitchIdleTimeout(connConfig.getSwitchIdleTimeout());
+            boolean tlsSupported = FEATURE_SUPPORT.REQUIRED.equals(connConfig.getTlsSupport());
+            server.setEncryption(tlsSupported);
             serverLot.add(server);
         }
     }
@@ -109,6 +120,9 @@ public class SwitchConnectionProviderImpl implements SwitchConnectionProvider {
         return result;
     }
 
+    /**
+     * @return servers
+     */
     public Set<ServerFacade> getServerLot() {
         return serverLot;
     }