Class ConnectionPoolProvider<T extends ConnectionPool>
- java.lang.Object
- 
- edu.uiuc.ncsa.security.core.configuration.provider.HierarchicalConfigProvider<T>
- 
- edu.uiuc.ncsa.security.storage.sql.ConnectionPoolProvider<T>
 
 
- 
- All Implemented Interfaces:
- CfgEventListener,- EventListener,- javax.inject.Provider<T>
 - Direct Known Subclasses:
- DerbyConnectionPoolProvider,- H2ConnectionPoolProvider,- MariaDBConnectionPoolProvider,- MySQLConnectionPoolProvider,- PGConnectionPoolProvider
 
 public abstract class ConnectionPoolProvider<T extends ConnectionPool> extends HierarchicalConfigProvider<T> Creates aConnectionPoolfrom a configuration.Created by Jeff Gaynor 
 on 1/17/12 at 12:07 PM
- 
- 
Field Summary
 - 
Constructor SummaryConstructors Modifier Constructor Description ConnectionPoolProvider()ConnectionPoolProvider(SQLConnectionImpl sqlConnection)this only sets the database name and the schema.protectedConnectionPoolProvider(String database, String schema)protectedConnectionPoolProvider(String database, String schema, String host, int port, String driver, boolean useSSL)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longcheckTime(String key, long defaultValue)Checks long value assuming it is time.protected StringcheckValue(String key)Check the value associated with this key.protected booleancheckValue(String key, boolean defaultValue)protected intcheckValue(String key, int defaultValue)protected longcheckValue(String key, long defaultValue)protected StringcheckValue(String key, String defaultValue)Check that the value associated with the key is not null.StringgetDatabase()StringgetDriver()StringgetHost()intgetPort()StringgetSchema()booleanisUseSSL()ConnectionPoolProvidersetDatabase(String database)ConnectionPoolProvidersetDriver(String driver)ConnectionPoolProvidersetHost(String host)protected voidsetPoolParameters(ConnectionPool pool)Called exactly once duringProvider.get()per (new) pool to set the parameters (max size etc.).ConnectionPoolProvidersetPort(int port)ConnectionPoolProvidersetSchema(String schema)ConnectionPoolProvidersetUseSSL(boolean useSSL)- 
Methods inherited from class edu.uiuc.ncsa.security.core.configuration.provider.HierarchicalConfigProvideraddListener, checkEvent, fireComponentFound, getAttribute, getAttribute, getBooleanAttribute, getCFNode, getConfig, getConfigurationAt, getIntAttribute, getIntAttribute, getListeners, hasA, hasCFNode, isA, removeListener, setCFNode, setConfig
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface edu.uiuc.ncsa.security.core.configuration.provider.CfgEventListenercomponentFound
 
- 
 
- 
- 
- 
Field Detail- 
hostprotected String host 
 - 
driverprotected String driver 
 - 
portprotected int port 
 - 
schemaprotected String schema 
 - 
databaseprotected String database 
 - 
useSSLprotected boolean useSSL 
 - 
USERNAMEpublic static final String USERNAME - See Also:
- Constant Field Values
 
 - 
PASSWORDpublic static final String PASSWORD - See Also:
- Constant Field Values
 
 - 
HOSTpublic static final String HOST - See Also:
- Constant Field Values
 
 - 
PORTpublic static final String PORT - See Also:
- Constant Field Values
 
 - 
DRIVERpublic static final String DRIVER - See Also:
- Constant Field Values
 
 - 
USE_SSLpublic static final String USE_SSL - See Also:
- Constant Field Values
 
 - 
DATABASEpublic static final String DATABASE - See Also:
- Constant Field Values
 
 - 
PARAMETERSpublic static final String PARAMETERS - See Also:
- Constant Field Values
 
 - 
SCHEMApublic static final String SCHEMA - See Also:
- Constant Field Values
 
 - 
BOOT_PASSWORDpublic static final String BOOT_PASSWORD - See Also:
- Constant Field Values
 
 - 
DERBY_CREATE_SCRIPTpublic static final String DERBY_CREATE_SCRIPT - See Also:
- Constant Field Values
 
 - 
DERBY_STORE_TYPEpublic static final String DERBY_STORE_TYPE - See Also:
- Constant Field Values
 
 - 
DERBY_FS_DEFAULT_USERpublic static final String DERBY_FS_DEFAULT_USER - See Also:
- Constant Field Values
 
 - 
