Move DataTreeListenerInfo
[controller.git] / opendaylight / md-sal / cds-mgmt-api / src / main / java / org / opendaylight / controller / cluster / mgmt / api / FollowerInfo.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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.mgmt.api;
9
10 import static java.util.Objects.requireNonNull;
11
12 import javax.management.ConstructorParameters;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14
15 /**
16  * A bean class containing a snapshot of information for a follower returned from GetOnDemandRaftStats.
17  *
18  * @author Thomas Pantelis
19  */
20 @NonNullByDefault
21 public final class FollowerInfo {
22     private final String id;
23     private final long nextIndex;
24     private final long matchIndex;
25     private final boolean isActive;
26     private final String timeSinceLastActivity;
27     private final boolean isVoting;
28
29     @ConstructorParameters({"id","nextIndex", "matchIndex", "active", "timeSinceLastActivity", "voting"})
30     public FollowerInfo(final String id, final long nextIndex, final long matchIndex, final boolean active,
31             final String timeSinceLastActivity, final boolean voting) {
32         this.id = requireNonNull(id);
33         this.nextIndex = nextIndex;
34         this.matchIndex = matchIndex;
35         this.isActive = active;
36         this.timeSinceLastActivity = timeSinceLastActivity;
37         this.isVoting = voting;
38     }
39
40     public String getId() {
41         return id;
42     }
43
44     public long getNextIndex() {
45         return nextIndex;
46     }
47
48     public long getMatchIndex() {
49         return matchIndex;
50     }
51
52     public boolean isActive() {
53         return isActive;
54     }
55
56     public String getTimeSinceLastActivity() {
57         return timeSinceLastActivity;
58     }
59
60     public boolean isVoting() {
61         return isVoting;
62     }
63 }