ConnectionBuilder
, OracleConnectionBuilder
public abstract class OracleConnectionBuilderImpl extends Object implements OracleConnectionBuilder
Modifier and Type | Field | Description |
---|---|---|
protected GSSCredential |
gssCredential |
|
protected String |
instanceName |
|
protected String |
password |
|
protected String |
serviceName |
|
protected OracleShardingKey |
shardingKey |
|
protected SSLContext |
sslContext |
|
protected OracleShardingKey |
superShardingKey |
|
protected java.util.function.Supplier<? extends AccessToken> |
tokenSupplier |
Supplier of access tokens that this builder is configured to use for
authenticating a connection.
|
protected String |
user |
Constructor | Description |
---|---|
OracleConnectionBuilderImpl() |
protected String user
protected String password
protected String serviceName
protected String instanceName
protected OracleShardingKey shardingKey
protected OracleShardingKey superShardingKey
protected SSLContext sslContext
protected java.util.function.Supplier<? extends AccessToken> tokenSupplier
accessToken(AccessToken)
, or
internal code calling setTokenSupplier(Supplier)
. In the case
of user code calling the external API, this supplier returns a fixed
value tht was passed into accessToken(AccessToken)
This field stores security sensitive valus. It should not be included in
log messages. It should be annotated with @Blind by getter and setter
methods.
protected GSSCredential gssCredential
public abstract OracleConnection build() throws SQLException
build
in interface ConnectionBuilder
build
in interface OracleConnectionBuilder
SQLException
OracleConnectionBuilder.build()
public OracleConnectionBuilderImpl password(String password)
password
in interface ConnectionBuilder
password
in interface OracleConnectionBuilder
password
- Password to be a part of the connection requestOracleConnectionBuilder.password(java.lang.String)
public OracleConnectionBuilderImpl user(String user)
user
in interface ConnectionBuilder
user
in interface OracleConnectionBuilder
user
- User Name to be a part of the connection requestOracleConnectionBuilder.user(java.lang.String)
public OracleConnectionBuilderImpl serviceName(String serviceName)
serviceName
- Service name to be part of the connection requestpublic OracleConnectionBuilderImpl instanceName(String instanceName)
instanceName
- Instance name to be part of the connection requestpublic OracleConnectionBuilderImpl shardingKey(OracleShardingKey shardingKey)
shardingKey
in interface OracleConnectionBuilder
shardingKey
- Sharding Key object that needs to be part of connection requestOracleConnectionBuilder.shardingKey(oracle.jdbc.OracleShardingKey)
public OracleConnectionBuilderImpl superShardingKey(OracleShardingKey superShardingKey)
superShardingKey
in interface OracleConnectionBuilder
superShardingKey
- Super Sharding Key object that needs to be part of connection
requestOracleConnectionBuilder.superShardingKey(oracle.jdbc.OracleShardingKey)
public OracleConnectionBuilderImpl shardingKey(ShardingKey shardingKey)
shardingKey
in interface ConnectionBuilder
shardingKey
in interface OracleConnectionBuilder
shardingKey
- Sharding Key object that needs to be part of connection requestOracleConnectionBuilder.shardingKey(oracle.jdbc.OracleShardingKey)
public OracleConnectionBuilderImpl superShardingKey(ShardingKey superShardingKey)
superShardingKey
in interface ConnectionBuilder
superShardingKey
in interface OracleConnectionBuilder
superShardingKey
- Super Sharding Key object that needs to be part of connection
requestOracleConnectionBuilder.superShardingKey(oracle.jdbc.OracleShardingKey)
public OracleConnectionBuilderImpl gssCredential(GSSCredential credential)
gssCredential
in interface OracleConnectionBuilder
credential
- used to authenticate the connection. Not null.public OracleConnectionBuilderImpl sslContext(SSLContext sslContext)
sslContext
in interface OracleConnectionBuilder
sslContext
- An SSLContext to set. May be null.public final SSLContext getSSLContext()
public String getUser()
public String getPassword()
public String getServiceName()
public String getInstanceName()
public OracleShardingKeyImpl getShardingKey()
public OracleShardingKeyImpl getSuperShardingKey()
public GSSCredential getGSSCredential()
public final OracleConnectionBuilderImpl accessToken(AccessToken accessToken)
Sets the accessToken(oracle.jdbc.AccessToken)
field of this builder.
The behavior and signature of this method are identical to what is
specified by
oracle.jdbc.OracleConnectionBuilder#accessToken(char[], PrivateKey)
.
Subclasses that implement OracleConnectionBuilder
may inherit this
implementation.
accessToken
in interface OracleConnectionBuilder
accessToken
- the token to use for this connection. Not null
.ConnectionBuilder
instanceNullPointerException
- If accessToken
is null.public final void setTokenSupplier(java.util.function.Supplier<? extends AccessToken> tokenSupplier)
Supplier
of
AccessToken
s. The Supplier
may assume that the driver
will only request a token from it immediately prior to sending that token
to the database. This affords highest possible precision for a
Supplier
when estimating whether or not a cached token would reach
the database before expiring.tokenSupplier
- Supplier of tokenspublic final java.util.function.Supplier<? extends AccessToken> getTokenSupplier()
AccessToken
s if one has been specified by
user code calling accessToken(AccessToken)
, or by internal code
calling setTokenSupplier(Supplier)
.
The Supplier
returned by this method should only be invoked to
output a token immediately prior to sending the token to the database.
This affords the supplier with the best possible preceision for
estimating whether or not a cached token would reach the database
before expiring.
AccessToken
s specified to this builder, or
null
if none has been specified.public final void verifyBuildConfiguration() throws SQLException
build()
will produce a valid connection. This method verifies
any conditions described in the JavaDocs of
AbstractConnectionBuilder
. Subclasses implement build()
to call this method prior to returning a connection.SQLException
- If this builder has an invalid configuration.