BUG 2185 : Introduce the SwitchBehavior message
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / behaviors / RaftActorBehavior.java
index 064cd8b88c8b68152f04cdc25378c792eb263a7b..b0a7638b92abdec6aef770cc6170a5c5353cc434 100644 (file)
@@ -39,15 +39,39 @@ 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();
+
+    /**
+     * setting the index of the log entry which is replicated to all nodes
+     * @param replicatedToAllIndex
+     */
+    void setReplicatedToAllIndex(long replicatedToAllIndex);
+
+    /**
+     * @return the index of the log entry which is replicated to all nodes
+     */
+    long getReplicatedToAllIndex();
+
+    /**
+     * @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);
 }