Move null check from getTotalMemory()
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorContext.java
index 10db6d06c21850a1d2e1a619845c4a4b599e4025..6b5fffe33103f4626c17b6b3587dadd37d1a7ad8 100644 (file)
@@ -13,10 +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.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;
 
@@ -207,7 +208,7 @@ public interface RaftActorContext {
      * @param retriever a supplier of the total memory metric
      */
     @VisibleForTesting
-    void setTotalMemoryRetriever(Supplier<Long> retriever);
+    void setTotalMemoryRetriever(LongSupplier retriever);
 
     /**
      *
@@ -235,10 +236,15 @@ public interface RaftActorContext {
      * @return the RaftActor's peer information as a ServerConfigurationPayload if the
      * dynamic server configurations are available, otherwise returns null
      */
-    @Nullable ServerConfigurationPayload getPeerServerInfo();
+    @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();
 }