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.jmx.mbeans.shard.ShardStats;
14 import org.opendaylight.controller.cluster.datastore.messages.DataExists;
15 import org.opendaylight.controller.cluster.datastore.messages.ReadData;
18 * Actor for a shard read transaction.
22 public class ShardReadTransaction extends ShardTransaction {
23 private final AbstractShardDataTreeTransaction<?> transaction;
25 public ShardReadTransaction(final AbstractShardDataTreeTransaction<?> transaction, final ActorRef shardActor,
26 final ShardStats shardStats) {
27 super(shardActor, shardStats, transaction.getIdentifier());
28 this.transaction = requireNonNull(transaction);
32 public void handleReceive(final Object message) {
33 if (ReadData.isSerializedType(message)) {
34 readData(transaction, ReadData.fromSerializable(message));
35 } else if (DataExists.isSerializedType(message)) {
36 dataExists(transaction, DataExists.fromSerializable(message));
38 super.handleReceive(message);
43 protected AbstractShardDataTreeTransaction<?> getDOMStoreTransaction() {
48 protected boolean returnCloseTransactionReply() {