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.common.util;
10 import com.google.common.collect.ForwardingObject;
11 import com.google.common.util.concurrent.FluentFuture;
12 import org.opendaylight.mdsal.common.api.AsyncReadWriteTransaction;
13 import org.opendaylight.mdsal.common.api.CommitInfo;
14 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
15 import org.opendaylight.yangtools.concepts.Path;
18 * Utility {@link AsyncReadWriteTransaction} implementation which forwards all interface method
19 * invocation to a delegate instance.
21 public class ForwardingAsyncReadWriteTransaction<P extends Path<P>, D> extends ForwardingObject
22 implements AsyncReadWriteTransaction<P, D> {
24 private final AsyncReadWriteTransaction<P, D> delegate;
26 protected ForwardingAsyncReadWriteTransaction(AsyncReadWriteTransaction<P, D> delegate) {
27 this.delegate = delegate;
31 protected AsyncReadWriteTransaction<P, D> delegate() {
36 public Object getIdentifier() {
37 return delegate.getIdentifier();
41 public boolean cancel() {
42 return delegate.cancel();
46 public FluentFuture<? extends CommitInfo> commit() {
47 return delegate.commit();
51 public void delete(LogicalDatastoreType store, P path) {
52 delegate.delete(store, path);