2 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.raft;
11 * Stores information about a raft peer.
13 * @author Thomas Pantelis
15 public class PeerInfo {
16 private final String id;
17 private String address;
18 private VotingState votingState;
21 * Constructs an instance.
23 * @param id the id of the peer.
24 * @param address the address of the peer.
25 * @param votingState the VotingState of the peer.
27 public PeerInfo(String id, String address, VotingState votingState) {
29 this.address = address;
30 this.votingState = votingState;
33 public String getId() {
37 public String getAddress() {
41 public VotingState getVotingState() {
45 public boolean isVoting() {
46 return votingState == VotingState.VOTING;
49 public void setAddress(String address) {
50 this.address = address;
53 public void setVotingState(VotingState votingState) {
54 this.votingState = votingState;
58 public String toString() {
59 return "PeerInfo [id=" + id + ", address=" + address + ", votingState=" + votingState + "]";