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