Merge "Initial message bus implementation"
[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
9 package org.opendaylight.controller.cluster.raft.messages;
10
11 public class InstallSnapshotReply extends AbstractRaftRPC {
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(long term, String followerId, int chunkIndex,
21         boolean success) {
22         super(term);
23         this.followerId = followerId;
24         this.chunkIndex = chunkIndex;
25         this.success = success;
26     }
27
28     public String getFollowerId() {
29         return followerId;
30     }
31
32     public int getChunkIndex() {
33         return chunkIndex;
34     }
35
36     public boolean isSuccess() {
37         return success;
38     }
39
40     @Override
41     public String toString() {
42         StringBuilder builder = new StringBuilder();
43         builder.append("InstallSnapshotReply [term=").append(term).append(", followerId=").append(followerId)
44                 .append(", chunkIndex=").append(chunkIndex).append(", success=").append(success).append("]");
45         return builder.toString();
46     }
47 }