Introduce PeerInfo and VotingState
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorContext.java
index 0c9d698cd5404f0675d11df935351df529b448f2..c325875950169854685c2746178524155eb5f6fc 100644 (file)
@@ -15,7 +15,6 @@ import akka.actor.Props;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Supplier;
 import java.util.Collection;
-import java.util.Map;
 import org.opendaylight.controller.cluster.DataPersistenceProvider;
 import org.opendaylight.controller.cluster.raft.policy.RaftPolicy;
 import org.slf4j.Logger;
@@ -103,12 +102,6 @@ public interface RaftActorContext {
      */
     Logger getLogger();
 
-    /**
-     * @return a copy of the mapping of peerId's to their addresses
-     *
-     */
-    Map<String, String> getPeerAddresses();
-
     /**
      * Get the address of the peer as a String. This is the same format in
      * which a consumer would provide the address
@@ -119,18 +112,31 @@ public interface RaftActorContext {
      */
     String getPeerAddress(String peerId);
 
+    /**
+     * @return list of PeerInfo
+     */
+    Collection<PeerInfo> getPeers();
+
     /**
      * @return the list of peer IDs.
      */
     Collection<String> getPeerIds();
 
+    /**
+     * Get the PeerInfo for the given peer.
+     *
+     * @param peerId
+     * @return the PeerInfo
+     */
+    PeerInfo getPeerInfo(String peerId);
+
     /**
      * Add to actor peers
      *
      * @param name
      * @param address
      */
-    void addToPeers(String name, String address);
+    void addToPeers(String name, String address, VotingState votingState);
 
     /**
      *