BUG 2817 - Basic implementation of RemoveServer in the Raft code
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / AddServer.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.messages;
9
10 import java.io.Serializable;
11
12 /**
13  * Message sent to add a new server/replica (ยง4.1).
14  *
15  * @author Thomas Pantelis
16  */
17 public class AddServer implements Serializable {
18     private static final long serialVersionUID = 1L;
19
20     private final String newServerId;
21     private final String newServerAddress;
22     private final boolean votingMember;
23
24     public AddServer(String newServerId, String newServerAddress, boolean votingMember) {
25         this.newServerId = newServerId;
26         this.newServerAddress = newServerAddress;
27         this.votingMember = votingMember;
28     }
29
30     public String getNewServerId() {
31         return newServerId;
32     }
33
34     public String getNewServerAddress() {
35         return newServerAddress;
36     }
37
38     public boolean isVotingMember() {
39         return votingMember;
40     }
41
42     @Override
43     public String toString() {
44         return "AddServer [newServerId=" + newServerId + ", newServerAddress=" + newServerAddress + ", votingMember="
45                 + votingMember + "]";
46     }
47 }