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.AHikariCPServiceConfigurationProviderthat providesHikariCPServiceConfigurationinstances 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 returntrueif the suppliedSystemis 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:
appliesToin classHikariCPServiceConfigurationProvider- Parameters:
properties- aPropertiesinstance that will be used as the basis of theHikariCPServiceConfigurationimplementation that will be returned by theHikariCPServiceConfigurationProvider.create(Properties, io.helidon.service.configuration.api.System, Properties)method; must not benullsystem- aSystemdetermined to be in effect; may, strictly speaking, benullbut ordinarily is non-nulland enabledcoordinates- aPropertiesinstance representing the meta-properties in effect; may benull- Returns:
trueif thisHikariCPServiceConfigurationACCSProviderapplies to the configuration space implied by the supplied parameters;falseotherwise- Throws:
NullPointerException- ifpropertiesisnull
-
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.explicitlyConfiguredhas aStringvalue equal to anything other thantrue, includingnull. - If so, and only if
dataSourceNameisnull, 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.MysqlDataSourcejavax.sql.DataSource.dataSource.url = jdbc:mysql://${MYSQLCS_CONNECT_STRING}javax.sql.DataSource.dataSource.description = Autodiscoveredjavax.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.OracleDataSourcejavax.sql.DataSource.dataSource.url = jdbc:oracle:thin:@//${DBAAS_DEFAULT_CONNECT_DESCRIPTOR}javax.sql.DataSource.dataSource.description = Autodiscoveredjavax.sql.DataSource.dataSource.user = ${DBAAS_USER}javax.sql.DataSource.dataSource.password = ${DBAAS_PASSWORD}
- Overrides:
installDataSourcePropertiesin classHikariCPServiceConfigurationProvider- Parameters:
target- aPropertiesinstance that will be used as the basis of theHikariCPServiceConfigurationimplementation 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 benullsystem- aSystemdetermined to be in effect; may, strictly speaking, benullbut ordinarily is non-nulland enabledcoordinates- aPropertiesinstance representing the meta-properties in effect; may benulldataSourceName- the data source name in question; may benull- Throws:
NullPointerException- iftargetisnull- 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 theDataSourceinterface 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.MysqlDataSourceif the suppliedjdbcUrlstarts withjdbc:mysql:, and returnsoracle.jdbc.pool.OracleDataSourceif the suppliedjdbcUrlstarts withjdbc:oracle:, andnullin all other cases.- Parameters:
jdbcUrl- a JDBC URL inStringform; must not benull- Returns:
- a
DataSourceimplementation class name, ornull - Throws:
NullPointerException- ifjdbcUrlisnull
-
-