Initial code/design for an Akka Raft implementation
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / behaviors / AbstractRaftActorBehavior.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.cluster.raft.behaviors;
10
11 import org.opendaylight.controller.cluster.raft.RaftActorContext;
12
13 /**
14  * Abstract class that represents the behavior of a RaftActor
15  * <p>
16  * All Servers:
17  * <ul>
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)
22  */
23 public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
24
25     /**
26      * Information about the RaftActor whose behavior this class represents
27      */
28     protected final RaftActorContext context;
29
30
31     protected AbstractRaftActorBehavior(RaftActorContext context) {
32         this.context = context;
33     }
34 }