public class HikariCPServiceConfigurationACCSProvider extends HikariCPServiceConfigurationProvider
HikariCPServiceConfigurationProvider that provides HikariCPServiceConfiguration instances when running on the Oracle
Application Container Cloud Service system.HikariCPServiceConfiguration,
HikariCPServiceConfigurationProvider| Constructor and Description |
|---|
HikariCPServiceConfigurationACCSProvider()
Creates a new
HikariCPServiceConfigurationACCSProvider. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
appliesTo(java.util.Properties properties,
io.helidon.service.configuration.api.System system,
java.util.Properties coordinates)
Overrides the
HikariCPServiceConfigurationProvider.appliesTo(Properties,
System, Properties) method to return true if the
supplied System is
enabled and has a name equal to
accs, and if its environment
contains at least one key starting with either MYSQLCS_
or DBAAS_, and if the HikariCPServiceConfigurationProvider.appliesTo(Properties,
System, Properties) method also returns true. |
protected java.lang.String |
getDataSourceClassName(java.lang.String jdbcUrl)
Returns the name of a Java class that implements the
DataSource interface that is appropriate for the supplied JDBC
URL. |
protected void |
installDataSourceProperties(java.util.Properties target,
io.helidon.service.configuration.api.System system,
java.util.Properties coordinates,
java.lang.String dataSourceName)
Overrides the
HikariCPServiceConfigurationProvider.installDataSourceProperties(Properties,
System, Properties, String) to install data source-related
properties discovered in the Oracle
Application Container Cloud Service environment. |
buildFor, create, getDataSourceProperty, getPrefixpublic HikariCPServiceConfigurationACCSProvider()
HikariCPServiceConfigurationACCSProvider.protected boolean appliesTo(java.util.Properties properties,
io.helidon.service.configuration.api.System system,
java.util.Properties coordinates)
HikariCPServiceConfigurationProvider.appliesTo(Properties,
System, Properties) method to return true if the
supplied System is
enabled and has a name equal to
accs, and if its environment
contains at least one key starting with either MYSQLCS_
or DBAAS_, and if the HikariCPServiceConfigurationProvider.appliesTo(Properties,
System, Properties) method also returns true.appliesTo in class HikariCPServiceConfigurationProviderproperties - a Properties instance that will be used
as the basis of the HikariCPServiceConfiguration
implementation that will be returned by the HikariCPServiceConfigurationProvider.create(Properties, System, Properties) method; must not be
nullsystem - a System determined to be in effect; may,
strictly speaking, be null but ordinarily is non-null and enabledcoordinates - a Properties instance representing the
meta-properties in effect; may be nulltrue if this HikariCPServiceConfigurationACCSProvider applies to the
configuration space implied by the supplied parameters; false otherwisejava.lang.NullPointerException - if properties is nullprotected void installDataSourceProperties(java.util.Properties target,
io.helidon.service.configuration.api.System system,
java.util.Properties coordinates,
java.lang.String dataSourceName)
HikariCPServiceConfigurationProvider.installDataSourceProperties(Properties,
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:
HikariCPServiceConfigurationProvider.installDataSourceProperties(Properties,
System, Properties, String) method.javax.sql.DataSource.dataSourceName.explicitlyConfigured has a String value equal to
anything other than true, including null.dataSourceName is null, then it sets certain properties
on target.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}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}installDataSourceProperties in class HikariCPServiceConfigurationProvidertarget - a Properties instance that will be used as
the basis of the HikariCPServiceConfiguration
implementation that will be returned by the HikariCPServiceConfigurationProvider.create(Properties, System, Properties) method and into which
properties may be installed; must not be nullsystem - a System determined to be in effect; may,
strictly speaking, be null but ordinarily is non-null and enabledcoordinates - a Properties instance representing the
meta-properties in effect; may be nulldataSourceName - the data source name in question; may be
nulljava.lang.NullPointerException - if target is nullHikariCPServiceConfigurationProvider.installDataSourceProperties(Properties,
System, Properties, String)protected java.lang.String getDataSourceClassName(java.lang.String jdbcUrl)
DataSource 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 supplied jdbcUrl starts with jdbc:mysql:, and returns oracle.jdbc.pool.OracleDataSource if the supplied jdbcUrl starts with jdbc:oracle:, and null in
all other cases.
jdbcUrl - a JDBC URL in String form; must not be
nullDataSource implementation class name, or nulljava.lang.NullPointerException - if jdbcUrl is nullCopyright © 2018 Oracle Corporation. All rights reserved.