2 * Copyright (c) 2016 Brocade Communications 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.config.yang.config.distributed_datastore_provider;
10 import com.google.common.collect.ForwardingObject;
11 import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
12 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
13 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
14 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
15 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
16 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
17 import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
18 import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
19 import org.opendaylight.yangtools.concepts.ListenerRegistration;
20 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
21 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
24 * DOMStore implementation that forwards to a delegate.
26 * @author Thomas Pantelis
28 class ForwardingDistributedDataStore extends ForwardingObject implements DistributedDataStoreInterface, AutoCloseable {
29 private final DistributedDataStoreInterface delegate;
30 private final AutoCloseable closeable;
32 ForwardingDistributedDataStore(DistributedDataStoreInterface delegate, AutoCloseable closeable) {
33 this.delegate = delegate;
34 this.closeable = closeable;
38 public DOMStoreReadTransaction newReadOnlyTransaction() {
39 return delegate().newReadOnlyTransaction();
43 public DOMStoreWriteTransaction newWriteOnlyTransaction() {
44 return delegate().newWriteOnlyTransaction();
48 public DOMStoreReadWriteTransaction newReadWriteTransaction() {
49 return delegate().newReadWriteTransaction();
53 public <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L>
54 registerChangeListener(YangInstanceIdentifier path, L listener, DataChangeScope scope) {
55 return delegate().registerChangeListener(path, listener, scope);
59 public DOMStoreTransactionChain createTransactionChain() {
60 return delegate().createTransactionChain();
64 public ActorContext getActorContext() {
65 return delegate().getActorContext();
69 public void close() throws Exception {
74 protected DistributedDataStoreInterface delegate() {