Add SendInstallSnapshot javadoc 18/34618/12
authorRobert Varga <rovarga@cisco.com>
Sun, 14 Feb 2016 00:31:46 +0000 (01:31 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 17 Feb 2016 10:28:57 +0000 (10:28 +0000)
First cut at describing mechanics. Also make the class final and
annonate nullness.

Change-Id: I94119ab818713110dfab199b0e3f9e9608cfd583
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/SendInstallSnapshot.java

index 21c65e6037c106135f995323ae10b238029879eb..94e31846eebf1d947d483585ce19ec2b3a3f5ae7 100644 (file)
@@ -8,16 +8,22 @@
 
 package org.opendaylight.controller.cluster.raft.base.messages;
 
+import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
 import org.opendaylight.controller.cluster.raft.Snapshot;
 
-public class SendInstallSnapshot {
+/**
+ * Internal message sent from the SnapshotManager to its associated leader. The leader is expected to apply the
+ * {@link Snapshot} to its state.
+ */
+public final class SendInstallSnapshot {
     private final Snapshot snapshot;
 
-    public SendInstallSnapshot(Snapshot snapshot) {
-        this.snapshot = snapshot;
+    public SendInstallSnapshot(@Nonnull Snapshot snapshot) {
+        this.snapshot = Preconditions.checkNotNull(snapshot);
     }
 
-    public Snapshot getSnapshot() {
+    @Nonnull public Snapshot getSnapshot() {
         return snapshot;
     }
 }