Fix followerDistributedDataStore tear down
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / ClientBackedWriteTransaction.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 org.eclipse.jdt.annotation.Nullable;
11 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction;
12 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
13 import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16
17 /**
18  * An implementation of {@link DOMStoreWriteTransaction} backed by a {@link ClientTransaction}.
19  *
20  * @author Robert Varga
21  */
22 class ClientBackedWriteTransaction extends ClientBackedTransaction<ClientTransaction>
23         implements DOMStoreWriteTransaction {
24     ClientBackedWriteTransaction(final ClientTransaction delegate, final @Nullable Throwable allocationContext) {
25         super(delegate, allocationContext);
26     }
27
28     @Override
29     public final void write(final YangInstanceIdentifier path, final NormalizedNode data) {
30         delegate().write(path, data);
31     }
32
33     @Override
34     public final void merge(final YangInstanceIdentifier path, final NormalizedNode data) {
35         delegate().merge(path, data);
36     }
37
38     @Override
39     public final void delete(final YangInstanceIdentifier path) {
40         delegate().delete(path);
41     }
42
43     @Override
44     public final DOMStoreThreePhaseCommitCohort ready() {
45         return delegate().ready();
46     }
47 }