DERBY_FS_DEFAULT_PASSWORDpublic static final String DERBY_FS_DEFAULT_PASSWORD - See Also:
- Constant Field Values
 
 - 
DERBY_FS_DEFAULT_BOOT_PASSWORDpublic static final String DERBY_FS_DEFAULT_BOOT_PASSWORD - See Also:
- Constant Field Values
 
 - 
DERBY_FS_DEFAULT_SCHEMApublic static final String DERBY_FS_DEFAULT_SCHEMA - See Also:
- Constant Field Values
 
 - 
CONNECTION_MAXpublic static final String CONNECTION_MAX - See Also:
- Constant Field Values
 
 - 
CONNECTION_IDLE_TIMEOUTpublic static final String CONNECTION_IDLE_TIMEOUT - See Also:
- Constant Field Values
 
 - 
CONNECTION_CLEANUP_INTERVALpublic static final String CONNECTION_CLEANUP_INTERVAL - See Also:
- Constant Field Values
 
 - 
CONNECTION_CLEANUP_ENABLEpublic static final String CONNECTION_CLEANUP_ENABLE - See Also:
- Constant Field Values
 
 - 
CONNECTION_ENABLE_QUEUEpublic static final String CONNECTION_ENABLE_QUEUE - See Also:
- Constant Field Values
 
 - 
CONNECTION_QUEUE_INTERVALpublic static final String CONNECTION_QUEUE_INTERVAL - See Also:
- Constant Field Values
 
 - 
DEFAULT_MAX_CONNECTIONSpublic static int DEFAULT_MAX_CONNECTIONS 
 - 
DEFAULT_IDLE_TIMEOUTpublic static long DEFAULT_IDLE_TIMEOUT 
 - 
DEFAULT_CLEANUP_INTERVALpublic static long DEFAULT_CLEANUP_INTERVAL 
 - 
DEFAULT_CLEANUP_ENABLEpublic static boolean DEFAULT_CLEANUP_ENABLE 
 - 
DEFAULT_QUEUE_INTERVALpublic static long DEFAULT_QUEUE_INTERVAL 
 
- 
 - 
Constructor Detail- 
ConnectionPoolProviderpublic ConnectionPoolProvider() 
 - 
ConnectionPoolProviderprotected ConnectionPoolProvider(String database, String schema, String host, int port, String driver, boolean useSSL) 
 - 
ConnectionPoolProviderpublic ConnectionPoolProvider(SQLConnectionImpl sqlConnection) this only sets the database name and the schema. Subclasses should set what they specifically need.- Parameters:
- sqlConnection-
 
 
- 
 - 
Method Detail- 
setPoolParametersprotected void setPoolParameters(ConnectionPool pool) Called exactly once duringProvider.get()per (new) pool to set the parameters (max size etc.).- Parameters:
- pool-
 
 - 
checkValueprotected String checkValue(String key, String defaultValue) Check that the value associated with the key is not null. If it is, use the default value. If there is no default value, then throw an exception.- Parameters:
- key-
- defaultValue-
- Returns:
 
 - 
checkValueprotected int checkValue(String key, int defaultValue) 
 - 
checkTimeprotected long checkTime(String key, long defaultValue) Checks long value assuming it is time. No units means it is passed back, but look at the documentation inXMLConfigUtil.getValueSecsOrMillis(String). IOf you just need a long value, usecheckValue(String, long).- Parameters:
- key-
- defaultValue-
- Returns:
 
 - 
checkValueprotected long checkValue(String key, long defaultValue) 
 - 
checkValueprotected boolean checkValue(String key, boolean defaultValue) 
 - 
checkValueprotected String checkValue(String key) Check the value associated with this key. If the value is missing, throw an exception.- Parameters:
- key-
- Returns:
 
 - 
getHostpublic String getHost() 
 - 
setHostpublic ConnectionPoolProvider setHost(String host) 
 - 
getDriverpublic String getDriver() 
 - 
setDriverpublic ConnectionPoolProvider setDriver(String driver) 
 - 
getPortpublic int getPort() 
 - 
setPortpublic ConnectionPoolProvider setPort(int port) 
 - 
getSchemapublic String getSchema() 
 - 
setSchemapublic ConnectionPoolProvider setSchema(String schema) 
 - 
getDatabasepublic String getDatabase() 
 - 
setDatabasepublic ConnectionPoolProvider setDatabase(String database) 
 - 
isUseSSLpublic boolean isUseSSL() 
 - 
setUseSSLpublic ConnectionPoolProvider setUseSSL(boolean useSSL) 
 
- 
 
-