Class WalletArchive

java.lang.Object
io.micronaut.oraclecloud.atp.wallet.WalletArchive
All Implemented Interfaces:
CanConfigureOracleDataSource

public class WalletArchive extends Object implements CanConfigureOracleDataSource
Represents a Zip archive containing at least a cwallet.sso or ewallet.p12 and optionally a tnsnames.ora.
  • Method Details

    • serviceAlias

      public String serviceAlias()
      Indicates the database service alias (AKA TNS Alias) associated with this io.micronaut.oraclecloud.adb.wallet archive. Since a io.micronaut.oraclecloud.adb.wallet may hold multiple sets of database credentials, this value identifies which service will be used to configure a data source via configure(OracleDataSourceAttributes)
      Returns:
      The service alias associated with this io.micronaut.oraclecloud.adb.wallet archive, or null if this io.micronaut.oraclecloud.adb.wallet archive is not associated with a particular service
      See Also:
    • with

      public WalletArchive with(String serviceAlias)
      Specialize this io.micronaut.oraclecloud.adb.wallet archive to configure the specified service alias (AKA TNS Alias). If the archive contains a tnsnames.ora and the connection descriptor for the service alias is used to configure the JDBC url of the OracleDataSourceAttributes
      Parameters:
      serviceAlias - The alias of the database service to configure
      Returns:
      WalletArchive instance that will additionally configure the user credentials and URL for the database
      See Also:
    • configure

      public <T extends OracleDataSourceAttributes> T configure(T dataSource) throws IOException
      Configure a data source with the state held in this io.micronaut.oraclecloud.adb.wallet archive. If a serviceAlias() has been identified then any database credentials in the io.micronaut.oraclecloud.adb.wallet will be used to configure the data source and the corresponding connection descriptor in tnsnames.ora will be used to configure the JDBC URL.

      If the io.micronaut.oraclecloud.adb.wallet contains a certificate key store and/or trust store these will be used to configure a TLS connection for the data source.

      Specified by:
      configure in interface CanConfigureOracleDataSource
      Type Parameters:
      T - The data source type
      Parameters:
      dataSource - The data source to be configured by this io.micronaut.oraclecloud.adb.wallet
      Returns:
      The supplied data source
      Throws:
      WalletException - if an error occurs accessing the io.micronaut.oraclecloud.adb.wallet
      IOException - if an error occurs reading the state embodied in this instance