Fix followerDistributedDataStore tear down
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / ClientBackedReadWriteTransaction.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.databroker;
9
10 import com.google.common.util.concurrent.FluentFuture;
11 import java.util.Optional;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction;
14 import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17
18 /**
19  * An implementation of {@link DOMStoreReadWriteTransaction} backed by a {@link ClientTransaction}.
20  *
21  * @author Robert Varga
22  */
23 final class ClientBackedReadWriteTransaction extends ClientBackedWriteTransaction
24         implements DOMStoreReadWriteTransaction {
25
26     ClientBackedReadWriteTransaction(final ClientTransaction delegate, final @Nullable Throwable allocationContext) {
27         super(delegate, allocationContext);
28     }
29
30     @Override
31     public FluentFuture<Optional<NormalizedNode>> read(final YangInstanceIdentifier path) {
32         return delegate().read(path);
33     }
34
35     @Override
36     public FluentFuture<Boolean> exists(final YangInstanceIdentifier path) {
37         return delegate().exists(path);
38     }
39 }