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
9 package org.opendaylight.controller.cluster.raft.messages;
11 import akka.actor.ActorRef;
12 import com.google.common.base.Preconditions;
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 = Preconditions.checkNotNull(requestedFollowerId);
26 this.replyTo = Preconditions.checkNotNull(replyTo);
29 public String getRequestedFollowerId() {
30 return requestedFollowerId;
33 public ActorRef getReplyTo() {
38 public String toString() {
39 return "RequestLeadership [requestedFollowerId=" + requestedFollowerId + ", replyTo=" + replyTo + "]";