BUG 3066 : Optimistic lock failed, on NetconfStateUpdate
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / notifications / LeaderStateChanged.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.notifications;
9
10 import java.io.Serializable;
11
12 /**
13  * A message initiated internally from the RaftActor when some state of a leader has changed
14  *
15  * @author Thomas Pantelis
16  */
17 public class LeaderStateChanged implements Serializable {
18     private static final long serialVersionUID = 1L;
19
20     private final String memberId;
21     private final String leaderId;
22
23     public LeaderStateChanged(String memberId, String leaderId) {
24         this.memberId = memberId;
25         this.leaderId = leaderId;
26     }
27
28     public String getMemberId() {
29         return memberId;
30     }
31
32     public String getLeaderId() {
33         return leaderId;
34     }
35
36     @Override
37     public String toString() {
38         StringBuilder builder = new StringBuilder();
39         builder.append("LeaderStateChanged [memberId=").append(memberId).append(", leaderId=").append(leaderId)
40                 .append("]");
41         return builder.toString();
42     }
43 }