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.controller.md.sal.dom.spi;
10 import com.google.common.base.Optional;
11 import com.google.common.collect.ForwardingObject;
12 import com.google.common.util.concurrent.CheckedFuture;
13 import javax.annotation.Nonnull;
14 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
15 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
16 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
17 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
18 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
19 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
22 * Utility {@link DOMDataReadWriteTransaction} implementation which forwards all interface
23 * method invocation to a delegate instance.
25 public abstract class ForwardingDOMDataReadWriteTransaction extends ForwardingObject
26 implements DOMDataReadWriteTransaction {
28 protected abstract @Nonnull DOMDataReadWriteTransaction delegate();
31 public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
32 final YangInstanceIdentifier path) {
33 return delegate().read(store, path);
37 public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
38 final YangInstanceIdentifier path) {
39 return delegate().exists(store, path);
43 public Object getIdentifier() {
44 return delegate().getIdentifier();
48 public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path,
49 final NormalizedNode<?, ?> data) {
50 delegate().put(store, path, data);
54 public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path,
55 final NormalizedNode<?, ?> data) {
56 delegate().merge(store, path, data);
60 public boolean cancel() {
61 return delegate().cancel();
65 public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
66 delegate().delete(store, path);
70 public CheckedFuture<Void, TransactionCommitFailedException> submit() {
71 return delegate().submit();