Bug 7521: Convert DatastoreSnapshot.ShardSnapshot to store Snapshot
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / client / messages / GetSnapshotReply.java
index 2918c5e75250e08223777819a6f82422b0af460a..b0c36ace2b4174ae5f675a2c7200e7df2b435943 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.cluster.raft.client.messages;
 import com.google.common.base.Preconditions;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import javax.annotation.Nonnull;
+import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
 
 /**
  * Reply to GetSnapshot that returns a serialized Snapshot instance.
@@ -18,9 +19,9 @@ import javax.annotation.Nonnull;
  */
 public class GetSnapshotReply {
     private final String id;
-    private final byte[] snapshot;
+    private final Snapshot snapshot;
 
-    public GetSnapshotReply(@Nonnull String id, @Nonnull byte[] snapshot) {
+    public GetSnapshotReply(@Nonnull String id, @Nonnull Snapshot snapshot) {
         this.id = Preconditions.checkNotNull(id);
         this.snapshot = Preconditions.checkNotNull(snapshot);
     }
@@ -34,12 +35,12 @@ public class GetSnapshotReply {
             + "this is OK since this class is merely a DTO and does not process the byte[] internally. "
             + "Also it would be inefficient to create a return copy as the byte[] could be large.")
     @Nonnull
-    public byte[] getSnapshot() {
+    public Snapshot getSnapshot() {
         return snapshot;
     }
 
     @Override
     public String toString() {
-        return "GetSnapshotReply [id=" + id + ", snapshot.length=" + snapshot.length + "]";
+        return "GetSnapshotReply [id=" + id + ", snapshot=" + snapshot + "]";
     }
 }