2 * Copyright © 2017, 2018 Red Hat, Inc. and others.
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
8 package org.opendaylight.mdsal.binding.spi;
10 import com.google.common.collect.ForwardingObject;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.mdsal.binding.api.DataBroker;
13 import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
14 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
15 import org.opendaylight.mdsal.binding.api.ReadTransaction;
16 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
17 import org.opendaylight.mdsal.binding.api.TransactionChain;
18 import org.opendaylight.mdsal.binding.api.WriteTransaction;
19 import org.opendaylight.yangtools.concepts.Registration;
20 import org.opendaylight.yangtools.yang.binding.DataObject;
23 * Utility {@link DataBroker} implementation which forwards all interface method invocation to a delegate instance.
25 public abstract class ForwardingDataBroker extends ForwardingObject implements DataBroker {
27 protected abstract @NonNull DataBroker delegate();
30 public ReadTransaction newReadOnlyTransaction() {
31 return delegate().newReadOnlyTransaction();
35 public ReadWriteTransaction newReadWriteTransaction() {
36 return delegate().newReadWriteTransaction();
40 public WriteTransaction newWriteOnlyTransaction() {
41 return delegate().newWriteOnlyTransaction();
45 public <T extends DataObject> Registration registerDataTreeChangeListener(final DataTreeIdentifier<T> treeId,
46 final DataTreeChangeListener<T> listener) {
47 return delegate().registerDataTreeChangeListener(treeId, listener);
51 public TransactionChain createTransactionChain() {
52 return delegate().createTransactionChain();
56 public TransactionChain createMergingTransactionChain() {
57 return delegate().createMergingTransactionChain();