cc981e5711ae5e2e356adf693dded5abe126e4fb
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / CaptureSnapshotReply.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.raft.base.messages;
9
10 import com.google.common.base.Preconditions;
11 import java.io.OutputStream;
12 import java.util.Optional;
13 import javax.annotation.Nonnull;
14 import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
15
16 public class CaptureSnapshotReply {
17     private final Snapshot.State snapshotState;
18     private final Optional<OutputStream> installSnapshotStream;
19
20     public CaptureSnapshotReply(@Nonnull final Snapshot.State snapshotState,
21             @Nonnull final Optional<OutputStream> installSnapshotStream) {
22         this.snapshotState = Preconditions.checkNotNull(snapshotState);
23         this.installSnapshotStream = Preconditions.checkNotNull(installSnapshotStream);
24     }
25
26     @Nonnull
27     public Snapshot.State getSnapshotState() {
28         return snapshotState;
29     }
30
31     @Nonnull
32     public Optional<OutputStream> getInstallSnapshotStream() {
33         return installSnapshotStream;
34     }
35 }