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 org.opendaylight.mdsal.common.api.LogicalDatastoreType;
11 import org.opendaylight.mdsal.common.api.ReadFailedException;
12 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
14 import com.google.common.base.Optional;
15 import com.google.common.collect.ForwardingObject;
16 import com.google.common.util.concurrent.CheckedFuture;
17 import javax.annotation.Nonnull;
18 import org.opendaylight.mdsal.dom.api.DOMDataReadWriteTransaction;
19 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
20 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
23 * Utility {@link DOMDataReadWriteTransaction} implementation which forwards all interface
24 * method invocation to a delegate instance.
26 public abstract class ForwardingDOMDataReadWriteTransaction extends ForwardingObject implements DOMDataReadWriteTransaction {
28 protected abstract @Nonnull DOMDataReadWriteTransaction delegate();
31 public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
32 return delegate().read(store, path);
36 public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
37 return delegate().exists(store, path);
41 public Object getIdentifier() {
42 return delegate().getIdentifier();
46 public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
47 delegate().put(store, path, data);
51 public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
52 delegate().merge(store, path, data);
56 public boolean cancel() {
57 return delegate().cancel();
61 public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
62 delegate().delete(store, path);
66 public CheckedFuture<Void, TransactionCommitFailedException> submit() {
67 return delegate().submit();