db5380529fd908d1f3eb0f22d639a69f1b9cfa51
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / 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.mdsal.dom.spi;
9
10 import org.opendaylight.mdsal.dom.api.DOMNotification;
11 import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
12
13 import com.google.common.collect.ForwardingObject;
14 import com.google.common.util.concurrent.ListenableFuture;
15 import java.util.concurrent.TimeUnit;
16
17 /**
18  * Utility implementations of {@link DOMNotificationPublishService} which forwards
19  * all requests to a delegate instance.
20  */
21 public abstract class ForwardingDOMNotificationPublishService extends ForwardingObject implements DOMNotificationPublishService {
22     @Override
23     protected abstract DOMNotificationPublishService delegate();
24
25     @Override
26     public ListenableFuture<? extends Object> putNotification(final DOMNotification notification) throws InterruptedException {
27         return delegate().putNotification(notification);
28     }
29
30     @Override
31     public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification) {
32         return delegate().offerNotification(notification);
33     }
34
35     @Override
36     public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification, final long timeout,
37             final TimeUnit unit) throws InterruptedException {
38         return delegate().offerNotification(notification, timeout, unit);
39     }
40 }