2 * Copyright (c) 2017 Cisco 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.messages;
10 import static java.util.Objects.requireNonNull;
12 import akka.actor.ActorRef;
13 import java.io.Serializable;
16 * Message sent to leader to transfer leadership to a particular follower.
18 public final class RequestLeadership implements Serializable {
19 private static final long serialVersionUID = 1L;
21 private final String requestedFollowerId;
22 private final ActorRef replyTo;
24 public RequestLeadership(final String requestedFollowerId, final ActorRef replyTo) {
25 this.requestedFollowerId = requireNonNull(requestedFollowerId);
26 this.replyTo = requireNonNull(replyTo);
29 public String getRequestedFollowerId() {
30 return requestedFollowerId;
33 public ActorRef getReplyTo() {
38 public String toString() {
39 return "RequestLeadership [requestedFollowerId=" + requestedFollowerId + ", replyTo=" + replyTo + "]";