2 * Copyright (c) 2016 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.cluster.databroker;
10 import com.google.common.base.Optional;
11 import com.google.common.util.concurrent.CheckedFuture;
12 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientTransaction;
13 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
14 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 * Proxy implementation of {@link DOMStoreReadTransaction}. It routes all requests to the backing
20 * {@link ClientTransaction}. This class is not final to allow further subclassing by
21 * {@link ShardedDOMStoreReadWriteTransaction}.
23 * @author Robert Varga
25 class ShardedDOMStoreReadTransaction extends AbstractShardedTransaction implements DOMStoreReadTransaction {
26 ShardedDOMStoreReadTransaction(final ClientTransaction tx) {
31 public final void close() {
32 transaction().abort();
36 public final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final YangInstanceIdentifier path) {
37 return transaction().read(path);
41 public final CheckedFuture<Boolean, ReadFailedException> exists(final YangInstanceIdentifier path) {
42 return transaction().exists(path);