org.wildfly.extras.creaper.commands.datasources
Class AddDataSource.Builder<THIS extends AddDataSource.Builder>

java.lang.Object
  extended by org.wildfly.extras.creaper.commands.datasources.AddDataSource.Builder<THIS>
Direct Known Subclasses:
AddDb2DataSource.Builder, AddMariaDbDataSource.Builder, AddMssqlDataSource.Builder, AddMysqlDataSource.Builder, AddOracleDataSource.Builder, AddPostgresPlusDataSource.Builder, AddPostgreSqlDataSource.Builder, AddSybaseDataSource.Builder
Enclosing class:
AddDataSource

public static class AddDataSource.Builder<THIS extends AddDataSource.Builder>
extends Object

Builder for configuration attributes of a datasource. The THIS type parameter is only meant to be used by subclasses. If you're not inheriting from this class, don't use it.

See Also:
http://wildscribe.github.io/JBoss%20EAP/6.2.0/subsystem/datasources/data-source/

Constructor Summary
AddDataSource.Builder(String name)
           
 
Method Summary
 THIS addConnectionProperties(Map<String,String> connectionProperties)
          Adding connection properties in bulk.
 THIS addConnectionProperty(String name, boolean value)
          See addConnectionProperty(String, String)
 THIS addConnectionProperty(String name, String value)
          Adding connection property.
 THIS addExceptionSorterProperty(String name, boolean value)
          Property for exceptionSorterClass
 THIS addExceptionSorterProperty(String name, String value)
          Property for exceptionSorterClass
 THIS addReauthPluginProperty(String name, boolean value)
          Property for reauthPluginClass
 THIS addReauthPluginProperty(String name, String value)
          Property for reauthPluginClass
 THIS addStaleConnectionCheckerProperty(String name, boolean value)
          Property for staleConnectionCheckerClass
 THIS addStaleConnectionCheckerProperty(String name, String value)
          Property for staleConnectionCheckerClass
 THIS addValidConnectionCheckerProperty(String name, boolean value)
          Property for validConnectionCheckerClass
 THIS addValidConnectionCheckerProperty(String name, String value)
          Property for validConnectionCheckerClass
 THIS allocationRetry(Integer allocationRetry)
          The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception.
 THIS allocationRetryWaitMillis(Integer allocationRetryWaitMillis)
          The allocation retry wait millis element indicates the time in milliseconds to wait between retrying to allocate a connection
 THIS allowMultipleUsers(Boolean allowMultipleUsers)
          Specifies if multiple users will access the datasource through the getConnection(user, password) method and hence if the internal pool type should account for that
 THIS backgroundValidation(Boolean backgroundValidation)
          Connections should be validated on a background thread (versus being validated prior to use).
 THIS backgroundValidationMillis(Integer backgroundValidationMillis)
          Amount of time that background validation will run.
 THIS blockingTimeoutWaitMillis(Integer blockingTimeoutWaitMillis)
          The blocking-timeout-millis element indicates the maximum time in milliseconds to block while waiting for a connection before throwing an exception.
 AddDataSource build()
           
 THIS connectable(Boolean connectable)
          Setting this to true will let to use CMR.
 THIS connectionUrl(String connectionUrl)
          Defines the JDBC driver connection URL.
 THIS datasourceClass(String datasourceClass)
          What datasource class will be used for connection.
 THIS driverClass(String driverClass)
          What driver class will be used for connection.
 THIS driverName(String driverName)
          Defines the JDBC driver the datasource should use.
 THIS enableAfterCreate()
          Defines whether the connector should be started on startup.
 THIS exceptionSorterClass(String exceptionSorterClass)
          org.jboss.jca.adapters.jdbc.ExceptionSorter
 THIS flushStrategy(PoolFlushStrategy flushStrategy)
          How poool should be flushed.
