X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FRaftActorContext.java;h=e20690f8e58e501ac4db2ff14d94d9c7846dd8e9;hp=aa49e1681348adb0b7a9b1de67d5acb32aef1172;hb=a5ede745694ca779d8629952e1a1069011877558;hpb=d7c18f7ec722679e4746382162efea975b6f7a97 diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContext.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContext.java index aa49e16813..e20690f8e5 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContext.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContext.java @@ -13,9 +13,11 @@ import akka.actor.ActorSelection; import akka.actor.ActorSystem; import akka.actor.Props; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Supplier; import java.util.Collection; +import java.util.function.Supplier; +import javax.annotation.Nullable; import org.opendaylight.controller.cluster.DataPersistenceProvider; +import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior; import org.opendaylight.controller.cluster.raft.policy.RaftPolicy; import org.slf4j.Logger; @@ -218,4 +220,31 @@ public interface RaftActorContext { * @return an implementation of the RaftPolicy so that the Raft code can be adapted */ RaftPolicy getRaftPolicy(); + + /** + * @return true if there are any dynamic server configuration changes available, + * false if static peer configurations are still in use + */ + boolean isDynamicServerConfigurationInUse(); + + /** + * Configures the dynamic server configurations are avaialble for the RaftActor + */ + void setDynamicServerConfigurationInUse(); + + /** + * @return the RaftActor's peer information as a ServerConfigurationPayload if the + * dynamic server configurations are available, otherwise returns null + */ + @Nullable ServerConfigurationPayload getPeerServerInfo(boolean includeSelf); + + /** + * @return true if this RaftActor is a voting member of the cluster, false otherwise. + */ + boolean isVotingMember(); + + /** + * @return current behavior attached to the raft actor. + */ + RaftActorBehavior getCurrentBehavior(); }