BUG-3183: Extend notification publisher API
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / BindingDOMNotificationPublishServiceAdapter.java
index 084f423807df24f004c3aa1a6dd6c3424905d1b7..1fe81ea3f497d6511293582e19feb237cb10bad4 100644 (file)
@@ -52,16 +52,19 @@ public class BindingDOMNotificationPublishServiceAdapter implements Notification
     }
 
     @Override
-    public boolean offerNotification(final Notification notification) {
-        final ListenableFuture<?> listenableFuture = domPublishService.offerNotification(toDomNotification(notification));
-        return !DOMNotificationPublishService.REJECTED.equals(listenableFuture);
+    public ListenableFuture<? extends Object> offerNotification(final Notification notification) {
+        ListenableFuture<?> offerResult = domPublishService.offerNotification(toDomNotification(notification));
+        return DOMNotificationPublishService.REJECTED.equals(offerResult)
+                ? NotificationPublishService.REJECTED
+                : offerResult;
     }
 
     @Override
-    public boolean offerNotification(final Notification notification, final int timeout, final TimeUnit unit) throws InterruptedException {
-        final ListenableFuture<?> listenableFuture =
-                domPublishService.offerNotification(toDomNotification(notification), timeout, unit);
-        return !DOMNotificationPublishService.REJECTED.equals(listenableFuture);
+    public ListenableFuture<? extends Object> offerNotification(final Notification notification, final int timeout, final TimeUnit unit) throws InterruptedException {
+        ListenableFuture<?> offerResult = domPublishService.offerNotification(toDomNotification(notification), timeout, unit);
+        return DOMNotificationPublishService.REJECTED.equals(offerResult)
+                ? NotificationPublishService.REJECTED
+                : offerResult;
     }
 
     private DOMNotification toDomNotification(final Notification notification) {