Take snapshot after recovery on migrated messages
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / SendInstallSnapshot.java
index 6c3313f316623c10fcdf7468e1181d5941044201..94e31846eebf1d947d483585ce19ec2b3a3f5ae7 100644 (file)
@@ -8,7 +8,22 @@
 
 package org.opendaylight.controller.cluster.raft.base.messages;
 
-import java.io.Serializable;
+import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
+import org.opendaylight.controller.cluster.raft.Snapshot;
 
-public class SendInstallSnapshot implements Serializable {
+/**
+ * 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(@Nonnull Snapshot snapshot) {
+        this.snapshot = Preconditions.checkNotNull(snapshot);
+    }
+
+    @Nonnull public Snapshot getSnapshot() {
+        return snapshot;
+    }
 }