package org.opendaylight.controller.cluster.raft.base.messages;
-import com.google.protobuf.ByteString;
+import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
+import org.opendaylight.controller.cluster.raft.Snapshot;
-public class SendInstallSnapshot {
- private ByteString snapshot;
+/**
+ * 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(ByteString snapshot) {
- this.snapshot = snapshot;
+ public SendInstallSnapshot(@Nonnull Snapshot snapshot) {
+ this.snapshot = Preconditions.checkNotNull(snapshot);
}
- public ByteString getSnapshot() {
+ @Nonnull public Snapshot getSnapshot() {
return snapshot;
}
}