2 * Copyright (c) 2017 Pantheon Technologies s.r.o. 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
9 package org.opendaylight.netconf.topology.singleton.impl.tx;
11 import akka.actor.ActorRef;
12 import akka.actor.ActorSystem;
13 import akka.util.Timeout;
14 import com.google.common.base.Optional;
15 import com.google.common.util.concurrent.CheckedFuture;
16 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
17 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
18 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
19 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
20 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
21 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
24 * ProxyReadTransaction uses provided {@link ActorRef} to delegate method calls to master
25 * {@link org.opendaylight.netconf.topology.singleton.impl.actors.ReadTransactionActor}.
27 public class ProxyReadTransaction implements DOMDataReadOnlyTransaction {
29 private final ProxyReadAdapter delegate;
32 * Constructor for {@code ProxyReadTransaction}.
34 * @param masterTxActor {@link org.opendaylight.netconf.topology.singleton.impl.actors.ReadTransactionActor} ref
36 * @param actorSystem system
37 * @param askTimeout timeout
39 public ProxyReadTransaction(final ActorRef masterTxActor, final RemoteDeviceId id, final ActorSystem actorSystem,
40 final Timeout askTimeout) {
41 delegate = new ProxyReadAdapter(masterTxActor, id, actorSystem, askTimeout);
50 public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
51 final YangInstanceIdentifier path) {
52 return delegate.read(store, path);
56 public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
57 final YangInstanceIdentifier path) {
58 return delegate.exists(store, path);
63 public Object getIdentifier() {