org.wildfly.extras.creaper.commands.datasources
Class AddDataSource.Builder

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

public static class AddDataSource.Builder
extends Object

Builder for configuration attributes of a datasource.

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

Constructor Summary
AddDataSource.Builder(String name)
           
 
Method Summary
 AddDataSource.Builder addConnectionProperties(Map<String,String> connectionProperties)
          Adding connection properties in bulk.
 AddDataSource.Builder addConnectionProperty(String name, boolean value)
          See addConnectionProperty(String, String)
 AddDataSource.Builder addConnectionProperty(String name, String value)
          Adding connection property.
 AddDataSource.Builder addExceptionSorterProperty(String name, boolean value)
          Property for exceptionSorterClass
 AddDataSource.Builder addExceptionSorterProperty(String name, String value)
          Property for exceptionSorterClass
 AddDataSource.Builder addReauthPluginProperty(String name, boolean value)
          Property for reauthPluginClass
 AddDataSource.Builder addReauthPluginProperty(String name, String value)
          Property for reauthPluginClass
 AddDataSource.Builder addStaleConnectionCheckerProperty(String name, boolean value)
          Property for staleConnectionCheckerClass
 AddDataSource.Builder addStaleConnectionCheckerProperty(String name, String value)
          Property for staleConnectionCheckerClass
 AddDataSource.Builder addValidConnectionCheckerProperty(String name, boolean value)
          Property for validConnectionCheckerClass
 AddDataSource.Builder addValidConnectionCheckerProperty(String name, String value)
          Property for validConnectionCheckerClass
 AddDataSource.Builder allocationRetry(Integer allocationRetry)
          The allocation retry element indicates the number of times that allocating a connection should be tried before throwing an exception.
 AddDataSource.Builder allocationRetryWaitMillis(Integer allocationRetryWaitMillis)
          The allocation retry wait millis element indicates the time in milliseconds to wait between retrying to allocate a connection
 AddDataSource.Builder 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
 AddDataSource.Builder backgroundValidation(Boolean backgroundValidation)
          Connections should be validated on a background thread (versus being validated prior to use).
 AddDataSource.Builder backgroundValidationMillis(Integer backgroundValidationMillis)
          Amount of time that background validation will run.
 AddDataSource.Builder 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()
           
protected  void check()
           
 AddDataSource.Builder checkValidConnectionSql(String checkValidConnectionSql)
          SQL statement to check validity of a pool connection.
 AddDataSource.Builder connectable(Boolean connectable)
          Setting this to true will let to use CMR.
 AddDataSource.Builder connectionUrl(String connectionUrl)
          Defines the JDBC driver connection URL.
 AddDataSource.Builder datasourceClass(String datasourceClass)
          What datasource class will be used for connection.
 AddDataSource.Builder driverClass(String driverClass)
          What driver class will be used for connection.
 AddDataSource.Builder driverName(String driverName)
          Defines the JDBC driver the datasource should use.
 AddDataSource.Builder enableAfterCreate()
          Defines whether the connector should be started on startup.
 AddDataSource.Builder exceptionSorterClass(String exceptionSorterClass)
          org.jboss.jca.adapters.jdbc.ExceptionSorter
 AddDataSource.Builder flushStrategy(PoolFlushStrategy flushStrategy)
          How poool should be flushed.
 AddDataSource.Builder idleTimeoutMinutes(Integer idleTimeoutMinutes)
          The idle-timeout-minutes elements indicates the maximum time in minutes a connection may be idle before being closed.
 AddDataSource.Builder jndiName(String jndiName)
          Specifies the JNDI name for the datasource.
 AddDataSource.Builder jta(Boolean jta)
          Enable JTA integration.
 AddDataSource.Builder maxPoolSize(int maxPoolSize)
          Specifies the maximum number of connections for a pool.
 AddDataSource.Builder minPoolSize(int minPoolSize)
          Specifies the minimum number of connections for a pool.
 AddDataSource.Builder newConnectionSql(String newConnectionSql)
          SQL statement to execute whenever a connection is added to the JCA connection pool.
 AddDataSource.Builder prefill(Boolean prefill)
          Whether to attempt to prefill the connection pool.
 AddDataSource.Builder preparedStatementsCacheSize(Integer preparedStatementsCacheSize)
          The number of prepared statements per connection in an LRU cache
 AddDataSource.Builder queryTimeout(Integer queryTimeout)
          Any configured query timeout in seconds.
 AddDataSource.Builder reauthPluginClass(String reauthPluginClass)
          Setting reauth plugin class name.
 AddDataSource.Builder replaceExisting()
          Specify whether to replace the existing datasource based on its name (pool-name).
 AddDataSource.Builder securityDomain(String securityDomain)
          Security domain name to be used for authentication to datasource.
 AddDataSource.Builder 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.
 AddDataSource.Builder sharePreparedStatements(Boolean sharePreparedStatements)
          Whether to share prepare statements, i.e.
 AddDataSource.Builder spy(Boolean spy)
          An org.jboss.jca.adapters.jdbc.ExceptionSorter.
 AddDataSource.Builder staleConnectionCheckerClass(String staleConnectionCheckerClass)
          An org.jboss.jca.adapters.jdbc.StaleConnectionChecker.
 AddDataSource.Builder statisticsEnabled(Boolean statisticsEnabled)
          Sets whether runtime statistics are enabled or not.
 AddDataSource.Builder 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.
 AddDataSource.Builder transactionIsolation(TransactionIsolation transactionIsolation)
          Defines isolation level for connections created under this datasource.
 AddDataSource.Builder urlDelimiter(String urlDelimiter)
          Specifies the delimeter for URLs in connection-url for HA datasources
 AddDataSource.Builder urlSelectorStrategyClass(String urlSelectorStrategyClass)
          A class that implements org.jboss.jca.adapters.jdbc.URLSelectorStrategy
 AddDataSource.Builder useCcm(Boolean useCcm)
          Enable the use of a cached connection manager.
 AddDataSource.Builder 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).
 AddDataSource.Builder useJavaContext(Boolean useJavaContext)
          Setting this to false will bind the datasource into global JNDI.
 AddDataSource.Builder usernameAndPassword(String username, String password)
          Specify the user name and password used when creating a new connection.
 AddDataSource.Builder useStrictMinPoolSize(Boolean useStrictMinPoolSize)
          If the minPoolSize should be considered a strictly.
 AddDataSource.Builder useTryLock(Integer useTryLock)
          Any configured timeout for internal locks on the resource adapter objects in seconds.
 AddDataSource.Builder validateOnMatch(Boolean validateOnMatch)
          Validation will be done on connection factory attempt to match a managed connection for a given set.
 AddDataSource.Builder 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 AddDataSource.Builder connectionUrl(String connectionUrl)
