2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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.dom.spi;
10 import com.google.common.collect.ForwardingObject;
11 import com.google.common.util.concurrent.FluentFuture;
12 import java.util.Optional;
13 import javax.annotation.Nonnull;
14 import org.opendaylight.mdsal.common.api.CommitInfo;
15 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
16 import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
18 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
21 * Utility {@link DOMDataTreeReadWriteTransaction} implementation which forwards all interface
22 * method invocation to a delegate instance.
24 public abstract class ForwardingDOMDataReadWriteTransaction extends ForwardingObject
25 implements DOMDataTreeReadWriteTransaction {
28 protected abstract DOMDataTreeReadWriteTransaction delegate();
31 public FluentFuture<Optional<NormalizedNode<?, ?>>> read(final LogicalDatastoreType store,
32 final YangInstanceIdentifier path) {
33 return delegate().read(store, path);
37 public FluentFuture<Boolean> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
38 return delegate().exists(store, path);
42 public Object getIdentifier() {
43 return delegate().getIdentifier();
47 public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path,
48 final NormalizedNode<?, ?> data) {
49 delegate().put(store, path, data);
53 public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path,
54 final NormalizedNode<?, ?> data) {
55 delegate().merge(store, path, data);
59 public boolean cancel() {
60 return delegate().cancel();
64 public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
65 delegate().delete(store, path);
69 public FluentFuture<? extends CommitInfo> commit() {
70 return delegate().commit();