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%2FRaftActorContext.java;h=267a4d2b7e995894d8feb7a36261f24653d59e74;hb=15f11d24306fe2796411e8078a84fc82213bacf6;hp=c325875950169854685c2746178524155eb5f6fc;hpb=9491b06df9419e58db3089a4c5cd9f5407cb9aac;p=controller.git 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 c325875950..267a4d2b7e 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 @@ -15,7 +15,9 @@ import akka.actor.Props; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Supplier; import java.util.Collection; +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; @@ -112,6 +114,11 @@ public interface RaftActorContext { */ String getPeerAddress(String peerId); + /** + * @param serverCfgPayload + */ + void updatePeerIds(ServerConfigurationPayload serverCfgPayload); + /** * @return list of PeerInfo */ @@ -213,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(); }