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
9 package org.opendaylight.controller.cluster.datastore;
11 import akka.actor.UntypedActor;
12 import org.opendaylight.controller.cluster.datastore.messages.AbortTransaction;
13 import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply;
14 import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransaction;
15 import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransactionReply;
16 import org.opendaylight.controller.cluster.datastore.messages.CommitTransaction;
17 import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply;
18 import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransaction;
19 import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransactionReply;
21 public class NoOpCohort extends UntypedActor {
23 @Override public void onReceive(Object message) throws Exception {
24 if (message.getClass().equals(CanCommitTransaction.SERIALIZABLE_CLASS)) {
25 getSender().tell(new CanCommitTransactionReply(false).toSerializable(), getSelf());
26 } else if (message.getClass().equals(PreCommitTransaction.SERIALIZABLE_CLASS)) {
28 new PreCommitTransactionReply().toSerializable(),
30 } else if (message.getClass().equals(CommitTransaction.SERIALIZABLE_CLASS)) {
31 getSender().tell(new CommitTransactionReply().toSerializable(), getSelf());
32 } else if (message.getClass().equals(AbortTransaction.SERIALIZABLE_CLASS)) {
33 getSender().tell(new AbortTransactionReply().toSerializable(), getSelf());
35 throw new Exception ("Not recognized message received,message="+message);