Merge "BUG 2412 - restconf @GET getModule(identifier,uri) method migration"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / jmx / mbeans / DatastoreConfigurationMXBeanImpl.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.datastore.jmx.mbeans;
9
10 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
11 import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean;
12
13 /**
14  * Implementation of DatastoreConfigurationMXBean.
15  *
16  * @author Thomas Pantelis
17  */
18 public class DatastoreConfigurationMXBeanImpl extends AbstractMXBean implements DatastoreConfigurationMXBean {
19     public static final String JMX_CATEGORY_CONFIGURATION = "Configuration";
20
21     private DatastoreContext context;
22
23     public DatastoreConfigurationMXBeanImpl(String mxBeanType) {
24         super("Datastore", mxBeanType, JMX_CATEGORY_CONFIGURATION);
25     }
26
27     public void setContext(DatastoreContext context) {
28         this.context = context;
29     }
30
31     @Override
32     public long getShardTransactionIdleTimeoutInSeconds() {
33         return context.getShardTransactionIdleTimeout().toSeconds();
34     }
35
36     @Override
37     public long getOperationTimeoutInSeconds() {
38         return context.getOperationTimeoutInSeconds();
39     }
40
41     @Override
42     public long getShardHeartbeatIntervalInMillis() {
43         return context.getShardRaftConfig().getHeartBeatInterval().toMillis();
44     }
45
46     @Override
47     public int getShardJournalRecoveryLogBatchSize() {
48         return context.getShardRaftConfig().getJournalRecoveryLogBatchSize();
49     }
50
51     @Override
52     public long getShardIsolatedLeaderCheckIntervalInMillis() {
53         return context.getShardRaftConfig().getIsolatedCheckIntervalInMillis();
54     }
55
56     @Override
57     public long getShardElectionTimeoutFactor() {
58         return context.getShardRaftConfig().getElectionTimeoutFactor();
59     }
60
61     @Override
62     public int getShardSnapshotDataThresholdPercentage() {
63         return context.getShardRaftConfig().getSnapshotDataThresholdPercentage();
64     }
65
66     @Override
67     public long getShardSnapshotBatchCount() {
68         return context.getShardRaftConfig().getSnapshotBatchCount();
69     }
70
71     @Override
72     public long getShardTransactionCommitTimeoutInSeconds() {
73         return context.getShardTransactionCommitTimeoutInSeconds();
74     }
75
76     @Override
77     public int getShardTransactionCommitQueueCapacity() {
78         return context.getShardTransactionCommitQueueCapacity();
79     }
80
81     @Override
82     public long getShardInitializationTimeoutInSeconds() {
83         return context.getShardInitializationTimeout().duration().toSeconds();
84     }
85
86     @Override
87     public long getShardLeaderElectionTimeoutInSeconds() {
88         return context.getShardLeaderElectionTimeout().duration().toSeconds();
89     }
90
91     @Override
92     public boolean isPersistent() {
93         return context.isPersistent();
94     }
95
96     @Override
97     public long getTransactionCreationInitialRateLimit() {
98         return context.getTransactionCreationInitialRateLimit();
99     }
100
101     @Override
102     public int getMaxShardDataChangeExecutorPoolSize() {
103         return context.getDataStoreProperties().getMaxDataChangeExecutorPoolSize();
104     }
105
106     @Override
107     public int getMaxShardDataChangeExecutorQueueSize() {
108         return context.getDataStoreProperties().getMaxDataChangeExecutorQueueSize();
109     }
110
111     @Override
112     public int getMaxShardDataChangeListenerQueueSize() {
113         return context.getDataStoreProperties().getMaxDataChangeListenerQueueSize();
114     }
115
116     @Override
117     public int getMaxShardDataStoreExecutorQueueSize() {
118         return context.getDataStoreProperties().getMaxDataStoreExecutorQueueSize();
119     }
120 }