protected  void check()
           
 THIS checkValidConnectionSql(String checkValidConnectionSql)
          SQL statement to check validity of a pool connection.
 THIS idleTimeoutMinutes(Integer idleTimeoutMinutes)
          The idle-timeout-minutes elements indicates the maximum time in minutes a connection may be idle before being closed.
 THIS jndiName(String jndiName)
          Specifies the JNDI name for the datasource.
 THIS jta(Boolean jta)
          Enable JTA integration.
 THIS managedConnectionPool(String managedConnectionPool)
          Defines the ManagedConnectionPool implementation, f.ex. org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool
 THIS maxPoolSize(int maxPoolSize)
          Specifies the maximum number of connections for a pool.
 THIS minPoolSize(int minPoolSize)
          Specifies the minimum number of connections for a pool.
 THIS newConnectionSql(String newConnectionSql)
          SQL statement to execute whenever a connection is added to the JCA connection pool.
 THIS prefill(Boolean prefill)
          Whether to attempt to prefill the connection pool.
 THIS preparedStatementsCacheSize(Integer preparedStatementsCacheSize)
          The number of prepared statements per connection in an LRU cache
 THIS queryTimeout(Integer queryTimeout)
          Any configured query timeout in seconds.
 THIS reauthPluginClass(String reauthPluginClass)
          Setting reauth plugin class name.
 THIS replaceExisting()
          Specify whether to replace the existing datasource based on its name (pool-name).
 THIS securityDomain(String securityDomain)
          Security domain name to be used for authentication to datasource.
 THIS setTxQueryTimeout(Boolean setTxQueryTimeout)
          Whether to set the query timeout based on the time remaining until transaction timeout, any configured query timeout will be used if there is no transaction.
 THIS sharePreparedStatements(Boolean sharePreparedStatements)
          Whether to share prepare statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement.
 THIS spy(Boolean spy)
          An org.jboss.jca.adapters.jdbc.ExceptionSorter.
 THIS staleConnectionCheckerClass(String staleConnectionCheckerClass)
          An org.jboss.jca.adapters.jdbc.StaleConnectionChecker.
 THIS statisticsEnabled(Boolean statisticsEnabled)
          Sets whether runtime statistics are enabled or not.
 THIS trackPreparedStatements(TrackStatementType trackStatements)
          Whether to check for unclosed statements when a connection is returned to the pool and result sets are closed when a statement is closed/return to the prepared statement cache.
 THIS transactionIsolation(TransactionIsolation transactionIsolation)
          Defines isolation level for connections created under this datasource.
 THIS urlDelimiter(String urlDelimiter)
          Specifies the delimeter for URLs in connection-url for HA datasources
 THIS urlSelectorStrategyClass(String urlSelectorStrategyClass)
          A class that implements org.jboss.jca.adapters.jdbc.URLSelectorStrategy
 THIS useCcm(Boolean useCcm)
          Enable the use of a cached connection manager.
 THIS useFastFailAllocation(Boolean useFastFailAllocation)
          Whether fail a connection allocation on the first connection if it is invalid (true) or keep trying until the pool is exhausted of all potential connections (false).
 THIS useJavaContext(Boolean useJavaContext)
          Setting this to false will bind the datasource into global JNDI.
 THIS usernameAndPassword(String username, String password)
          Specify the user name and password used when creating a new connection.
 THIS useStrictMinPoolSize(Boolean useStrictMinPoolSize)
          If the minPoolSize should be considered a strictly.
 THIS useTryLock(Integer useTryLock)
          Any configured timeout for internal locks on the resource adapter objects in seconds.
 THIS validateOnMatch(Boolean validateOnMatch)
          Validation will be done on connection factory attempt to match a managed connection for a given set.
 THIS validConnectionCheckerClass(String validConnectionCheckerClass)
          An org.jboss.jca.adapters.jdbc.ValidConnectionChecker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddDataSource.Builder

public AddDataSource.Builder(String name)
Method Detail

connectionUrl

public final THIS connectionUrl(String connectionUrl)
Defines the JDBC driver connection URL.


driverName

public final THIS driverName(String driverName)
Defines the JDBC driver the datasource should use. It is a symbolic name matching the the name of installed driver. In case the driver is deployed as jar, the name is the name of deployment unit.


jndiName

public final THIS jndiName(String jndiName)
Specifies the JNDI name for the datasource.


driverClass

public final THIS driverClass(String driverClass)
What driver class will be used for connection. From version 4 of jdbc spec the driver jar class contains information about default driver class for the particular driver under META-INF/services/java.sql.Driver. If you don't need some special handling this will be resolved to default on its own.


