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=9d391a1588ba31c575125572db2ef642e3e14e58;hb=2a89ae48921724ef5a4ab42dcff6afc74c5b0a4a;hp=4bc9162fb5d0811d8f7cba3642b0ca98fe1e1110;hpb=7be62e955c32ff7fa10753c4307199b287b1904c;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 4bc9162fb5..9d391a1588 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 @@ -12,6 +12,8 @@ import akka.actor.ActorRef; import akka.actor.ActorSelection; import akka.actor.ActorSystem; import akka.actor.Props; +import java.util.Map; +import org.slf4j.Logger; /** * The RaftActorContext contains that portion of the RaftActors state that @@ -82,6 +84,12 @@ public interface RaftActorContext { */ void setLastApplied(long lastApplied); + /** + * + * @param replicatedLog + */ + void setReplicatedLog(ReplicatedLog replicatedLog); + /** * @return A representation of the log */ @@ -91,4 +99,75 @@ public interface RaftActorContext { * @return The ActorSystem associated with this context */ ActorSystem getActorSystem(); + + /** + * Get the logger to be used for logging messages + * + * @return + */ + Logger getLogger(); + + /** + * Get a mapping of peerId's to their addresses + * + * @return + * + */ + Map getPeerAddresses(); + + /** + * Get the address of the peer as a String. This is the same format in + * which a consumer would provide the address + * + * @param peerId + * @return The address of the peer or null if the address has not yet been + * resolved + */ + String getPeerAddress(String peerId); + + /** + * Add to actor peers + * @param name + * @param address + */ + void addToPeers(String name, String address); + + /** + * + * @param name + */ + void removePeer(String name); + + /** + * Given a peerId return the corresponding actor + *

+ * + * + * @param peerId + * @return The actorSelection corresponding to the peer or null if the + * address has not yet been resolved + */ + ActorSelection getPeerActorSelection(String peerId); + + /** + * Set Peer Address can be called at a later time to change the address of + * a known peer. + * + *

+ * Throws an IllegalStateException if the peer is unknown + * + * @param peerId + * @param peerAddress + */ + void setPeerAddress(String peerId, String peerAddress); + + /** + * @return ConfigParams + */ + ConfigParams getConfigParams(); + + void setSnapshotCaptureInitiated(boolean snapshotCaptureInitiated); + + boolean isSnapshotCaptureInitiated(); + }