X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fclient%2Fmessages%2FGetSnapshotReply.java;fp=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fclient%2Fmessages%2FGetSnapshotReply.java;h=f3521deb3b2b8ef89bf70ef3e4ea2e63a77ac8a0;hb=f1c3050779d7770ef6a12a67a1870765c3dfd9eb;hp=0000000000000000000000000000000000000000;hpb=c2d1b9207fe82d36db83501e1baaffe7bc7da9ae;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/GetSnapshotReply.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/GetSnapshotReply.java new file mode 100644 index 0000000000..f3521deb3b --- /dev/null +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/GetSnapshotReply.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.cluster.raft.client.messages; + +import com.google.common.base.Preconditions; +import javax.annotation.Nonnull; + +/** + * Reply to GetSnapshot that returns a serialized Snapshot instance. + * + * @author Thomas Pantelis + */ +public class GetSnapshotReply { + private final String id; + private final byte[] snapshot; + + public GetSnapshotReply(@Nonnull String id, @Nonnull byte[] snapshot) { + this.id = Preconditions.checkNotNull(id); + this.snapshot = Preconditions.checkNotNull(snapshot); + } + + @Nonnull + public String getId() { + return id; + } + + @Nonnull + public byte[] getSnapshot() { + return snapshot; + } + + @Override + public String toString() { + return "GetSnapshotReply [id=" + id + ", snapshot.length=" + snapshot.length + "]"; + } +}