import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.TimeUnit;
-import org.opendaylight.mdsal.binding.javav2.spec.base.InstanceIdentifier;
-import org.opendaylight.mdsal.binding.javav2.spec.base.KeyedInstanceIdentifier;
import org.opendaylight.mdsal.binding.javav2.spec.base.Notification;
-import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
/**
* A {@link NotificationService} which also allows its users to submit YANG-modeled notifications for delivery.
* - {@link #offerNotification(org.opendaylight.mdsal.binding.javav2.spec.base.Notification, int, TimeUnit)}, which may
* block for specified time if resources are thin.
*
- * <p>
- * Every method has two alternatives for YANG 1.1 notifications tied to container or list node.
- *
*<p>
* The actual delivery to listeners is asynchronous and implementation-specific.
* Users of this interface should not make any assumptions as to whether the
*/
@Beta
-public interface NotificationPublishService {
+public interface NotificationPublishService extends BindingService {
ListenableFuture<Object> REJECTED = Futures.immediateFailedFuture(
new NotificationRejectedException("Rejected due to resource constraints."));
- void putNotification(Notification notification) throws InterruptedException;
-
- ListenableFuture<?> offerNotification(Notification notification);
-
- ListenableFuture<?> offerNotification(Notification notification, int timeout, TimeUnit unit)
- throws InterruptedException;
+ void putNotification(Notification<?> notification) throws InterruptedException;
+ ListenableFuture<?> offerNotification(Notification<?> notification);
- <T extends TreeNode> void putContainerNotification(Notification notification, InstanceIdentifier<T> ii)
+ ListenableFuture<?> offerNotification(Notification<?> notification, int timeout, TimeUnit unit)
throws InterruptedException;
- <T extends TreeNode> ListenableFuture<?> offerContainerNotification(Notification notification,
- InstanceIdentifier<T> ii);
-
- <T extends TreeNode> ListenableFuture<?> offerContainerNotification(Notification notification, int timeout,
- TimeUnit unit, InstanceIdentifier<T> ii) throws InterruptedException;
-
-
- <T extends TreeNode, K> void putListNotification(Notification notification, KeyedInstanceIdentifier<T, K> kii)
- throws InterruptedException;
-
- <T extends TreeNode, K> ListenableFuture<?> offerListNotification(Notification notification,
- KeyedInstanceIdentifier<T, K> kii);
-
- <T extends TreeNode, K> ListenableFuture<?> offerListNotification(Notification notification, int timeout,
- TimeUnit unit, KeyedInstanceIdentifier<T, K> kii) throws InterruptedException;
}