Merge "Created Network Service Functions Features"
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorContext.java
index 554461a76c7480d27d5ef5daaf9cd6f814d5e2ff..7150ec0e6e8fd889f383a4aaace4b250a44061bc 100644 (file)
@@ -12,8 +12,9 @@ import akka.actor.ActorRef;
 import akka.actor.ActorSelection;
 import akka.actor.ActorSystem;
 import akka.actor.Props;
+import akka.event.LoggingAdapter;
 
-import java.util.concurrent.atomic.AtomicLong;
+import java.util.Map;
 
 /**
  * The RaftActorContext contains that portion of the RaftActors state that
@@ -62,7 +63,13 @@ public interface RaftActorContext {
      *    monotonically)
      * @return
      */
-    AtomicLong getCommitIndex();
+    long getCommitIndex();
+
+
+    /**
+     *
+     */
+    void setCommitIndex(long commitIndex);
 
     /**
      * index of highest log entry applied to state
@@ -70,7 +77,13 @@ public interface RaftActorContext {
      *    monotonically)
      * @return
      */
-    AtomicLong getLastApplied();
+    long getLastApplied();
+
+
+    /**
+     *
+     */
+    void setLastApplied(long lastApplied);
 
     /**
      * @return A representation of the log
@@ -81,4 +94,36 @@ public interface RaftActorContext {
      * @return The ActorSystem associated with this context
      */
     ActorSystem getActorSystem();
+
+    /**
+     *
+     * @return
+     */
+    LoggingAdapter getLogger();
+
+    /**
+     * Get a mapping of peer id's their addresses
+     * @return
+     */
+    Map<String, String> getPeerAddresses();
+
+    /**
+     *
+     * @param peerId
+     * @return
+     */
+    String getPeerAddress(String peerId);
+
+    /**
+     * Add to actor peers
+     * @param name
+     * @param address
+     */
+    void addToPeers(String name, String address);
+
+    /**
+     *
+     * @param name
+     */
+    public void removePeer(String name);
 }