Merge "All openflow nodes are not getting listed in the output of getallnodes in...
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / connection / OutboundQueueProviderImpl.java
index 49d0c2d463623a2e0d21ad8832ec7dcecb0205a0..37a94d220bb1ed85700c65e4083f11af85b967fa 100644 (file)
@@ -9,7 +9,8 @@
 package org.opendaylight.openflowplugin.impl.connection;
 
 import com.google.common.util.concurrent.FutureCallback;
-import javax.annotation.Nonnull;
+import java.util.function.Function;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
 import org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;
@@ -18,9 +19,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * Created by Martin Bobak <mbobak@cisco.com> on 12.5.2015.
- */
 public class OutboundQueueProviderImpl implements OutboundQueueProvider {
     private static final Logger LOG = LoggerFactory.getLogger(OutboundQueueProviderImpl.class);
     private final short ofVersion;
@@ -30,9 +28,9 @@ public class OutboundQueueProviderImpl implements OutboundQueueProvider {
         this.ofVersion = ofVersion;
     }
 
-    @Nonnull
+    @NonNull
     @Override
-    public BarrierInput createBarrierRequest(@Nonnull final Long xid) {
+    public BarrierInput createBarrierRequest(@NonNull final Long xid) {
         final BarrierInputBuilder biBuilder = new BarrierInputBuilder();
         biBuilder.setVersion(ofVersion);
         biBuilder.setXid(xid);
@@ -42,7 +40,9 @@ public class OutboundQueueProviderImpl implements OutboundQueueProvider {
 
     @Override
     public synchronized void onConnectionQueueChanged(final OutboundQueue queue) {
-        LOG.debug("Replacing queue {} with {}", outboundQueue, queue);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Replacing queue {} with {}", outboundQueue, queue);
+        }
         outboundQueue = queue;
         notifyAll();
     }
@@ -80,4 +80,10 @@ public class OutboundQueueProviderImpl implements OutboundQueueProvider {
     public void commitEntry(final Long xid, final OfHeader message, final FutureCallback<OfHeader> callback) {
         outboundQueue.commitEntry(xid, message, callback);
     }
+
+    @Override
+    public void commitEntry(final Long xid, final OfHeader message, final FutureCallback<OfHeader> callback,
+            final Function<OfHeader, Boolean> isComplete) {
+        outboundQueue.commitEntry(xid, message, callback, isComplete);
+    }
 }