- @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "Stores a reference to an externally mutable byte[] "
- + "object but this is OK since this class is merely a DTO and does not process byte[] internally. "
- + "Also it would be inefficient to create a copy as the byte[] could be large.")
- public CaptureSnapshotReply(byte [] snapshot) {
- this.snapshot = snapshot;
+public class CaptureSnapshotReply implements ControlMessage {
+ private final Snapshot.State snapshotState;
+ private final Optional<OutputStream> installSnapshotStream;
+
+ public CaptureSnapshotReply(final Snapshot.@NonNull State snapshotState,
+ final @NonNull Optional<OutputStream> installSnapshotStream) {
+ this.snapshotState = requireNonNull(snapshotState);
+ this.installSnapshotStream = requireNonNull(installSnapshotStream);
+ }
+
+ public Snapshot.@NonNull State getSnapshotState() {
+ return snapshotState;