Initial code/design for an Akka Raft implementation
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / AppendEntriesReply.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 /**
12  * Reply for the AppendEntriesRpc message
13  */
14 public class AppendEntriesReply {
15     // currentTerm, for leader to update itself
16     private final long term;
17
18     // true if follower contained entry matching
19     // prevLogIndex and prevLogTerm
20     private final boolean success;
21
22     public AppendEntriesReply(long term, boolean success) {
23         this.term = term;
24         this.success = success;
25     }
26
27     public long getTerm() {
28         return term;
29     }
30
31     public boolean isSuccess() {
32         return success;
33     }
34 }