Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / InstallSnapshotReply.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.messages;
9
10 public final class InstallSnapshotReply extends AbstractRaftRPC {
11     @java.io.Serial
12     private static final long serialVersionUID = 642227896390779503L;
13
14     // The followerId - this will be used to figure out which follower is
15     // responding
16     private final String followerId;
17     private final int chunkIndex;
18     private final boolean success;
19
20     public InstallSnapshotReply(final long term, final String followerId, final int chunkIndex, final boolean success) {
21         super(term);
22         this.followerId = followerId;
23         this.chunkIndex = chunkIndex;
24         this.success = success;
25     }
26
27     public String getFollowerId() {
28         return followerId;
29     }
30
31     public int getChunkIndex() {
32         return chunkIndex;
33     }
34
35     public boolean isSuccess() {
36         return success;
37     }
38
39     @Override
40     public String toString() {
41         return "InstallSnapshotReply [term=" + getTerm()
42                 + ", followerId=" + followerId
43                 + ", chunkIndex=" + chunkIndex
44                 + ", success=" + success + "]";
45     }
46
47     @Override
48     Object writeReplace() {
49         return new IR(this);
50     }
51 }