Package io.vertx.oracleclient
Class OracleConnectOptions
- java.lang.Object
-
- io.vertx.sqlclient.SqlConnectOptions
-
- io.vertx.oracleclient.OracleConnectOptions
-
public class OracleConnectOptions extends SqlConnectOptions
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DATABASE
static String
DEFAULT_HOST
static String
DEFAULT_PASSWORD
static int
DEFAULT_PORT
static boolean
DEFAULT_SSL
static String
DEFAULT_USER
-
Fields inherited from class io.vertx.sqlclient.SqlConnectOptions
DEFAULT_CACHE_PREPARED_STATEMENTS, DEFAULT_METRICS_NAME, DEFAULT_PREPARED_STATEMENT_CACHE_FILTER, DEFAULT_PREPARED_STATEMENT_CACHE_MAX_SIZE, DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL
-
-
Constructor Summary
Constructors Constructor Description OracleConnectOptions()
OracleConnectOptions(JsonObject json)
OracleConnectOptions(OracleConnectOptions other)
OracleConnectOptions(SqlConnectOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OracleConnectOptions
addProperty(String key, String value)
Add a property for this client, which will be sent to server at the connection start.static OracleConnectOptions
fromUri(String connectionUri)
Provide aOracleConnectOptions
configured from a connection URI.boolean
getCachePreparedStatements()
Get whether prepared statements cache is enabled.String
getDatabase()
Get the default database name for the connection.String
getHost()
Get the host for connecting to the server.String
getInstanceName()
String
getPassword()
Get the user password to be used for the authentication.int
getPort()
Get the port for connecting to the server.int
getPreparedStatementCacheMaxSize()
Get the maximum number of prepared statements that the connection will cache.java.util.function.Predicate<String>
getPreparedStatementCacheSqlFilter()
Get the predicate filtering prepared statements that the connection will cache.Map<String,String>
getProperties()
ServerMode
getServerMode()
String
getServiceId()
String
getServiceName()
SocketAddress
getSocketAddress()
String
getTnsAdmin()
String
getTnsAlias()
TracingPolicy
getTracingPolicy()
String
getUser()
Get the user account to be used for the authentication.protected void
init()
Initialize with the default options.boolean
isSsl()
OracleConnectOptions
merge(JsonObject other)
Returns new options created after this object and merged with theother
json config.OracleConnectOptions
setCachePreparedStatements(boolean cachePreparedStatements)
Set whether prepared statements cache should be enabled.OracleConnectOptions
setDatabase(String database)
Set the database name.OracleConnectOptions
setHost(String host)
Specify the host for connecting to the server.OracleConnectOptions
setInstanceName(String instanceName)
Set the Oracle instance name.OracleConnectOptions
setPassword(String password)
Specify the user password to be used for the authentication.OracleConnectOptions
setPort(int port)
Specify the port for connecting to the server.OracleConnectOptions
setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
Set the maximum number of prepared statements that the connection will cache.OracleConnectOptions
setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
Set a predicate filtering prepared statements that the connection will cache.OracleConnectOptions
setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
Set the maximum length of prepared statement SQL string that the connection will cache.OracleConnectOptions
setProperties(Map<String,String> properties)
Set properties for this client, which will be sent to server at the connection start.OracleConnectOptions
setServerMode(ServerMode serverMode)
Set the server connection mode.OracleConnectOptions
setServiceId(String serviceId)
Set the Oracle service identifier (SID).OracleConnectOptions
setServiceName(String serviceName)
Set the Oracle service name.OracleConnectOptions
setSsl(boolean ssl)
Set whether SSL/TLS is enabledOracleConnectOptions
setTnsAdmin(String tnsAdmin)
Set the path of the directory that contains thetnsnames.ora
file.OracleConnectOptions
setTnsAlias(String tnsAlias)
Set the name of an alias configured in thetnsnames.ora
file.OracleConnectOptions
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the client behavior when Vert.x has tracing enabled.OracleConnectOptions
setUser(String user)
Specify the user account to be used for the authentication.JsonObject
toJson()
static OracleConnectOptions
wrap(SqlConnectOptions options)
-
Methods inherited from class io.vertx.sqlclient.SqlConnectOptions
getMetricsName, getReconnectAttempts, getReconnectInterval, getSslOptions, isUsingDomainSocket, setMetricsName, setReconnectAttempts, setReconnectInterval, setSslOptions
-
-
-
-
Field Detail
-
DEFAULT_HOST
public static final String DEFAULT_HOST
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
DEFAULT_USER
public static final String DEFAULT_USER
- See Also:
- Constant Field Values
-
DEFAULT_PASSWORD
public static final String DEFAULT_PASSWORD
- See Also:
- Constant Field Values
-
DEFAULT_DATABASE
public static final String DEFAULT_DATABASE
- See Also:
- Constant Field Values
-
DEFAULT_SSL
public static final boolean DEFAULT_SSL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OracleConnectOptions
public OracleConnectOptions()
-
OracleConnectOptions
public OracleConnectOptions(OracleConnectOptions other)
-
OracleConnectOptions
public OracleConnectOptions(SqlConnectOptions options)
-
OracleConnectOptions
public OracleConnectOptions(JsonObject json)
-
-
Method Detail
-
wrap
public static OracleConnectOptions wrap(SqlConnectOptions options)
- Returns:
- the
options
as Oracle specific connect options
-
fromUri
public static OracleConnectOptions fromUri(String connectionUri) throws IllegalArgumentException
Provide aOracleConnectOptions
configured from a connection URI.- Parameters:
connectionUri
- the connection URI to configure from- Returns:
- a
OracleConnectOptions
parsed from the connection URI - Throws:
IllegalArgumentException
- when theconnectionUri
is in an invalid format
-
getServiceId
public String getServiceId()
- Returns:
- the Oracle service identifier (SID)
-
setServiceId
public OracleConnectOptions setServiceId(String serviceId)
Set the Oracle service identifier (SID). If set, the client will build an Oracle connection URL using SID instead of the EZConnect format.- Parameters:
serviceId
- the service identifier- Returns:
- a reference to this, so the API can be used fluently
-
getServiceName
public String getServiceName()
- Returns:
- the Oracle service name
-
setServiceName
public OracleConnectOptions setServiceName(String serviceName)
Set the Oracle service name. If set, the client will build an Oracle connection URL in the EZConnect format.- Parameters:
serviceName
- the Oracle service name- Returns:
- a reference to this, so the API can be used fluently
-
getServerMode
public ServerMode getServerMode()
- Returns:
- the server connection mode
-
setServerMode
public OracleConnectOptions setServerMode(ServerMode serverMode)
Set the server connection mode.- Parameters:
serverMode
- the connection mode- Returns:
- a reference to this, so the API can be used fluently
-
getInstanceName
public String getInstanceName()
- Returns:
- the Oracle instance name
-
setInstanceName
public OracleConnectOptions setInstanceName(String instanceName)
Set the Oracle instance name.- Parameters:
instanceName
- the instance name- Returns:
- a reference to this, so the API can be used fluently
-
getTnsAlias
public String getTnsAlias()
- Returns:
- name of the alias configured in the
tnsnames.ora
file
-
setTnsAlias
public OracleConnectOptions setTnsAlias(String tnsAlias)
Set the name of an alias configured in thetnsnames.ora
file.- Parameters:
tnsAlias
- the instance name- Returns:
- a reference to this, so the API can be used fluently
-
getTnsAdmin
public String getTnsAdmin()
- Returns:
- the path of the directory that contains the
tnsnames.ora
file
-
setTnsAdmin
public OracleConnectOptions setTnsAdmin(String tnsAdmin)
Set the path of the directory that contains thetnsnames.ora
file.- Parameters:
tnsAdmin
- path of the directory- Returns:
- a reference to this, so the API can be used fluently
-
getHost
public String getHost()
Description copied from class:SqlConnectOptions
Get the host for connecting to the server.- Overrides:
getHost
in classSqlConnectOptions
- Returns:
- the host
-
setHost
public OracleConnectOptions setHost(String host)
Description copied from class:SqlConnectOptions
Specify the host for connecting to the server.- Overrides:
setHost
in classSqlConnectOptions
- Parameters:
host
- the host to specify- Returns:
- a reference to this, so the API can be used fluently
-
getPort
public int getPort()
Description copied from class:SqlConnectOptions
Get the port for connecting to the server.- Overrides:
getPort
in classSqlConnectOptions
- Returns:
- the port
-
setPort
public OracleConnectOptions setPort(int port)
Description copied from class:SqlConnectOptions
Specify the port for connecting to the server.- Overrides:
setPort
in classSqlConnectOptions
- Parameters:
port
- the port to specify- Returns:
- a reference to this, so the API can be used fluently
-
getUser
public String getUser()
Description copied from class:SqlConnectOptions
Get the user account to be used for the authentication.- Overrides:
getUser
in classSqlConnectOptions
- Returns:
- the user
-
setUser
public OracleConnectOptions setUser(String user)
Description copied from class:SqlConnectOptions
Specify the user account to be used for the authentication.- Overrides:
setUser
in classSqlConnectOptions
- Parameters:
user
- the user to specify- Returns:
- a reference to this, so the API can be used fluently
-
getPassword
public String getPassword()
Description copied from class:SqlConnectOptions
Get the user password to be used for the authentication.- Overrides:
getPassword
in classSqlConnectOptions
- Returns:
- the password
-
setPassword
public OracleConnectOptions setPassword(String password)
Description copied from class:SqlConnectOptions
Specify the user password to be used for the authentication.- Overrides:
setPassword
in classSqlConnectOptions
- Parameters:
password
- the password to specify- Returns:
- a reference to this, so the API can be used fluently
-
getDatabase
public String getDatabase()
Description copied from class:SqlConnectOptions
Get the default database name for the connection.- Overrides:
getDatabase
in classSqlConnectOptions
- Returns:
- the database name
-
setDatabase
public OracleConnectOptions setDatabase(String database)
Set the database name. If set, the client will build an Oracle connection URL in the EZConnect format using thedatabase
value as service name.- Overrides:
setDatabase
in classSqlConnectOptions
- Parameters:
database
- the database name to specify- Returns:
- a reference to this, so the API can be used fluently
-
getCachePreparedStatements
public boolean getCachePreparedStatements()
Description copied from class:SqlConnectOptions
Get whether prepared statements cache is enabled.- Overrides:
getCachePreparedStatements
in classSqlConnectOptions
- Returns:
- the value
-
setCachePreparedStatements
public OracleConnectOptions setCachePreparedStatements(boolean cachePreparedStatements)
Description copied from class:SqlConnectOptions
Set whether prepared statements cache should be enabled.- Overrides:
setCachePreparedStatements
in classSqlConnectOptions
- Parameters:
cachePreparedStatements
- true if cache should be enabled- Returns:
- a reference to this, so the API can be used fluently
-
getPreparedStatementCacheMaxSize
public int getPreparedStatementCacheMaxSize()
Description copied from class:SqlConnectOptions
Get the maximum number of prepared statements that the connection will cache.- Overrides:
getPreparedStatementCacheMaxSize
in classSqlConnectOptions
- Returns:
- the size
-
setPreparedStatementCacheMaxSize
public OracleConnectOptions setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
Description copied from class:SqlConnectOptions
Set the maximum number of prepared statements that the connection will cache.- Overrides:
setPreparedStatementCacheMaxSize
in classSqlConnectOptions
- Parameters:
preparedStatementCacheMaxSize
- the size to set- Returns:
- a reference to this, so the API can be used fluently
-
getPreparedStatementCacheSqlFilter
public java.util.function.Predicate<String> getPreparedStatementCacheSqlFilter()
Description copied from class:SqlConnectOptions
Get the predicate filtering prepared statements that the connection will cache.- Overrides:
getPreparedStatementCacheSqlFilter
in classSqlConnectOptions
- Returns:
- the current predicate
-
setPreparedStatementCacheSqlFilter
public OracleConnectOptions setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
Description copied from class:SqlConnectOptions
Set a predicate filtering prepared statements that the connection will cache.The default predicate accepts predicate having query length <
SqlConnectOptions.DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT
- Overrides:
setPreparedStatementCacheSqlFilter
in classSqlConnectOptions
- Parameters:
predicate
- the filter
-
setPreparedStatementCacheSqlLimit
public OracleConnectOptions setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
Description copied from class:SqlConnectOptions
Set the maximum length of prepared statement SQL string that the connection will cache.This is an helper setting the
SqlConnectOptions.setPreparedStatementCacheSqlFilter(Predicate)
.- Overrides:
setPreparedStatementCacheSqlLimit
in classSqlConnectOptions
- Parameters:
preparedStatementCacheSqlLimit
- the maximum length limit of SQL string to set- Returns:
- a reference to this, so the API can be used fluently
-
getProperties
public Map<String,String> getProperties()
- Overrides:
getProperties
in classSqlConnectOptions
- Returns:
- the value of current connection properties
-
setProperties
public OracleConnectOptions setProperties(Map<String,String> properties)
Description copied from class:SqlConnectOptions
Set properties for this client, which will be sent to server at the connection start.- Overrides:
setProperties
in classSqlConnectOptions
- Parameters:
properties
- the value of properties to specify- Returns:
- a reference to this, so the API can be used fluently
-
addProperty
public OracleConnectOptions addProperty(String key, String value)
Description copied from class:SqlConnectOptions
Add a property for this client, which will be sent to server at the connection start.- Overrides:
addProperty
in classSqlConnectOptions
- Parameters:
key
- the value of property keyvalue
- the value of property value- Returns:
- a reference to this, so the API can be used fluently
-
getSocketAddress
public SocketAddress getSocketAddress()
- Overrides:
getSocketAddress
in classSqlConnectOptions
-
getTracingPolicy
public TracingPolicy getTracingPolicy()
- Overrides:
getTracingPolicy
in classSqlConnectOptions
- Returns:
- the tracing policy
-
setTracingPolicy
public OracleConnectOptions setTracingPolicy(TracingPolicy tracingPolicy)
Description copied from class:SqlConnectOptions
Set the tracing policy for the client behavior when Vert.x has tracing enabled.- Overrides:
setTracingPolicy
in classSqlConnectOptions
- Parameters:
tracingPolicy
- the tracing policy- Returns:
- a reference to this, so the API can be used fluently
-
isSsl
public boolean isSsl()
- Returns:
- is SSL/TLS enabled?
-
setSsl
public OracleConnectOptions setSsl(boolean ssl)
Set whether SSL/TLS is enabled- Parameters:
ssl
- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
toJson
public JsonObject toJson()
- Overrides:
toJson
in classSqlConnectOptions
-
init
protected void init()
Description copied from class:SqlConnectOptions
Initialize with the default options.- Overrides:
init
in classSqlConnectOptions
-
merge
public OracleConnectOptions merge(JsonObject other)
Description copied from class:SqlConnectOptions
Returns new options created after this object and merged with theother
json config.- Overrides:
merge
in classSqlConnectOptions
- Parameters:
other
- the other JSON object- Returns:
- new options created after this object and merged with the
other
json config
-
-