Merge "Make Raft messages serializable"
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / InstallSnapshot.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
9 package org.opendaylight.controller.cluster.raft.messages;
10
11 import java.io.Serializable;
12
13 public class InstallSnapshot extends AbstractRaftRPC implements Serializable {
14
15     private final String leaderId;
16     private final long lastIncludedIndex;
17     private final long lastIncludedTerm;
18     private final Object data;
19
20     public InstallSnapshot(long term, String leaderId, long lastIncludedIndex, long lastIncludedTerm, Object data) {
21         super(term);
22         this.leaderId = leaderId;
23         this.lastIncludedIndex = lastIncludedIndex;
24         this.lastIncludedTerm = lastIncludedTerm;
25         this.data = data;
26     }
27
28     public String getLeaderId() {
29         return leaderId;
30     }
31
32     public long getLastIncludedIndex() {
33         return lastIncludedIndex;
34     }
35
36     public long getLastIncludedTerm() {
37         return lastIncludedTerm;
38     }
39
40     public Object getData() {
41         return data;
42     }
43 }