X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fbehaviors%2FRaftActorBehavior.java;h=b0a7638b92abdec6aef770cc6170a5c5353cc434;hb=766df8b58cc1decd7b40e0adbf41d3657fc21f2c;hp=a4f7a42640500942691de396a5af0230808f69c6;hpb=a89f83014714207a4ccb704eb75050d758266d71;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java index a4f7a42640..b0a7638b92 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/RaftActorBehavior.java @@ -39,15 +39,14 @@ public interface RaftActorBehavior extends AutoCloseable{ RaftActorBehavior handleMessage(ActorRef sender, Object message); /** - * The state associated with a given behavior * - * @return + * @return The state associated with a given behavior */ RaftState state(); /** * - * @return + * @return The Id of the Leader if known else null */ String getLeaderId(); @@ -58,13 +57,21 @@ public interface RaftActorBehavior extends AutoCloseable{ void setReplicatedToAllIndex(long replicatedToAllIndex); /** - * getting the index of the log entry which is replicated to all nodes - * @return + * @return the index of the log entry which is replicated to all nodes */ long getReplicatedToAllIndex(); /** - * Returns the leader's payload data version. + * @return the leader's payload data version. */ short getLeaderPayloadVersion(); + + /** + * switchBehavior makes sure that the current behavior is shutdown before it switches to the new + * behavior + * + * @param behavior The new behavior to switch to + * @return The new behavior + */ + RaftActorBehavior switchBehavior(RaftActorBehavior behavior); }