Reduce JSR305 proliferation
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / SendInstallSnapshot.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 static java.util.Objects.requireNonNull;
11
12 import com.google.common.io.ByteSource;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
15
16 /**
17  * Internal message sent from the SnapshotManager to its associated leader when a snapshot capture is complete to
18  * prompt the leader to install the snapshot on its followers as needed.
19  */
20 public final class SendInstallSnapshot {
21     private final @NonNull Snapshot snapshot;
22     private final @NonNull ByteSource snapshotBytes;
23
24     public SendInstallSnapshot(@NonNull Snapshot snapshot, @NonNull ByteSource snapshotBytes) {
25         this.snapshot = requireNonNull(snapshot);
26         this.snapshotBytes = requireNonNull(snapshotBytes);
27     }
28
29     public @NonNull Snapshot getSnapshot() {
30         return snapshot;
31     }
32
33     public @NonNull ByteSource getSnapshotBytes() {
34         return snapshotBytes;
35     }
36 }