adapted to notificationProvider API 76/20176/1
authorMartin Bobak <mbobak@cisco.com>
Tue, 12 May 2015 13:43:43 +0000 (15:43 +0200)
committerMartin Bobak <mbobak@cisco.com>
Tue, 12 May 2015 20:34:47 +0000 (22:34 +0200)
Change-Id: I50ceba80dd8125b0037e7ae970e0150615f086be
Signed-off-by: Martin Bobak <mbobak@cisco.com>
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java

index 2b173f4903e30e1e2c6ce2890929730979cc42d9..34c9ef9a45e07b9439e9abf90f25b5a639bd2ea9 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.openflowplugin.impl.device;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
+import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timeout;
@@ -28,6 +29,7 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService;
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.ThrottledConnectionsHolder;
@@ -391,7 +393,8 @@ public class DeviceContextImpl implements DeviceContext {
             } else {
                 messageSpy.spyMessage(packetInMessage.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.FROM_SWITCH_TRANSLATE_SRC_FAILURE);
             }
-            if (!notificationPublishService.offerNotification(packetReceived)) {
+            ListenableFuture<?> listenableFuture = notificationPublishService.offerNotification(packetReceived);
+            if (listenableFuture == DOMNotificationPublishService.REJECTED) {
                 LOG.debug("Notification offer refused by notification service.");
                 messageSpy.spyMessage(packetInMessage.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.FROM_SWITCH_PUBLISHED_FAILURE);
                 LOG.debug("Notification offer refused by notification service.");