datasourceClass

public final THIS datasourceClass(String datasourceClass)
What datasource class will be used for connection.

Datasource class has to be defined as fully qualified datasource class name of jdbc driver.

By default driver class is used for establishing connection but you can enforce the datasource class would be use. If you use datasource you will probably needs to define connection properties as well.


addConnectionProperty

public final THIS addConnectionProperty(String name,
                                        String value)
Adding connection property.

When datasource class is defined, then JCA injects these properties by calling setters based on property name (i.e., if connection property name is user, then JCA calls Datasource.setUser(value)). When driver class is defined, these properties are passed to Driver.


addConnectionProperty

public final THIS addConnectionProperty(String name,
                                        boolean value)
See addConnectionProperty(String, String)


addConnectionProperties

public final THIS addConnectionProperties(Map<String,String> connectionProperties)
Adding connection properties in bulk. See addConnectionProperty(String, String).


usernameAndPassword

public final THIS usernameAndPassword(String username,
                                      String password)
Specify the user name and password used when creating a new connection.


enableAfterCreate

public final THIS enableAfterCreate()
Defines whether the connector should be started on startup.


replaceExisting

public final THIS replaceExisting()
Specify whether to replace the existing datasource based on its name (pool-name). By default existing datasource is not replaced and exception is thrown. Note that when enabled, this can cause server reload!


jta

public final THIS jta(Boolean jta)
Enable JTA integration.


useJavaContext

public final THIS useJavaContext(Boolean useJavaContext)
Setting this to false will bind the datasource into global JNDI.


connectable

public final THIS connectable(Boolean connectable)
Setting this to true will let to use CMR.


maxPoolSize

public final THIS maxPoolSize(int maxPoolSize)
Specifies the maximum number of connections for a pool. No more connections will be created in each sub-pool.


minPoolSize

public final THIS minPoolSize(int minPoolSize)
Specifies the minimum number of connections for a pool.


statisticsEnabled

public final THIS statisticsEnabled(Boolean statisticsEnabled)
Sets whether runtime statistics are enabled or not.


useCcm

public final THIS useCcm(Boolean useCcm)
Enable the use of a cached connection manager.


newConnectionSql

public final THIS newConnectionSql(String newConnectionSql)
SQL statement to execute whenever a connection is added to the JCA connection pool.


transactionIsolation

public final THIS transactionIsolation(TransactionIsolation transactionIsolation)
Defines isolation level for connections created under this datasource.


urlDelimiter

public final THIS urlDelimiter(String urlDelimiter)
Specifies the delimeter for URLs in connection-url for HA datasources


urlSelectorStrategyClass

public final THIS urlSelectorStrategyClass(String urlSelectorStrategyClass)
A class that implements org.jboss.jca.adapters.jdbc.URLSelectorStrategy


prefill

public final THIS prefill(Boolean prefill)
Whether to attempt to prefill the connection pool.


securityDomain

public final THIS securityDomain(String securityDomain)
Security domain name to be used for authentication to datasource.


reauthPluginClass

public final THIS reauthPluginClass(String reauthPluginClass)
Setting reauth plugin class name.


addReauthPluginProperty

public final THIS addReauthPluginProperty(String name,
                                          String value)
Property for reauthPluginClass


addReauthPluginProperty

public final THIS addReauthPluginProperty(String name,
                                          boolean value)
Property for reauthPluginClass


useStrictMinPoolSize

public final THIS useStrictMinPoolSize(Boolean useStrictMinPoolSize)
If the minPoolSize should be considered a strictly.


flushStrategy

public final THIS flushStrategy(PoolFlushStrategy flushStrategy)
How poool should be flushed. There is predefined strategies by JCA. See PoolFlushStrategy.


checkValidConnectionSql

public final THIS checkValidConnectionSql(String checkValidConnectionSql)
SQL statement to check validity of a pool connection. May be used when connection is taken from pool to use.


validateOnMatch

public final THIS validateOnMatch(Boolean validateOnMatch)
Validation will be done on connection factory attempt to match a managed connection for a given set.

Typically exclusive to use of backgroundValidation.


backgroundValidation

public final THIS backgroundValidation(Boolean backgroundValidation)
Connections should be validated on a background thread (versus being validated prior to use).

