2 * Copyright (c) 2014, 2015 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;
11 import org.opendaylight.controller.cluster.raft.behaviors.Candidate;
12 import org.opendaylight.controller.cluster.raft.behaviors.Follower;
13 import org.opendaylight.controller.cluster.raft.behaviors.IsolatedLeader;
14 import org.opendaylight.controller.cluster.raft.behaviors.Leader;
15 import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior;
17 public enum RaftState {
20 public RaftActorBehavior createBehavior(RaftActorContext context) {
21 return new Candidate(context);
26 public RaftActorBehavior createBehavior(RaftActorContext context) {
27 return new Follower(context);
32 public RaftActorBehavior createBehavior(RaftActorContext context) {
33 return new Leader(context);
38 public RaftActorBehavior createBehavior(RaftActorContext context) {
39 return new IsolatedLeader(context);
43 public abstract RaftActorBehavior createBehavior(RaftActorContext context);