class ConnectionManager {

    public Connection getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier) throws SQLException {

        Connection result;
        if (!isPoolEnabled) {
            LOG.debug("Requesting DriverManager.getConnection for server={}", server);
            result = DriverManager.getConnection(jdbcUrl, connectionConfiguration);
        } else {

            PoolDescriptor poolDescriptor = new PoolDescriptor(server, jdbcUrl, connectionConfiguration, poolConfiguration, qualifier);

            DataSource dataSource;
            try {
                LOG.debug("Requesting datasource for server={} and {}", server, poolDescriptor);
                dataSource = dataSources.getUnchecked(poolDescriptor);
                LOG.debug("Obtained datasource {} for server={} and {}", dataSource.hashCode(), server, poolDescriptor);
            } catch (UncheckedExecutionException e) {
                Throwable cause = e.getCause() != null ? e.getCause() : e;
                throw new SQLException(String.format("Could not obtain datasource for server %s and %s : %s", server, poolDescriptor, cause.getMessage()), cause);
            }
            result = dataSource.getConnection();
        }
        LOG.debug("Returning JDBC connection {} for server={}", result, server);

        return result;
    }

    private  ConnectionManager();
      ConnectionManager(DataSourceFactory factory, Ticker ticker, long sleepIntervalNanos);

}