Fix NPE in YangTextSchemaSourceSerializationProxy#getRepresentation
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / notifications / RoleChangeNotification.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.notifications;
10
11 import java.io.Serializable;
12
13 /**
14  * Notification message representing a Role change of a cluster member.
15  * Roles generally are Leader, Follower and Candidate. But can be based on the consensus strategy/implementation.
16  * The Listener could be in a separate ActorSystem and hence this message needs to be Serializable.
17  */
18 public class RoleChangeNotification implements Serializable {
19     private static final long serialVersionUID = -2873869509490117116L;
20     private final String memberId;
21     private final String oldRole;
22     private final String newRole;
23
24     public RoleChangeNotification(String memberId, String oldRole, String newRole) {
25         this.memberId = memberId;
26         this.oldRole = oldRole;
27         this.newRole = newRole;
28     }
29
30     public String getMemberId() {
31         return memberId;
32     }
33
34     public String getOldRole() {
35         return oldRole;
36     }
37
38     public String getNewRole() {
39         return newRole;
40     }
41 }