001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.dbcp2;
018
019/**
020 * Defines the methods that will be made available via JMX.
021 *
022 * @since 2.0
023 */
024public interface BasicDataSourceMXBean {
025
026    /**
027     * See {@link BasicDataSource#getAbandonedUsageTracking()}
028     *
029     * @return {@link BasicDataSource#getAbandonedUsageTracking()}
030     */
031    boolean getAbandonedUsageTracking();
032
033    /**
034     * See {@link BasicDataSource#getDefaultAutoCommit()}
035     *
036     * @return {@link BasicDataSource#getDefaultAutoCommit()}
037     */
038    Boolean getDefaultAutoCommit();
039
040    /**
041     * See {@link BasicDataSource#getDefaultReadOnly()}
042     *
043     * @return {@link BasicDataSource#getDefaultReadOnly()}
044     */
045    Boolean getDefaultReadOnly();
046
047    /**
048     * See {@link BasicDataSource#getDefaultTransactionIsolation()}
049     *
050     * @return {@link BasicDataSource#getDefaultTransactionIsolation()}
051     */
052    int getDefaultTransactionIsolation();
053
054    /**
055     * See {@link BasicDataSource#getDefaultCatalog()}
056     *
057     * @return {@link BasicDataSource#getDefaultCatalog()}
058     */
059    String getDefaultCatalog();
060
061    /**
062     * See {@link BasicDataSource#getCacheState()}
063     *
064     * @return {@link BasicDataSource#getCacheState()}
065     */
066    boolean getCacheState();
067
068    /**
069     * See {@link BasicDataSource#getDriverClassName()}
070     *
071     * @return {@link BasicDataSource#getDriverClassName()}
072     */
073    String getDriverClassName();
074
075    /**
076     * See {@link BasicDataSource#getLifo()}
077     *
078     * @return {@link BasicDataSource#getLifo()}
079     */
080    boolean getLifo();
081
082    /**
083     * See {@link BasicDataSource#getMaxTotal()}
084     *
085     * @return {@link BasicDataSource#getMaxTotal()}
086     */
087    int getMaxTotal();
088
089    /**
090     * See {@link BasicDataSource#getMaxIdle()}
091     *
092     * @return {@link BasicDataSource#getMaxIdle()}
093     */
094    int getMaxIdle();
095
096    /**
097     * See {@link BasicDataSource#getMinIdle()}
098     *
099     * @return {@link BasicDataSource#getMinIdle()}
100     */
101    int getMinIdle();
102
103    /**
104     * See {@link BasicDataSource#getInitialSize()}
105     *
106     * @return {@link BasicDataSource#getInitialSize()}
107     */
108    int getInitialSize();
109
110    /**
111     * See {@link BasicDataSource#getMaxWaitMillis()}
112     *
113     * @return {@link BasicDataSource#getMaxWaitMillis()}
114     */
115    long getMaxWaitMillis();
116
117    /**
118     * See {@link BasicDataSource#isPoolPreparedStatements()}
119     *
120     * @return {@link BasicDataSource#isPoolPreparedStatements()}
121     */
122    boolean isPoolPreparedStatements();
123
124    /**
125     * See {@link BasicDataSource#getMaxOpenPreparedStatements()}
126     *
127     * @return {@link BasicDataSource#getMaxOpenPreparedStatements()}
128     */
129    int getMaxOpenPreparedStatements();
130
131    /**
132     * See {@link BasicDataSource#getTestOnCreate()}
133     *
134     * @return {@link BasicDataSource#getTestOnCreate()}
135     */
136    boolean getTestOnCreate();
137
138    /**
139     * See {@link BasicDataSource#getTestOnBorrow()}
140     *
141     * @return {@link BasicDataSource#getTestOnBorrow()}
142     */
143    boolean getTestOnBorrow();
144
145    /**
146     * See {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()}
147     *
148     * @return {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()}
149     */
150    long getTimeBetweenEvictionRunsMillis();
151
152    /**
153     * See {@link BasicDataSource#getNumTestsPerEvictionRun()}
154     *
155     * @return {@link BasicDataSource#getNumTestsPerEvictionRun()}
156     */
157    int getNumTestsPerEvictionRun();
158
159    /**
160     * See {@link BasicDataSource#getMinEvictableIdleTimeMillis()}
161     *
162     * @return {@link BasicDataSource#getMinEvictableIdleTimeMillis()}
163     */
164    long getMinEvictableIdleTimeMillis();
165
166    /**
167     * See {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()}
168     *
169     * @return {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()}
170     */
171    long getSoftMinEvictableIdleTimeMillis();
172
173    /**
174     * See {@link BasicDataSource#getTestWhileIdle()}
175     *
176     * @return {@link BasicDataSource#getTestWhileIdle()}
177     */
178    boolean getTestWhileIdle();
179
180    /**
181     * See {@link BasicDataSource#getNumActive()}
182     *
183     * @return {@link BasicDataSource#getNumActive()}
184     */
185    int getNumActive();
186
187    /**
188     * See {@link BasicDataSource#getNumIdle()}
189     *
190     * @return {@link BasicDataSource#getNumIdle()}
191     */
192    int getNumIdle();
193
194    /**
195     * See {@link BasicDataSource#getPassword()}
196     *
197     * @return {@link BasicDataSource#getPassword()}
198     */
199    String getPassword();
200
201    /**
202     * See {@link BasicDataSource#getUrl()}
203     *
204     * @return {@link BasicDataSource#getUrl()}
205     */
206    String getUrl();
207
208    /**
209     * See {@link BasicDataSource#getUsername()}
210     *
211     * @return {@link BasicDataSource#getUsername()}
212     */
213    String getUsername();
214
215    /**
216     * See {@link BasicDataSource#getValidationQuery()}
217     *
218     * @return {@link BasicDataSource#getValidationQuery()}
219     */
220    String getValidationQuery();
221
222    /**
223     * See {@link BasicDataSource#getValidationQueryTimeout()}
224     *
225     * @return {@link BasicDataSource#getValidationQueryTimeout()}
226     */
227    int getValidationQueryTimeout();
228
229    /**
230     * See {@link BasicDataSource#getConnectionInitSqlsAsArray()}
231     *
232     * @return {@link BasicDataSource#getConnectionInitSqlsAsArray()}
233     */
234    String[] getConnectionInitSqlsAsArray();
235
236    /**
237     * See {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()}
238     *
239     * @return {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()}
240     */
241    boolean isAccessToUnderlyingConnectionAllowed();
242
243    /**
244     * See {@link BasicDataSource#getMaxConnLifetimeMillis()}
245     *
246     * @return {@link BasicDataSource#getMaxConnLifetimeMillis()}
247     */
248    long getMaxConnLifetimeMillis();
249
250    /**
251     * See {@link BasicDataSource#getLogExpiredConnections()}
252     *
253     * @return {@link BasicDataSource#getLogExpiredConnections()}
254     * @since 2.1
255     */
256    boolean getLogExpiredConnections();
257
258    /**
259     * See {@link BasicDataSource#getRemoveAbandonedOnBorrow()}
260     *
261     * @return {@link BasicDataSource#getRemoveAbandonedOnBorrow()}
262     */
263    boolean getRemoveAbandonedOnBorrow();
264
265    /**
266     * See {@link BasicDataSource#getRemoveAbandonedOnMaintenance()}
267     *
268     * @return {@link BasicDataSource#getRemoveAbandonedOnMaintenance()}
269     */
270    boolean getRemoveAbandonedOnMaintenance();
271
272    /**
273     * See {@link BasicDataSource#getRemoveAbandonedTimeout()}
274     *
275     * @return {@link BasicDataSource#getRemoveAbandonedTimeout()}
276     */
277    int getRemoveAbandonedTimeout();
278
279    /**
280     * See {@link BasicDataSource#getLogAbandoned()}
281     *
282     * @return {@link BasicDataSource#getLogAbandoned()}
283     */
284    boolean getLogAbandoned();
285
286    /**
287     * See {@link BasicDataSource#isClosed()}
288     *
289     * @return {@link BasicDataSource#isClosed()}
290     */
291    boolean isClosed();
292
293    /**
294     * See {@link BasicDataSource#getFastFailValidation()}
295     *
296     * @return {@link BasicDataSource#getFastFailValidation()}
297     * @since 2.1
298     */
299    boolean getFastFailValidation();
300
301    /**
302     * See {@link BasicDataSource#getDisconnectionSqlCodesAsArray()}
303     *
304     * @return {@link BasicDataSource#getDisconnectionSqlCodesAsArray()}
305     * @since 2.1
306     */
307    String[] getDisconnectionSqlCodesAsArray();
308}