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=b20e9daa945cee3e14cb0181be72317808b8afc0;hb=8882e6077db69d22bcc57fcf12dd4a02a81a4967;hp=0c9d698cd5404f0675d11df935351df529b448f2;hpb=5aa58404a8ee1ad053742780439823309360a3a1;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 0c9d698cd5..b20e9daa94 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,7 @@ 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 javax.annotation.Nullable; import org.opendaylight.controller.cluster.DataPersistenceProvider; import org.opendaylight.controller.cluster.raft.policy.RaftPolicy; import org.slf4j.Logger; @@ -103,12 +103,6 @@ public interface RaftActorContext { */ Logger getLogger(); - /** - * @return a copy of the mapping of peerId's to their addresses - * - */ - Map 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 +113,36 @@ public interface RaftActorContext { */ String getPeerAddress(String peerId); + /** + * @param serverCfgPayload + */ + void updatePeerIds(ServerConfigurationPayload serverCfgPayload); + + /** + * @return list of PeerInfo + */ + Collection getPeers(); + /** * @return the list of peer IDs. */ Collection 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); /** * @@ -207,4 +219,21 @@ 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(); }