Document FindLeader message
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / client / messages / FindLeader.java
index eebbde3393bfd75da5094a79eb77f3c1f1753d96..f99dc773c05f7be711a174413d9b9b1dd9286e9e 100644 (file)
@@ -8,9 +8,27 @@
 
 package org.opendaylight.controller.cluster.raft.client.messages;
 
+import com.google.common.annotations.VisibleForTesting;
 import java.io.Serializable;
 
-public class FindLeader implements Serializable{
+/**
+ * Request to locate the leader raft actor. Each {@link org.opendaylight.controller.cluster.raft.RaftActor} must
+ * respond with a {@link FindLeaderReply} containing the address of the leader, as it is known to that particular
+ * actor.
+ *
+ * This message is intended for testing purposes only.
+ */
+@VisibleForTesting
+public final class FindLeader implements Serializable {
     private static final long serialVersionUID = 1L;
+    public static final FindLeader INSTANCE = new FindLeader();
+
+    private FindLeader() {
+        // Hidden to force reuse
+    }
 
+    @SuppressWarnings({ "static-method", "unused" })
+    private FindLeader readResolve() {
+        return INSTANCE;
+    }
 }