2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
3 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.raft.base.messages;
11 import java.io.Serializable;
14 * Message class to persist election term information.
16 * @deprecated Use {@link org.opendaylight.controller.cluster.raft.persisted.UpdateElectionTerm} instead.
19 public class UpdateElectionTerm implements Serializable {
20 private static final long serialVersionUID = 1L;
22 private final long currentTerm;
23 private final String votedFor;
25 public UpdateElectionTerm(long currentTerm, String votedFor) {
26 this.currentTerm = currentTerm;
27 this.votedFor = votedFor;
30 public long getCurrentTerm() {
34 public String getVotedFor() {
38 private Object readResolve() {
39 return org.opendaylight.controller.cluster.raft.persisted.UpdateElectionTerm.createMigrated(
40 currentTerm, votedFor);
44 public String toString() {
45 StringBuilder builder = new StringBuilder();
46 builder.append("UpdateElectionTerm [currentTerm=").append(currentTerm).append(", votedFor=").append(votedFor)
48 return builder.toString();