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
8 package org.opendaylight.netconf.topology.singleton.impl.actors;
10 import akka.actor.Props;
11 import akka.actor.UntypedAbstractActor;
12 import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
13 import org.opendaylight.netconf.topology.singleton.messages.transactions.ReadActorMessage;
16 * ReadTransactionActor is an interface to device's {@link DOMDataTreeReadTransaction} for cluster nodes.
18 public final class ReadTransactionActor extends UntypedAbstractActor {
20 private final ReadAdapter readAdapter;
22 private ReadTransactionActor(final DOMDataTreeReadTransaction tx) {
23 readAdapter = new ReadAdapter(tx);
27 * Creates new actor Props.
29 * @param tx delegate device read transaction
32 static Props props(final DOMDataTreeReadTransaction tx) {
33 return Props.create(ReadTransactionActor.class, () -> new ReadTransactionActor(tx));
37 public void onReceive(final Object message) {
38 if (message instanceof ReadActorMessage) {
39 readAdapter.handle(message, sender(), self());