Defines the JDBC driver connection URL.


driverName

public final AddDataSource.Builder 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 AddDataSource.Builder jndiName(String jndiName)
Specifies the JNDI name for the datasource.


driverClass

public final AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder addConnectionProperty(String name,
                                                         boolean value)
See addConnectionProperty(String, String)


addConnectionProperties

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


usernameAndPassword

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


enableAfterCreate

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


replaceExisting

public final AddDataSource.Builder 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.


jta

public final AddDataSource.Builder jta(Boolean jta)
Enable JTA integration.


useJavaContext

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


connectable

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


maxPoolSize

public final AddDataSource.Builder 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 AddDataSource.Builder minPoolSize(int minPoolSize)
Specifies the minimum number of connections for a pool.


statisticsEnabled

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


useCcm

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


newConnectionSql

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


transactionIsolation

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


urlDelimiter

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


urlSelectorStrategyClass

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


prefill

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


securityDomain

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


reauthPluginClass

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


addReauthPluginProperty

public final AddDataSource.Builder addReauthPluginProperty(String name,
                                                           String value)
Property for reauthPluginClass


addReauthPluginProperty

public final AddDataSource.Builder addReauthPluginProperty(String name,
                                                           boolean value)
Property for reauthPluginClass


useStrictMinPoolSize

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


flushStrategy

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


checkValidConnectionSql

public final AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder backgroundValidationMillis(Integer backgroundValidationMillis)
Amount of time that background validation will run.


useFastFailAllocation

public final AddDataSource.Builder 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 AddDataSource.Builder staleConnectionCheckerClass(String staleConnectionCheckerClass)
An org.jboss.jca.adapters.jdbc.StaleConnectionChecker.


addStaleConnectionCheckerProperty

public final AddDataSource.Builder addStaleConnectionCheckerProperty(String name,
                                                                     String value)
Property for staleConnectionCheckerClass


addStaleConnectionCheckerProperty

public final AddDataSource.Builder addStaleConnectionCheckerProperty(String name,
                                                                     boolean value)
Property for staleConnectionCheckerClass


validConnectionCheckerClass

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


addValidConnectionCheckerProperty

public final AddDataSource.Builder addValidConnectionCheckerProperty(String name,
                                                                     String value)
Property for validConnectionCheckerClass


addValidConnectionCheckerProperty

public final AddDataSource.Builder addValidConnectionCheckerProperty(String name,
                                                                     boolean value)
Property for validConnectionCheckerClass


exceptionSorterClass

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


addExceptionSorterProperty

public final AddDataSource.Builder addExceptionSorterProperty(String name,
                                                              String value)
Property for exceptionSorterClass


addExceptionSorterProperty

public final AddDataSource.Builder addExceptionSorterProperty(String name,
                                                              boolean value)
Property for exceptionSorterClass


spy

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


blockingTimeoutWaitMillis

public final AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder queryTimeout(Integer queryTimeout)
Any configured query timeout in seconds.


useTryLock

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


allocationRetry

public final AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder 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 AddDataSource.Builder preparedStatementsCacheSize(Integer preparedStatementsCacheSize)
The number of prepared statements per connection in an LRU cache


build

public AddDataSource build()

check

protected final void check()


Copyright © 2015. All rights reserved.