Fix for openflow devices not connecting to controller
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / services / sal / SalBundleServiceImpl.java
index 232dce1618711e3247bc9f12a537e9f2bda78b2a..d1c223a0813d04227ba72becf9f5e56be69964fa 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.openflowplugin.impl.services.sal;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.JdkFutureAdapters;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
@@ -32,12 +31,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.on
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Simple bundle extension service.
  */
 public class SalBundleServiceImpl implements SalBundleService {
-
+    private static final Logger LOG = LoggerFactory.getLogger(SalBundleServiceImpl.class);
     private final SalExperimenterMessageService experimenterMessageService;
 
     public SalBundleServiceImpl(final SalExperimenterMessageService experimenterMessageService) {
@@ -47,6 +48,7 @@ public class SalBundleServiceImpl implements SalBundleService {
 
     @Override
     public ListenableFuture<RpcResult<ControlBundleOutput>> controlBundle(ControlBundleInput input) {
+        LOG.debug("Control message for device {} and bundle type {}", input.getNode(), input.getType());
         final SendExperimenterInputBuilder experimenterInputBuilder = new SendExperimenterInputBuilder();
         experimenterInputBuilder.setNode(input.getNode());
         experimenterInputBuilder.setExperimenterMessageOfChoice(
@@ -76,9 +78,7 @@ public class SalBundleServiceImpl implements SalBundleService {
             dataBuilder.setBundleInnerMessage(message.getBundleInnerMessage());
             experimenterInputBuilder.setExperimenterMessageOfChoice(
                     bundleAddMessageBuilder.setSalAddMessageData(dataBuilder.build()).build());
-            ListenableFuture<RpcResult<SendExperimenterOutput>> res = JdkFutureAdapters
-                    .listenInPoolThread(experimenterMessageService.sendExperimenter(experimenterInputBuilder.build()));
-            partialResults.add(res);
+            partialResults.add(experimenterMessageService.sendExperimenter(experimenterInputBuilder.build()));
         }
         return processResults(partialResults);
     }