2 * Copyright (c) 2014 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;
11 public class ElectionTermImpl implements ElectionTerm{
13 * Identifier of the actor whose election term information this is
15 private final String id;
17 private long currentTerm;
19 private String votedFor;
21 public ElectionTermImpl(String id) {
24 // TODO: Read currentTerm from some persistent state
27 // TODO: Read votedFor from some file
31 public long getCurrentTerm() {
35 public String getVotedFor() {
39 public void update(long currentTerm, String votedFor){
40 this.currentTerm = currentTerm;
41 this.votedFor = votedFor;
43 // TODO : Write to some persistent state