Typically exclusive to use of validateOnMatch.


backgroundValidationMillis

public final THIS backgroundValidationMillis(Integer backgroundValidationMillis)
Amount of time that background validation will run.


useFastFailAllocation

public final THIS useFastFailAllocation(Boolean useFastFailAllocation)
Whether fail a connection allocation on the first connection if it is invalid (true) or keep trying until the pool is exhausted of all potential connections (false).


staleConnectionCheckerClass

public final THIS staleConnectionCheckerClass(String staleConnectionCheckerClass)
An org.jboss.jca.adapters.jdbc.StaleConnectionChecker.


addStaleConnectionCheckerProperty

public final THIS addStaleConnectionCheckerProperty(String name,
                                                    String value)
Property for staleConnectionCheckerClass


addStaleConnectionCheckerProperty

public final THIS addStaleConnectionCheckerProperty(String name,
                                                    boolean value)
Property for staleConnectionCheckerClass


validConnectionCheckerClass

public final THIS validConnectionCheckerClass(String validConnectionCheckerClass)
An org.jboss.jca.adapters.jdbc.ValidConnectionChecker.


addValidConnectionCheckerProperty

public final THIS addValidConnectionCheckerProperty(String name,
                                                    String value)
Property for validConnectionCheckerClass


addValidConnectionCheckerProperty

public final THIS addValidConnectionCheckerProperty(String name,
                                                    boolean value)
Property for validConnectionCheckerClass


exceptionSorterClass

public final THIS exceptionSorterClass(String exceptionSorterClass)
org.jboss.jca.adapters.jdbc.ExceptionSorter


addExceptionSorterProperty

public final THIS addExceptionSorterProperty(String name,
                                             String value)
Property for exceptionSorterClass


addExceptionSorterProperty

public final THIS addExceptionSorterProperty(String name,
                                             boolean value)
Property for exceptionSorterClass


spy

public final THIS spy(Boolean spy)
An org.jboss.jca.adapters.jdbc.ExceptionSorter.


blockingTimeoutWaitMillis

public final THIS blockingTimeoutWaitMillis(Integer blockingTimeoutWaitMillis)
The blocking-timeout-millis element indicates the maximum time in milliseconds to block while waiting for a connection before throwing an exception.


idleTimeoutMinutes

public final THIS idleTimeoutMinutes(Integer idleTimeoutMinutes)
The idle-timeout-minutes elements indicates the maximum time in minutes a connection may be idle before being closed.


setTxQueryTimeout

public final THIS setTxQueryTimeout(Boolean setTxQueryTimeout)
Whether to set the query timeout based on the time remaining until transaction timeout, any configured query timeout will be used if there is no transaction.


allowMultipleUsers

public final THIS allowMultipleUsers(Boolean allowMultipleUsers)
Specifies if multiple users will access the datasource through the getConnection(user, password) method and hence if the internal pool type should account for that


queryTimeout

public final THIS queryTimeout(Integer queryTimeout)
Any configured query timeout in seconds.


useTryLock

public final THIS useTryLock(Integer useTryLock)
Any configured timeout for internal locks on the resource adapter objects in seconds.


allocationRetry

public final THIS allocationRetry(Integer allocationRetry)
The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception.


allocationRetryWaitMillis

public final THIS allocationRetryWaitMillis(Integer allocationRetryWaitMillis)
The allocation retry wait millis element indicates the time in milliseconds to wait between retrying to allocate a connection


trackPreparedStatements

public final THIS trackPreparedStatements(TrackStatementType trackStatements)
Whether to check for unclosed statements when a connection is returned to the pool and result sets are closed when a statement is closed/return to the prepared statement cache.


sharePreparedStatements

public final THIS sharePreparedStatements(Boolean sharePreparedStatements)
Whether to share prepare statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement.


preparedStatementsCacheSize

public final THIS preparedStatementsCacheSize(Integer preparedStatementsCacheSize)
The number of prepared statements per connection in an LRU cache


managedConnectionPool

public final THIS managedConnectionPool(String managedConnectionPool)
Defines the ManagedConnectionPool implementation, f.ex. org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool


build

public AddDataSource build()

check

protected final void check()


Copyright © 2016. All rights reserved.