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 StringDEFAULT_DATABASEstatic StringDEFAULT_HOSTstatic StringDEFAULT_PASSWORDstatic intDEFAULT_PORTstatic booleanDEFAULT_SSLstatic StringDEFAULT_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 OracleConnectOptionsaddProperty(String key, String value)Add a property for this client, which will be sent to server at the connection start.static OracleConnectOptionsfromUri(String connectionUri)Provide aOracleConnectOptionsconfigured from a connection URI.booleangetCachePreparedStatements()Get whether prepared statements cache is enabled.StringgetDatabase()Get the default database name for the connection.StringgetHost()Get the host for connecting to the server.StringgetInstanceName()StringgetPassword()Get the user password to be used for the authentication.intgetPort()Get the port for connecting to the server.intgetPreparedStatementCacheMaxSize()Get the maximum number of prepared statements that the connection will cache.Predicate<String>getPreparedStatementCacheSqlFilter()Get the predicate filtering prepared statements that the connection will cache.Map<String,String>getProperties()ServerModegetServerMode()StringgetServiceId()StringgetServiceName()SocketAddressgetSocketAddress()StringgetTnsAdmin()StringgetTnsAlias()TracingPolicygetTracingPolicy()StringgetUser()Get the user account to be used for the authentication.protected voidinit()Initialize with the default options.booleanisSsl()OracleConnectOptionsmerge(JsonObject other)Returns new options created after this object and merged with theotherjson config.OracleConnectOptionssetCachePreparedStatements(boolean cachePreparedStatements)Set whether prepared statements cache should be enabled.OracleConnectOptionssetDatabase(String database)Set the database name.OracleConnectOptionssetHost(String host)Specify the host for connecting to the server.OracleConnectOptionssetInstanceName(String instanceName)Set the Oracle instance name.OracleConnectOptionssetPassword(String password)Specify the user password to be used for the authentication.OracleConnectOptionssetPort(int port)Specify the port for connecting to the server.OracleConnectOptionssetPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)Set the maximum number of prepared statements that the connection will cache.OracleConnectOptionssetPreparedStatementCacheSqlFilter(Predicate<String> predicate)Set a predicate filtering prepared statements that the connection will cache.OracleConnectOptionssetPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)Set the maximum length of prepared statement SQL string that the connection will cache.OracleConnectOptionssetProperties(Map<String,String> properties)Set properties for this client, which will be sent to server at the connection start.OracleConnectOptionssetServerMode(ServerMode serverMode)Set the server connection mode.OracleConnectOptionssetServiceId(String serviceId)Set the Oracle service identifier (SID).OracleConnectOptionssetServiceName(String serviceName)Set the Oracle service name.OracleConnectOptionssetSsl(boolean ssl)Set whether SSL/TLS is enabledOracleConnectOptionssetTnsAdmin(String tnsAdmin)Set the path of the directory that contains thetnsnames.orafile.OracleConnectOptionssetTnsAlias(String tnsAlias)Set the name of an alias configured in thetnsnames.orafile.OracleConnectOptionssetTracingPolicy(TracingPolicy tracingPolicy)Set the tracing policy for the client behavior when Vert.x has tracing enabled.OracleConnectOptionssetUser(String user)Specify the user account to be used for the authentication.JsonObjecttoJson()static OracleConnectOptionswrap(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
optionsas Oracle specific connect options
-
fromUri
public static OracleConnectOptions fromUri(String connectionUri) throws IllegalArgumentException
Provide aOracleConnectOptionsconfigured from a connection URI.- Parameters:
connectionUri- the connection URI to configure from- Returns:
- a
OracleConnectOptionsparsed from the connection URI - Throws:
IllegalArgumentException- when theconnectionUriis 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.orafile
-
setTnsAlias
public OracleConnectOptions setTnsAlias(String tnsAlias)
Set the name of an alias configured in thetnsnames.orafile.- 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.orafile
-
setTnsAdmin
public OracleConnectOptions setTnsAdmin(String tnsAdmin)
Set the path of the directory that contains thetnsnames.orafile.- 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:SqlConnectOptionsGet the host for connecting to the server.- Overrides:
getHostin classSqlConnectOptions- Returns:
- the host
-
setHost
public OracleConnectOptions setHost(String host)
Description copied from class:SqlConnectOptionsSpecify the host for connecting to the server.- Overrides:
setHostin 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:SqlConnectOptionsGet the port for connecting to the server.- Overrides:
getPortin classSqlConnectOptions- Returns:
- the port
-
setPort
public OracleConnectOptions setPort(int port)
Description copied from class:SqlConnectOptionsSpecify the port for connecting to the server.- Overrides:
setPortin 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:SqlConnectOptionsGet the user account to be used for the authentication.- Overrides:
getUserin classSqlConnectOptions- Returns:
- the user
-
setUser
public OracleConnectOptions setUser(String user)
Description copied from class:SqlConnectOptionsSpecify the user account to be used for the authentication.- Overrides:
setUserin 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:SqlConnectOptionsGet the user password to be used for the authentication.- Overrides:
getPasswordin classSqlConnectOptions- Returns:
- the password
-
setPassword
public OracleConnectOptions setPassword(String password)
Description copied from class:SqlConnectOptionsSpecify the user password to be used for the authentication.- Overrides:
setPasswordin 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:SqlConnectOptionsGet the default database name for the connection.- Overrides:
getDatabasein 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 thedatabasevalue as service name.- Overrides:
setDatabasein 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:SqlConnectOptionsGet whether prepared statements cache is enabled.- Overrides:
getCachePreparedStatementsin classSqlConnectOptions- Returns:
- the value
-
setCachePreparedStatements
public OracleConnectOptions setCachePreparedStatements(boolean cachePreparedStatements)
Description copied from class:SqlConnectOptionsSet whether prepared statements cache should be enabled.- Overrides:
setCachePreparedStatementsin 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:SqlConnectOptionsGet the maximum number of prepared statements that the connection will cache.- Overrides:
getPreparedStatementCacheMaxSizein classSqlConnectOptions- Returns:
- the size
-
setPreparedStatementCacheMaxSize
public OracleConnectOptions setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
Description copied from class:SqlConnectOptionsSet the maximum number of prepared statements that the connection will cache.- Overrides:
setPreparedStatementCacheMaxSizein classSqlConnectOptions- Parameters:
preparedStatementCacheMaxSize- the size to set- Returns:
- a reference to this, so the API can be used fluently
-
getPreparedStatementCacheSqlFilter
public Predicate<String> getPreparedStatementCacheSqlFilter()
Description copied from class:SqlConnectOptionsGet the predicate filtering prepared statements that the connection will cache.- Overrides:
getPreparedStatementCacheSqlFilterin classSqlConnectOptions- Returns:
- the current predicate
-
setPreparedStatementCacheSqlFilter
public OracleConnectOptions setPreparedStatementCacheSqlFilter(Predicate<String> predicate)
Description copied from class:SqlConnectOptionsSet 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:
setPreparedStatementCacheSqlFilterin classSqlConnectOptions- Parameters:
predicate- the filter
-
setPreparedStatementCacheSqlLimit
public OracleConnectOptions setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
Description copied from class:SqlConnectOptionsSet the maximum length of prepared statement SQL string that the connection will cache.This is an helper setting the
SqlConnectOptions.setPreparedStatementCacheSqlFilter(Predicate).- Overrides:
setPreparedStatementCacheSqlLimitin 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:
getPropertiesin classSqlConnectOptions- Returns:
- the value of current connection properties
-
setProperties
public OracleConnectOptions setProperties(Map<String,String> properties)
Description copied from class:SqlConnectOptionsSet properties for this client, which will be sent to server at the connection start.- Overrides:
setPropertiesin 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:SqlConnectOptionsAdd a property for this client, which will be sent to server at the connection start.- Overrides:
addPropertyin 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:
getSocketAddressin classSqlConnectOptions
-
getTracingPolicy
public TracingPolicy getTracingPolicy()
- Overrides:
getTracingPolicyin classSqlConnectOptions- Returns:
- the tracing policy
-
setTracingPolicy
public OracleConnectOptions setTracingPolicy(TracingPolicy tracingPolicy)
Description copied from class:SqlConnectOptionsSet the tracing policy for the client behavior when Vert.x has tracing enabled.- Overrides:
setTracingPolicyin 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:
toJsonin classSqlConnectOptions
-
init
protected void init()
Description copied from class:SqlConnectOptionsInitialize with the default options.- Overrides:
initin classSqlConnectOptions
-
merge
public OracleConnectOptions merge(JsonObject other)
Description copied from class:SqlConnectOptionsReturns new options created after this object and merged with theotherjson config.- Overrides:
mergein classSqlConnectOptions- Parameters:
other- the other JSON object- Returns:
- new options created after this object and merged with the
otherjson config
-
-