Take snapshot after recovery on migrated messages
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / PeerInfo.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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;
9
10 /**
11  * Stores information about a raft peer.
12  *
13  * @author Thomas Pantelis
14  */
15 public class PeerInfo {
16     private final String id;
17     private String address;
18     private VotingState votingState;
19
20     public PeerInfo(String id, String address, VotingState votingState) {
21         this.id = id;
22         this.address = address;
23         this.votingState = votingState;
24     }
25
26     public String getId() {
27         return id;
28     }
29
30     public String getAddress() {
31         return address;
32     }
33
34     public VotingState getVotingState() {
35         return votingState;
36     }
37
38     public boolean isVoting() {
39         return votingState == VotingState.VOTING;
40     }
41
42     public void setAddress(String address) {
43         this.address = address;
44     }
45
46     public void setVotingState(VotingState votingState) {
47         this.votingState = votingState;
48     }
49
50     @Override
51     public String toString() {
52         return "PeerInfo [id=" + id + ", address=" + address + ", votingState=" + votingState + "]";
53     }
54 }