Class HikariCPServiceConfigurationACCSProvider
- java.lang.Object
-
- io.helidon.service.configuration.api.ServiceConfigurationProvider
-
- io.helidon.service.configuration.hikaricp.HikariCPServiceConfigurationProvider
-
- io.helidon.service.configuration.hikaricp.accs.HikariCPServiceConfigurationACCSProvider
-
@Deprecated public class HikariCPServiceConfigurationACCSProvider extends HikariCPServiceConfigurationProvider
Deprecated.This class is slated for removal.AHikariCPServiceConfigurationProvider
that providesHikariCPServiceConfiguration
instances when running on the Oracle Application Container Cloud Service system.
-
-
Constructor Summary
Constructors Constructor Description HikariCPServiceConfigurationACCSProvider()
Deprecated.Creates a newHikariCPServiceConfigurationACCSProvider
.
-
Method Summary
-
Methods inherited from class io.helidon.service.configuration.hikaricp.HikariCPServiceConfigurationProvider
buildFor, create, getDataSourceProperty, getPrefix
-
Methods inherited from class io.helidon.service.configuration.api.ServiceConfigurationProvider
getAuthoritativeSystem, getServiceIdentifier
-
-
-
-
Constructor Detail
-
HikariCPServiceConfigurationACCSProvider
public HikariCPServiceConfigurationACCSProvider()
Deprecated.Creates a newHikariCPServiceConfigurationACCSProvider
.
-
-
Method Detail
-
appliesTo
protected boolean appliesTo(Properties properties, System system, Properties coordinates)
Deprecated.Overrides theHikariCPServiceConfigurationProvider.appliesTo(Properties, io.helidon.service.configuration.api.System, Properties)
method to returntrue
if the suppliedSystem
is enabled and has a name equal toaccs
, and if its environment contains at least one key starting with eitherMYSQLCS_
orDBAAS_
, and if theHikariCPServiceConfigurationProvider.appliesTo(Properties, io.helidon.service.configuration.api.System, Properties)
method also returnstrue
.- Overrides:
appliesTo
in classHikariCPServiceConfigurationProvider
- Parameters:
properties
- aProperties
instance that will be used as the basis of theHikariCPServiceConfiguration
implementation that will be returned by theHikariCPServiceConfigurationProvider.create(Properties, io.helidon.service.configuration.api.System, Properties)
method; must not benull
system
- aSystem
determined to be in effect; may, strictly speaking, benull
but ordinarily is non-null
and enabledcoordinates
- aProperties
instance representing the meta-properties in effect; may benull
- Returns:
true
if thisHikariCPServiceConfigurationACCSProvider
applies to the configuration space implied by the supplied parameters;false
otherwise- Throws:
NullPointerException
- ifproperties
isnull
-
installDataSourceProperties
protected void installDataSourceProperties(Properties target, System system, Properties coordinates, String dataSourceName)
Deprecated.Overrides theHikariCPServiceConfigurationProvider.installDataSourceProperties(Properties, io.helidon.service.configuration.api.System, Properties, String)
to install data source-related properties discovered in the Oracle Application Container Cloud Service environment.While reading the documentation for this method, note that the Oracle Application Container Cloud Service sets up automatic service bindings for only Oracle or MySQL databases.
This method:
- Calls the
HikariCPServiceConfigurationProvider.installDataSourceProperties(Properties, io.helidon.service.configuration.api.System, Properties, String)
method. - Checks to see if a property named
javax.sql.DataSource.
dataSourceName
.explicitlyConfigured
has aString
value equal to anything other thantrue
, includingnull
. - If so, and only if
dataSourceName
isnull
, then it sets certain properties ontarget
. - Specifically, if there is a MySQL service binding and not
an Oracle database service binding, the following properties
will be set:
javax.sql.DataSource.dataSourceClassName = com.mysql.cj.jdbc.MysqlDataSource
javax.sql.DataSource.dataSource.url = jdbc:mysql://${MYSQLCS_CONNECT_STRING}
javax.sql.DataSource.dataSource.description = Autodiscovered
javax.sql.DataSource.dataSource.user = ${MYSQLCS_USER_NAME}
javax.sql.DataSource.dataSource.password = ${MYSQLCS_PASSWORD}
- If instead there is an Oracle database service binding, but
not also a MySQL service binding, the following properties will
be set:
javax.sql.DataSource.dataSourceClassName = oracle.jdbc.pool.OracleDataSource
javax.sql.DataSource.dataSource.url = jdbc:oracle:thin:@//${DBAAS_DEFAULT_CONNECT_DESCRIPTOR}
javax.sql.DataSource.dataSource.description = Autodiscovered
javax.sql.DataSource.dataSource.user = ${DBAAS_USER}
javax.sql.DataSource.dataSource.password = ${DBAAS_PASSWORD}
- Overrides:
installDataSourceProperties
in classHikariCPServiceConfigurationProvider
- Parameters:
target
- aProperties
instance that will be used as the basis of theHikariCPServiceConfiguration
implementation that will be returned by theHikariCPServiceConfigurationProvider.create(Properties, io.helidon.service.configuration.api.System, Properties)
method and into which properties may be installed; must not benull
system
- aSystem
determined to be in effect; may, strictly speaking, benull
but ordinarily is non-null
and enabledcoordinates
- aProperties
instance representing the meta-properties in effect; may benull
dataSourceName
- the data source name in question; may benull
- Throws:
NullPointerException
- iftarget
isnull
- See Also:
HikariCPServiceConfigurationProvider.installDataSourceProperties(Properties, io.helidon.service.configuration.api.System, Properties, String)
- Calls the
-
getDataSourceClassName
protected String getDataSourceClassName(String jdbcUrl)
Deprecated.Returns the name of a Java class that implements theDataSource
interface that is appropriate for the supplied JDBC URL.This method may return
null
.Overrides of this method may return
null
.Overrides of this method must return the same value for the same input.
This implementation returns
com.mysql.cj.jdbc.MysqlDataSource
if the suppliedjdbcUrl
starts withjdbc:mysql:
, and returnsoracle.jdbc.pool.OracleDataSource
if the suppliedjdbcUrl
starts withjdbc:oracle:
, andnull
in all other cases.- Parameters:
jdbcUrl
- a JDBC URL inString
form; must not benull
- Returns:
- a
DataSource
implementation class name, ornull
- Throws:
NullPointerException
- ifjdbcUrl
isnull
-
-