af3c4fd87d6e01d2f455833185ef9c98451be8cf
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / ApplyLogEntries.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.raft.base.messages;
9
10 import java.io.Serializable;
11
12 /**
13  * ApplyLogEntries serves as a message which is stored in the akka's persistent
14  * journal.
15  * During recovery if this message is found, then all in-mem journal entries from
16  * context.lastApplied to ApplyLogEntries.toIndex are applied to the state
17  *
18  * This class is also used as a internal message sent from Behaviour to
19  * RaftActor to persist the ApplyLogEntries
20  *
21  */
22 public class ApplyLogEntries implements Serializable {
23     private final int toIndex;
24
25     public ApplyLogEntries(int toIndex) {
26         this.toIndex = toIndex;
27     }
28
29     public int getToIndex() {
30         return toIndex;
31     }
32 }