BUG-3128: Update RPC router concepts
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / md / sal / dom / api / DOMNotificationPublishService.java
index dc2ced78072e986068bbb273021d682071c49e5e..f80a124a8d08348719a9ab02a79423cc84bb0661 100644 (file)
@@ -29,7 +29,7 @@ public interface DOMNotificationPublishService extends DOMService, BrokerService
      * Well-known value indicating that the implementation is currently not
      * able to accept a notification.
      */
-    ListenableFuture<Object> REJECTED = Futures.immediateFailedFuture(new Throwable("Unacceptable blocking conditions encountered"));
+    ListenableFuture<Object> REJECTED = Futures.immediateFailedFuture(new DOMNotificationRejectedException("Unacceptable blocking conditions encountered"));
 
     /**
      * Publish a notification. The result of this method is a {@link ListenableFuture}
@@ -41,12 +41,15 @@ public interface DOMNotificationPublishService extends DOMService, BrokerService
      * Abstract subclasses can refine the return type as returning a promise of a
      * more specific type, e.g.:
      *
+     * {@code
      *     public interface DeliveryStatus { int getListenerCount(); }
      *     ListenableFuture<? extends DeliveryStatus> putNotification(DOMNotification notification);
+     * }
      *
      * Once the Future succeeds, the resulting object can be queried for traits using
      * instanceof, e.g:
      *
+     * {@code
      *     // Can block when (for example) the implemention's ThreadPool queue is full
      *     Object o = service.putNotification(notif).get();
      *     if (o instanceof DeliveryStatus) {
@@ -70,7 +73,7 @@ public interface DOMNotificationPublishService extends DOMService, BrokerService
      * @throws InterruptedException if interrupted while waiting
      * @throws NullPointerException if notification is null.
      */
-    @Nonnull ListenableFuture<? extends Object> putNotification(@Nonnull DOMNotification notification) throws InterruptedException;
+    @Nonnull ListenableFuture<?> putNotification(@Nonnull DOMNotification notification) throws InterruptedException;
 
     /**
      * Attempt to publish a notification. The result of this method is a {@link ListenableFuture}
@@ -83,11 +86,11 @@ public interface DOMNotificationPublishService extends DOMService, BrokerService
      * @param notification Notification to be published.
      * @return A listenable future which will report completion when the service
      *         has finished propagating the notification to its immediate registrants,
-     *         or {@value #REJECTED} if resource constraints prevent
+     *         or {@link #REJECTED} if resource constraints prevent
      *         the implementation from accepting the notification for delivery.
      * @throws NullPointerException if notification is null.
      */
-    @Nonnull ListenableFuture<? extends Object> offerNotification(@Nonnull DOMNotification notification);
+    @Nonnull ListenableFuture<?> offerNotification(@Nonnull DOMNotification notification);
 
     /**
      * Attempt to publish a notification. The result of this method is a {@link ListenableFuture}
@@ -102,12 +105,12 @@ public interface DOMNotificationPublishService extends DOMService, BrokerService
      * @param unit a TimeUnit determining how to interpret the timeout parameter
      * @return A listenable future which will report completion when the service
      *         has finished propagating the notification to its immediate registrants,
-     *         or {@value #REJECTED} if resource constraints prevent
+     *         or {@link #REJECTED} if resource constraints prevent
      *         the implementation from accepting the notification for delivery.
      * @throws InterruptedException if interrupted while waiting
      * @throws NullPointerException if notification or unit is null.
      * @throws IllegalArgumentException if timeout is negative.
      */
-    @Nonnull ListenableFuture<? extends Object> offerNotification(@Nonnull DOMNotification notification,
+    @Nonnull ListenableFuture<?> offerNotification(@Nonnull DOMNotification notification,
         @Nonnegative long timeout, @Nonnull TimeUnit unit) throws InterruptedException;
 }