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.LongSupplier;
+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;
*/
String getPeerAddress(String peerId);
+ /**
+ * @param serverCfgPayload
+ */
+ void updatePeerIds(ServerConfigurationPayload serverCfgPayload);
+
/**
* @return list of PeerInfo
*/
* @param retriever a supplier of the total memory metric
*/
@VisibleForTesting
- void setTotalMemoryRetriever(Supplier<Long> retriever);
+ void setTotalMemoryRetriever(LongSupplier retriever);
/**
*
* @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 true if there are any voting peers, false otherwise.
+ */
+ boolean anyVotingPeers();
+
+ /**
+ * @return current behavior attached to the raft actor.
+ */
+ RaftActorBehavior getCurrentBehavior();
}