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.raft.behaviors;
11 import org.opendaylight.controller.cluster.raft.RaftActorContext;
14 * Abstract class that represents the behavior of a RaftActor
18 * <li> If commitIndex > lastApplied: increment lastApplied, apply
19 * log[lastApplied] to state machine (§5.3)
20 * <li> If RPC request or response contains term T > currentTerm:
21 * set currentTerm = T, convert to follower (§5.1)
23 public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
26 * Information about the RaftActor whose behavior this class represents
28 protected final RaftActorContext context;
31 protected AbstractRaftActorBehavior(RaftActorContext context) {
32 this.context = context;