Add registerNotificationListeners()
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / ForwardingDOMNotificationService.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 com.google.common.collect.ForwardingObject;
11 import java.util.Collection;
12 import java.util.Map;
13 import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
14 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
15 import org.opendaylight.yangtools.concepts.ListenerRegistration;
16 import org.opendaylight.yangtools.concepts.Registration;
17 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
18
19 /**
20  * Utility implementation of a {@link DOMNotificationService} which forwards all requests
21  * to a delegate instance.
22  */
23 public abstract class ForwardingDOMNotificationService extends ForwardingObject implements DOMNotificationService {
24     @Override
25     protected abstract DOMNotificationService delegate();
26
27     @Override
28     public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener,
29             final Collection<Absolute> types) {
30         return delegate().registerNotificationListener(listener, types);
31     }
32
33     @Override
34     public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener,
35             final Absolute... types) {
36         return delegate().registerNotificationListener(listener, types);
37     }
38
39     @Override
40     public Registration registerNotificationListeners(final Map<Absolute, DOMNotificationListener> typeToListener) {
41         return delegate().registerNotificationListeners(typeToListener);
42     }
43 }