    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#getDefaultSchema()}
    063     *
    064     * @return {@link BasicDataSource#getDefaultSchema()}
    065     * @since 2.5.0
    066     */
    067    default String getDefaultSchema() {
    068        return null;
    069    }
    070
    071    /**
    072     * See {@link BasicDataSource#getCacheState()}
    073     *
    074     * @return {@link BasicDataSource#getCacheState()}
    075     */
    076    boolean getCacheState();
    077
    078    /**
    079     * See {@link BasicDataSource#getDriverClassName()}
    080     *
    081     * @return {@link BasicDataSource#getDriverClassName()}
    082     */
    083    String getDriverClassName();
    084
    085    /**
    086     * See {@link BasicDataSource#getLifo()}
    087     *
    088     * @return {@link BasicDataSource#getLifo()}
    089     */
    090    boolean getLifo();
    091
    092    /**
    093     * See {@link BasicDataSource#getMaxTotal()}
    094     *
    095     * @return {@link BasicDataSource#getMaxTotal()}
    096     */
    097    int getMaxTotal();
    098
    099    /**
    100     * See {@link BasicDataSource#getMaxIdle()}
    101     *
    102     * @return {@link BasicDataSource#getMaxIdle()}
    103     */
    104    int getMaxIdle();
    105
    106    /**
    107     * See {@link BasicDataSource#getMinIdle()}
    108     *
    109     * @return {@link BasicDataSource#getMinIdle()}
    110     */
    111    int getMinIdle();
    112
    113    /**
    114     * See {@link BasicDataSource#getInitialSize()}
    115     *
    116     * @return {@link BasicDataSource#getInitialSize()}
    117     */
    118    int getInitialSize();
    119
    120    /**
    121     * See {@link BasicDataSource#getMaxWaitMillis()}
    122     *
    123     * @return {@link BasicDataSource#getMaxWaitMillis()}
    124     */
    125    long getMaxWaitMillis();
    126
    127    /**
    128     * See {@link BasicDataSource#isPoolPreparedStatements()}
    129     *
    130     * @return {@link BasicDataSource#isPoolPreparedStatements()}
    131     */
    132    boolean isPoolPreparedStatements();
    133
    134    /**
    135     * See {@link BasicDataSource#getMaxOpenPreparedStatements()}
    136     *
    137     * @return {@link BasicDataSource#getMaxOpenPreparedStatements()}
    138     */
    139    int getMaxOpenPreparedStatements();
    140
    141    /**
    142     * See {@link BasicDataSource#getTestOnCreate()}
    143     *
    144     * @return {@link BasicDataSource#getTestOnCreate()}
    145     */
    146    boolean getTestOnCreate();
    147
    148    /**
    149     * See {@link BasicDataSource#getTestOnBorrow()}
    150     *
    151     * @return {@link BasicDataSource#getTestOnBorrow()}
    152     */
    153    boolean getTestOnBorrow();
    154
    155    /**
    156     * See {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()}
    157     *
    158     * @return {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()}
    159     */
    160    long getTimeBetweenEvictionRunsMillis();
    161
    162    /**
    163     * See {@link BasicDataSource#getNumTestsPerEvictionRun()}
    164     *
    165     * @return {@link BasicDataSource#getNumTestsPerEvictionRun()}
    166     */
    167    int getNumTestsPerEvictionRun();
    168
    169    /**
    170     * See {@link BasicDataSource#getMinEvictableIdleTimeMillis()}
    171     *
    172     * @return {@link BasicDataSource#getMinEvictableIdleTimeMillis()}
    173     */
    174    long getMinEvictableIdleTimeMillis();
    175
    176    /**
    177     * See {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()}
    178     *
    179     * @return {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()}
    180     */
    181    long getSoftMinEvictableIdleTimeMillis();
    182
    183    /**
    184     * See {@link BasicDataSource#getTestWhileIdle()}
    185     *
    186     * @return {@link BasicDataSource#getTestWhileIdle()}
    187     */
    188    boolean getTestWhileIdle();
    189
    190    /**
    191     * See {@link BasicDataSource#getNumActive()}
    192     *
    193     * @return {@link BasicDataSource#getNumActive()}
    194     */
    195    int getNumActive();
    196
    197    /**
    198     * See {@link BasicDataSource#getNumIdle()}
    199     *
    200     * @return {@link BasicDataSource#getNumIdle()}
    201     */
    202    int getNumIdle();
    203
    204    /**
    205     * See {@link BasicDataSource#getPassword()}
    206     *
    207     * @return {@link BasicDataSource#getPassword()}
    208     */
    209    String getPassword();
    210
    211    /**
    212     * See {@link BasicDataSource#getUrl()}
    213     *
    214     * @return {@link BasicDataSource#getUrl()}
    215     */
    216    String getUrl();
    217
    218    /**
    219     * See {@link BasicDataSource#getUsername()}
    220     *
    221     * @return {@link BasicDataSource#getUsername()}
    222     */
    223    String getUsername();
    224
    225    /**
    226     * See {@link BasicDataSource#getValidationQuery()}
    227     *
    228     * @return {@link BasicDataSource#getValidationQuery()}
    229     */
    230    String getValidationQuery();
    231
    232    /**
    233     * See {@link BasicDataSource#getValidationQueryTimeout()}
    234     *
    235     * @return {@link BasicDataSource#getValidationQueryTimeout()}
    236     */
    237    int getValidationQueryTimeout();
    238
    239    /**
    240     * See {@link BasicDataSource#getConnectionInitSqlsAsArray()}
    241     *
    242     * @return {@link BasicDataSource#getConnectionInitSqlsAsArray()}
    243     */
    244    String[] getConnectionInitSqlsAsArray();
    245
    246    /**
    247     * See {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()}
    248     *
    249     * @return {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()}
    250     */
    251    boolean isAccessToUnderlyingConnectionAllowed();
    252
    253    /**
    254     * See {@link BasicDataSource#getMaxConnLifetimeMillis()}
    255     *
    256     * @return {@link BasicDataSource#getMaxConnLifetimeMillis()}
    257     */
    258    long getMaxConnLifetimeMillis();
    259
    260    /**
    261     * See {@link BasicDataSource#getLogExpiredConnections()}
    262     *
    263     * @return {@link BasicDataSource#getLogExpiredConnections()}
    264     * @since 2.1
    265     */
    266    boolean getLogExpiredConnections();
    267
    268    /**
    269     * See {@link BasicDataSource#getRemoveAbandonedOnBorrow()}
    270     *
    271     * @return {@link BasicDataSource#getRemoveAbandonedOnBorrow()}
    272     */
    273    boolean getRemoveAbandonedOnBorrow();
    274
    275    /**
    276     * See {@link BasicDataSource#getRemoveAbandonedOnMaintenance()}
    277     *
    278     * @return {@link BasicDataSource#getRemoveAbandonedOnMaintenance()}
    279     */
    280    boolean getRemoveAbandonedOnMaintenance();
    281
    282    /**
    283     * See {@link BasicDataSource#getRemoveAbandonedTimeout()}
    284     *
    285     * @return {@link BasicDataSource#getRemoveAbandonedTimeout()}
    286     */
    287    int getRemoveAbandonedTimeout();
    288
    289    /**
    290     * See {@link BasicDataSource#getLogAbandoned()}
    291     *
    292     * @return {@link BasicDataSource#getLogAbandoned()}
    293     */
    294    boolean getLogAbandoned();
    295
    296    /**
    297     * See {@link BasicDataSource#isClosed()}
    298     *
    299     * @return {@link BasicDataSource#isClosed()}
    300     */
    301    boolean isClosed();
    302
    303    /**
    304     * See {@link BasicDataSource#getFastFailValidation()}
    305     *
    306     * @return {@link BasicDataSource#getFastFailValidation()}
    307     * @since 2.1
    308     */
    309    boolean getFastFailValidation();
    310
    311    /**
    312     * See {@link BasicDataSource#getDisconnectionSqlCodesAsArray()}
    313     *
    314     * @return {@link BasicDataSource#getDisconnectionSqlCodesAsArray()}
    315     * @since 2.1
    316     */
    317    String[] getDisconnectionSqlCodesAsArray();
    318}