/*
 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.controller.cluster.notifications;

import java.io.Serializable;

/**
 * A message initiated internally from the RaftActor when some state of a leader has changed
 *
 * @author Thomas Pantelis
 */
public class LeaderStateChanged implements Serializable {
    private static final long serialVersionUID = 1L;

    private final String memberId;
    private final String leaderId;

    public LeaderStateChanged(String memberId, String leaderId) {
        this.memberId = memberId;
        this.leaderId = leaderId;
    }

    public String getMemberId() {
        return memberId;
    }

    public String getLeaderId() {
        return leaderId;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("LeaderStateChanged [memberId=").append(memberId).append(", leaderId=").append(leaderId)
                .append("]");
        return builder.toString();
    }
}

@@ -389,31 +389,115 @@
 ort 
-java.io.Serializ
+com.google.common.base.Preconditions;%0Aimport javax.annotation.Nonnull;%0Aimport javax.annotation.Null
 able;%0A%0A
+%0A
 /**%0A
@@ -501,16 +501,22 @@
 **%0A * A 
+local 
 message 
@@ -594,16 +594,17 @@
  changed
+.
 %0A *%0A * @
@@ -666,87 +666,9 @@
 ged 
-implements Serializable %7B%0A    private static final long serialVersionUID = 1L;%0A
+%7B
 %0A   
@@ -765,16 +765,25 @@
 Changed(
+@Nonnull 
 String m
@@ -790,16 +790,26 @@
 emberId,
+ @Nullable
  String 
@@ -844,24 +844,51 @@
 berId = 
+Preconditions.checkNotNull(
 memberId
 ;%0A      
@@ -875,24 +875,25 @@
 ull(memberId
+)
 ;%0A        th
@@ -926,32 +926,41 @@
   %7D%0A%0A    public 
+@Nonnull 
 String getMember
@@ -1005,24 +1005,34 @@
 %0A    public 
+@Nullable 
 String getLe

Return local shard tree from FindPrimaryShard