Another round of ofp-impl warning fixes
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / connection / ConnectionManagerImpl.java
index 2e6e5bb625a2ce0d782626197b29b28929f45379..0f54f01a94e5c25aa7226bb0344219590386cbe3 100644 (file)
@@ -29,6 +29,7 @@ import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener;
+import org.opendaylight.openflowjava.protocol.impl.core.SslContextFactory;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionManager;
@@ -56,6 +57,7 @@ import org.slf4j.LoggerFactory;
 public class ConnectionManagerImpl implements ConnectionManager {
 
     private static final Logger LOG = LoggerFactory.getLogger(ConnectionManagerImpl.class);
+    private static final Logger OF_EVENT_LOG = LoggerFactory.getLogger("OfEventLog");
     private static final boolean BITMAP_NEGOTIATION_ENABLED = true;
     private final ThreadFactory threadFactory = new ThreadFactoryBuilder()
             .setNameFormat("ConnectionHandler-%d")
@@ -90,6 +92,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
     @Override
     public void onSwitchConnected(final ConnectionAdapter connectionAdapter) {
         connectionAdapter.setExecutorService(executorsService);
+        OF_EVENT_LOG.debug("OnSwitchConnected event received for device {}", connectionAdapter.getRemoteAddress());
         LOG.trace("prepare connection context");
         final ConnectionContext connectionContext = new ConnectionContextImpl(connectionAdapter,
                 deviceConnectionStatusProvider);
@@ -115,6 +118,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
         final SystemNotificationsListener systemListener = new SystemNotificationsListenerImpl(connectionContext,
                 config.getEchoReplyTimeout().getValue().toJava(), executorService, notificationPublishService);
         connectionAdapter.setSystemListener(systemListener);
+        SslContextFactory.setIsCustomTrustManagerEnabled(config.getEnableCustomTrustManager());
 
         LOG.trace("connection ballet finished");
     }
@@ -180,22 +184,22 @@ public class ConnectionManagerImpl implements ConnectionManager {
         }
 
         @Override
-        public LocalDateTime getDeviceLastConnectionTime(BigInteger nodeId) {
+        public LocalDateTime getDeviceLastConnectionTime(final BigInteger nodeId) {
             return deviceConnectionMap.get(nodeId);
         }
 
         @Override
-        public void addDeviceLastConnectionTime(BigInteger nodeId, LocalDateTime time) {
+        public void addDeviceLastConnectionTime(final BigInteger nodeId, final LocalDateTime time) {
             deviceConnectionMap.put(nodeId, time);
         }
 
         @Override
-        public void removeDeviceLastConnectionTime(BigInteger nodeId) {
+        public void removeDeviceLastConnectionTime(final BigInteger nodeId) {
             deviceConnectionMap.remove(nodeId);
         }
 
         @Override
-        public void onDataTreeChanged(@NonNull Collection<DataTreeModification<Node>> changes) {
+        public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<Node>> changes) {
             Preconditions.checkNotNull(changes, "Changes must not be null!");
             for (DataTreeModification<Node> change : changes) {
                 final DataObjectModification<Node> mod = change.getRootNode();
@@ -217,7 +221,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
             return InstanceIdentifier.create(Nodes.class).child(Node.class);
         }
 
-        private void processNodeModification(DataTreeModification<Node> change) {
+        private void processNodeModification(final DataTreeModification<Node> change) {
             final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
             final InstanceIdentifier<Node> nodeIdent = key.firstIdentifierOf(Node.class);
             String[] nodeIdentity = nodeIdent.firstKeyOf(Node.class).getId().getValue().split(":");