2 * Copyright (c) 2014 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.datastore;
10 import static java.util.Objects.requireNonNull;
12 import akka.actor.ActorRef;
13 import org.opendaylight.controller.cluster.datastore.messages.DataExists;
14 import org.opendaylight.controller.cluster.datastore.messages.ReadData;
17 * Actor for a shard read transaction.
21 public class ShardReadTransaction extends ShardTransaction {
22 private final AbstractShardDataTreeTransaction<?> transaction;
24 public ShardReadTransaction(final AbstractShardDataTreeTransaction<?> transaction, final ActorRef shardActor,
25 final ShardStats shardStats) {
26 super(shardActor, shardStats, transaction.getIdentifier());
27 this.transaction = requireNonNull(transaction);
31 public void handleReceive(final Object message) {
32 if (ReadData.isSerializedType(message)) {
33 readData(transaction, ReadData.fromSerializable(message));
34 } else if (DataExists.isSerializedType(message)) {
35 dataExists(transaction, DataExists.fromSerializable(message));
37 super.handleReceive(message);
42 protected AbstractShardDataTreeTransaction<?> getDOMStoreTransaction() {
47 protected boolean returnCloseTransactionReply() {