Merge "Fix compilation warnings: replace deprecated junit.framework.Assert"
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / md / sal / dom / spi / ForwardingDOMNotificationPublishService.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.md.sal.dom.spi;
9
10 import com.google.common.collect.ForwardingObject;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import java.util.concurrent.TimeUnit;
13 import org.opendaylight.controller.md.sal.dom.api.DOMNotification;
14 import org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService;
15
16 /**
17  * Utility implementations of {@link DOMNotificationPublishService} which forwards
18  * all requests to a delegate instance.
19  */
20 public abstract class ForwardingDOMNotificationPublishService extends ForwardingObject implements DOMNotificationPublishService {
21     @Override
22     protected abstract DOMNotificationPublishService delegate();
23
24     @Override
25     public ListenableFuture<? extends Object> putNotification(final DOMNotification notification) throws InterruptedException {
26         return delegate().putNotification(notification);
27     }
28
29     @Override
30     public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification) {
31         return delegate().offerNotification(notification);
32     }
33
34     @Override
35     public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification, final long timeout,
36             final TimeUnit unit) throws InterruptedException {
37         return delegate().offerNotification(notification, timeout, unit);
38     }
39 }