public class PgConnectOptions extends SqlConnectOptions
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DATABASE |
static String |
DEFAULT_HOST |
static String |
DEFAULT_PASSWORD |
static int |
DEFAULT_PIPELINING_LIMIT |
static int |
DEFAULT_PORT |
static Map<String,String> |
DEFAULT_PROPERTIES |
static SslMode |
DEFAULT_SSLMODE |
static String |
DEFAULT_USER |
DEFAULT_CACHE_PREPARED_STATEMENTS, DEFAULT_PREPARED_STATEMENT_CACHE_FILTER, DEFAULT_PREPARED_STATEMENT_CACHE_MAX_SIZE, DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMITDEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVALDEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALLDEFAULT_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_SSL_HANDSHAKE_TIMEOUT, DEFAULT_SSL_HANDSHAKE_TIMEOUT_TIME_UNIT, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_USE_ALPNDEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_REUSE_PORT, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS| Constructor and Description |
|---|
PgConnectOptions() |
PgConnectOptions(JsonObject json) |
PgConnectOptions(PgConnectOptions other) |
PgConnectOptions(SqlConnectOptions other) |
| Modifier and Type | Method and Description |
|---|---|
PgConnectOptions |
addCrlPath(String crlPath)
Add a CRL path
|
PgConnectOptions |
addCrlValue(Buffer crlValue)
Add a CRL value
|
PgConnectOptions |
addEnabledCipherSuite(String suite)
Add an enabled cipher suite, appended to the ordered suites.
|
PgConnectOptions |
addEnabledSecureTransportProtocol(String protocol)
Add an enabled SSL/TLS protocols, appended to the ordered protocols.
|
PgConnectOptions |
addProperty(String key,
String value)
Add a property for this client, which will be sent to server at the connection start.
|
boolean |
equals(Object o) |
static PgConnectOptions |
fromEnv()
Provide a
PgConnectOptions configured with environment variables, if the environment variable
is not set, then a default value will take precedence over this. |
static PgConnectOptions |
fromUri(String connectionUri)
Provide a
PgConnectOptions configured from a connection URI. |
int |
getPipeliningLimit() |
SocketAddress |
getSocketAddress() |
SslMode |
getSslMode() |
int |
hashCode() |
protected void |
init()
Initialize with the default options.
|
boolean |
isUsingDomainSocket() |
PgConnectOptions |
setCachePreparedStatements(boolean cachePreparedStatements)
Set whether prepared statements cache should be enabled.
|
PgConnectOptions |
setConnectTimeout(int connectTimeout)
Set the connect timeout
|
PgConnectOptions |
setDatabase(String database)
Specify the default database for the connection.
|
PgConnectOptions |
setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
Sets the list of enabled SSL/TLS protocols.
|
PgConnectOptions |
setHost(String host)
Specify the host for connecting to the server.
|
PgConnectOptions |
setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm)
Set the hostname verification algorithm interval
To disable hostname verification, set hostnameVerificationAlgorithm to an empty String
|
PgConnectOptions |
setIdleTimeout(int idleTimeout)
Set the idle timeout, default time unit is seconds.
|
PgConnectOptions |
setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
Set the idle timeout unit.
|
PgConnectOptions |
setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions) |
PgConnectOptions |
setKeyCertOptions(KeyCertOptions options)
Set the key/cert options.
|
PgConnectOptions |
setKeyStoreOptions(JksOptions options)
Set the key/cert options in jks format, aka Java keystore.
|
PgConnectOptions |
setLocalAddress(String localAddress)
Set the local interface to bind for network connections.
|
PgConnectOptions |
setLogActivity(boolean logEnabled)
Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.
|
PgConnectOptions |
setMetricsName(String metricsName)
Set the metrics name identifying the reported metrics, useful for grouping metrics
with the same name.
|
PgConnectOptions |
setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions) |
PgConnectOptions |
setPassword(String password)
Specify the user password to be used for the authentication.
|
PgConnectOptions |
setPemKeyCertOptions(PemKeyCertOptions options)
Set the key/cert store options in pem format.
|
PgConnectOptions |
setPemTrustOptions(PemTrustOptions options)
Set the trust options in pem format
|
PgConnectOptions |
setPfxKeyCertOptions(PfxOptions options)
Set the key/cert options in pfx format.
|
PgConnectOptions |
setPfxTrustOptions(PfxOptions options)
Set the trust options in pfx format
|
PgConnectOptions |
setPipeliningLimit(int pipeliningLimit) |
PgConnectOptions |
setPort(int port)
Specify the port for connecting to the server.
|
PgConnectOptions |
setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
Set the maximum number of prepared statements that the connection will cache.
|
PgConnectOptions |
setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
Set a predicate filtering prepared statements that the connection will cache.
|
PgConnectOptions |
setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
Set the maximum length of prepared statement SQL string that the connection will cache.
|
PgConnectOptions |
setProperties(Map<String,String> properties)
Set properties for this client, which will be sent to server at the connection start.
|
PgConnectOptions |
setProxyOptions(ProxyOptions proxyOptions)
Set proxy options for connections via CONNECT proxy (e.g.
|
PgConnectOptions |
setReceiveBufferSize(int receiveBufferSize)
Set the TCP receive buffer size
|
PgConnectOptions |
setReconnectAttempts(int attempts)
Set the value of reconnect attempts
|
PgConnectOptions |
setReconnectInterval(long interval)
Set the reconnect interval
|
PgConnectOptions |
setReuseAddress(boolean reuseAddress)
Set the value of reuse address
|
PgConnectOptions |
setReusePort(boolean reusePort)
Set the value of reuse port.
|
PgConnectOptions |
setSendBufferSize(int sendBufferSize)
Set the TCP send buffer size
|
PgConnectOptions |
setSoLinger(int soLinger)
Set whether SO_linger keep alive is enabled
|
PgConnectOptions |
setSsl(boolean ssl)
Set whether SSL/TLS is enabled
|
PgConnectOptions |
setSslEngineOptions(SSLEngineOptions sslEngineOptions)
Set to use SSL engine implementation to use.
|
PgConnectOptions |
setSslHandshakeTimeout(long sslHandshakeTimeout)
Set the SSL handshake timeout, default time unit is seconds.
|
PgConnectOptions |
setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
Set the SSL handshake timeout unit.
|
PgConnectOptions |
setSslMode(SslMode sslmode)
Set
SslMode for the client, this option can be used to provide different levels of secure protection. |
PgConnectOptions |
setTcpCork(boolean tcpCork)
Enable the
TCP_CORK option - only with linux native transport. |
PgConnectOptions |
setTcpFastOpen(boolean tcpFastOpen)
Enable the
TCP_FASTOPEN option - only with linux native transport. |
PgConnectOptions |
setTcpKeepAlive(boolean tcpKeepAlive)
Set whether TCP keep alive is enabled
|
PgConnectOptions |
setTcpNoDelay(boolean tcpNoDelay)
Set whether TCP no delay is enabled
|
PgConnectOptions |
setTcpQuickAck(boolean tcpQuickAck)
Enable the
TCP_QUICKACK option - only with linux native transport. |
PgConnectOptions |
setTracingPolicy(TracingPolicy tracingPolicy)
Set the tracing policy for the client behavior when Vert.x has tracing enabled.
|
PgConnectOptions |
setTrafficClass(int trafficClass)
Set the value of traffic class
|
PgConnectOptions |
setTrustAll(boolean trustAll)
Set whether all server certificates should be trusted
|
PgConnectOptions |
setTrustOptions(TrustOptions options)
Set the trust options.
|
PgConnectOptions |
setTrustStoreOptions(JksOptions options)
Set the trust options in jks format, aka Java truststore
|
PgConnectOptions |
setUseAlpn(boolean useAlpn)
Set the ALPN usage.
|
PgConnectOptions |
setUser(String user)
Specify the user account to be used for the authentication.
|
JsonObject |
toJson()
Convert to JSON
|
getCachePreparedStatements, getDatabase, getHost, getPassword, getPort, getPreparedStatementCacheMaxSize, getPreparedStatementCacheSqlFilter, getProperties, getTracingPolicy, getUsergetHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, removeEnabledSecureTransportProtocolgetConnectTimeout, getLocalAddress, getMetricsName, getProxyOptions, isTrustAllgetCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getTrustOptions, getTrustStoreOptions, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpngetLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePortpublic static final String DEFAULT_HOST
public static int DEFAULT_PORT
public static final String DEFAULT_DATABASE
public static final String DEFAULT_USER
public static final String DEFAULT_PASSWORD
public static final int DEFAULT_PIPELINING_LIMIT
public static final SslMode DEFAULT_SSLMODE
public PgConnectOptions()
public PgConnectOptions(JsonObject json)
public PgConnectOptions(SqlConnectOptions other)
public PgConnectOptions(PgConnectOptions other)
public static PgConnectOptions fromUri(String connectionUri) throws IllegalArgumentException
PgConnectOptions configured from a connection URI.connectionUri - the connection URI to configure fromPgConnectOptions parsed from the connection URIIllegalArgumentException - when the connectionUri is in an invalid formatpublic static PgConnectOptions fromEnv()
PgConnectOptions configured with environment variables, if the environment variable
is not set, then a default value will take precedence over this.public PgConnectOptions setHost(String host)
SqlConnectOptionssetHost in class SqlConnectOptionshost - the host to specifypublic PgConnectOptions setPort(int port)
SqlConnectOptionssetPort in class SqlConnectOptionsport - the port to specifypublic PgConnectOptions setUser(String user)
SqlConnectOptionssetUser in class SqlConnectOptionsuser - the user to specifypublic PgConnectOptions setPassword(String password)
SqlConnectOptionssetPassword in class SqlConnectOptionspassword - the password to specifypublic PgConnectOptions setDatabase(String database)
SqlConnectOptionssetDatabase in class SqlConnectOptionsdatabase - the database name to specifypublic int getPipeliningLimit()
public PgConnectOptions setPipeliningLimit(int pipeliningLimit)
public PgConnectOptions setCachePreparedStatements(boolean cachePreparedStatements)
SqlConnectOptionssetCachePreparedStatements in class SqlConnectOptionscachePreparedStatements - true if cache should be enabledpublic PgConnectOptions setPreparedStatementCacheMaxSize(int preparedStatementCacheMaxSize)
SqlConnectOptionssetPreparedStatementCacheMaxSize in class SqlConnectOptionspreparedStatementCacheMaxSize - the size to setpublic PgConnectOptions setPreparedStatementCacheSqlFilter(java.util.function.Predicate<String> predicate)
SqlConnectOptions The default predicate accepts predicate having query length < SqlConnectOptions.DEFAULT_PREPARED_STATEMENT_CACHE_SQL_LIMIT
setPreparedStatementCacheSqlFilter in class SqlConnectOptionspredicate - the filterpublic PgConnectOptions setPreparedStatementCacheSqlLimit(int preparedStatementCacheSqlLimit)
SqlConnectOptions This is an helper setting the SqlConnectOptions.setPreparedStatementCacheSqlFilter(Predicate).
setPreparedStatementCacheSqlLimit in class SqlConnectOptionspreparedStatementCacheSqlLimit - the maximum length limit of SQL string to setpublic PgConnectOptions setProperties(Map<String,String> properties)
SqlConnectOptionssetProperties in class SqlConnectOptionsproperties - the value of properties to specifypublic PgConnectOptions addProperty(String key, String value)
SqlConnectOptionsaddProperty in class SqlConnectOptionskey - the value of property keyvalue - the value of property valuepublic SslMode getSslMode()
public PgConnectOptions setSslMode(SslMode sslmode)
SslMode for the client, this option can be used to provide different levels of secure protection.sslmode - the value of sslmodepublic PgConnectOptions setSendBufferSize(int sendBufferSize)
NetworkOptionssetSendBufferSize in class NetClientOptionssendBufferSize - the buffers size, in bytespublic PgConnectOptions setReceiveBufferSize(int receiveBufferSize)
NetworkOptionssetReceiveBufferSize in class NetClientOptionsreceiveBufferSize - the buffers size, in bytespublic PgConnectOptions setReuseAddress(boolean reuseAddress)
NetworkOptionssetReuseAddress in class NetClientOptionsreuseAddress - the value of reuse addresspublic PgConnectOptions setTrafficClass(int trafficClass)
NetworkOptionssetTrafficClass in class NetClientOptionstrafficClass - the value of traffic classpublic PgConnectOptions setTcpNoDelay(boolean tcpNoDelay)
TCPSSLOptionssetTcpNoDelay in class NetClientOptionstcpNoDelay - true if TCP no delay is enabled (Nagle disabled)public PgConnectOptions setTcpKeepAlive(boolean tcpKeepAlive)
TCPSSLOptionssetTcpKeepAlive in class NetClientOptionstcpKeepAlive - true if TCP keep alive is enabledpublic PgConnectOptions setSoLinger(int soLinger)
TCPSSLOptionssetSoLinger in class NetClientOptionssoLinger - true if SO_linger is enabledpublic PgConnectOptions setIdleTimeout(int idleTimeout)
TCPSSLOptionsTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)setIdleTimeout in class NetClientOptionsidleTimeout - the timeout, in secondspublic PgConnectOptions setIdleTimeoutUnit(TimeUnit idleTimeoutUnit)
TCPSSLOptionssetIdleTimeoutUnit in class NetClientOptionsidleTimeoutUnit - specify time unit.public PgConnectOptions setSsl(boolean ssl)
TCPSSLOptionssetSsl in class NetClientOptionsssl - true if enabledpublic PgConnectOptions setKeyCertOptions(KeyCertOptions options)
TCPSSLOptionssetKeyCertOptions in class NetClientOptionsoptions - the key store optionspublic PgConnectOptions setKeyStoreOptions(JksOptions options)
TCPSSLOptionssetKeyStoreOptions in class NetClientOptionsoptions - the key store in jks formatpublic PgConnectOptions setPfxKeyCertOptions(PfxOptions options)
TCPSSLOptionssetPfxKeyCertOptions in class NetClientOptionsoptions - the key cert options in pfx formatpublic PgConnectOptions setPemKeyCertOptions(PemKeyCertOptions options)
TCPSSLOptionssetPemKeyCertOptions in class NetClientOptionsoptions - the options in pem formatpublic PgConnectOptions setTrustOptions(TrustOptions options)
TCPSSLOptionssetTrustOptions in class NetClientOptionsoptions - the trust optionspublic PgConnectOptions setTrustStoreOptions(JksOptions options)
TCPSSLOptionssetTrustStoreOptions in class NetClientOptionsoptions - the trust options in jks formatpublic PgConnectOptions setPemTrustOptions(PemTrustOptions options)
TCPSSLOptionssetPemTrustOptions in class NetClientOptionsoptions - the trust options in pem formatpublic PgConnectOptions setPfxTrustOptions(PfxOptions options)
TCPSSLOptionssetPfxTrustOptions in class NetClientOptionsoptions - the trust options in pfx formatpublic PgConnectOptions addEnabledCipherSuite(String suite)
TCPSSLOptionsaddEnabledCipherSuite in class NetClientOptionssuite - the suitepublic PgConnectOptions addEnabledSecureTransportProtocol(String protocol)
TCPSSLOptionsaddEnabledSecureTransportProtocol in class NetClientOptionsprotocol - the SSL/TLS protocol to enablepublic PgConnectOptions addCrlPath(String crlPath) throws NullPointerException
TCPSSLOptionsaddCrlPath in class NetClientOptionscrlPath - the pathNullPointerExceptionpublic PgConnectOptions addCrlValue(Buffer crlValue) throws NullPointerException
TCPSSLOptionsaddCrlValue in class NetClientOptionscrlValue - the valueNullPointerExceptionpublic PgConnectOptions setTrustAll(boolean trustAll)
ClientOptionsBasesetTrustAll in class NetClientOptionstrustAll - true if all should be trustedpublic PgConnectOptions setConnectTimeout(int connectTimeout)
ClientOptionsBasesetConnectTimeout in class NetClientOptionsconnectTimeout - connect timeout, in mspublic PgConnectOptions setMetricsName(String metricsName)
ClientOptionsBasesetMetricsName in class NetClientOptionsmetricsName - the metrics namepublic PgConnectOptions setReconnectAttempts(int attempts)
NetClientOptionssetReconnectAttempts in class NetClientOptionsattempts - the maximum number of reconnect attemptspublic PgConnectOptions setHostnameVerificationAlgorithm(String hostnameVerificationAlgorithm)
NetClientOptionssetHostnameVerificationAlgorithm in class NetClientOptionshostnameVerificationAlgorithm - should be HTTPS, LDAPS or an empty Stringpublic PgConnectOptions setLogActivity(boolean logEnabled)
NetworkOptionssetLogActivity in class NetClientOptionslogEnabled - true for logging the network activitypublic PgConnectOptions setReconnectInterval(long interval)
NetClientOptionssetReconnectInterval in class NetClientOptionsinterval - the reconnect interval in mspublic PgConnectOptions setProxyOptions(ProxyOptions proxyOptions)
ClientOptionsBasesetProxyOptions in class NetClientOptionsproxyOptions - proxy options objectpublic PgConnectOptions setLocalAddress(String localAddress)
ClientOptionsBasesetLocalAddress in class NetClientOptionslocalAddress - the local addresspublic PgConnectOptions setUseAlpn(boolean useAlpn)
TCPSSLOptionssetUseAlpn in class NetClientOptionsuseAlpn - true when Application-Layer Protocol Negotiation should be usedpublic PgConnectOptions setSslEngineOptions(SSLEngineOptions sslEngineOptions)
TCPSSLOptionssetSslEngineOptions in class NetClientOptionssslEngineOptions - the ssl engine to usepublic PgConnectOptions setJdkSslEngineOptions(JdkSSLEngineOptions sslEngineOptions)
setJdkSslEngineOptions in class NetClientOptionspublic PgConnectOptions setOpenSslEngineOptions(OpenSSLEngineOptions sslEngineOptions)
setOpenSslEngineOptions in class NetClientOptionspublic PgConnectOptions setReusePort(boolean reusePort)
NetworkOptionssetReusePort in class NetClientOptionsreusePort - the value of reuse portpublic PgConnectOptions setTcpFastOpen(boolean tcpFastOpen)
TCPSSLOptionsTCP_FASTOPEN option - only with linux native transport.setTcpFastOpen in class NetClientOptionstcpFastOpen - the fast open valuepublic PgConnectOptions setTcpCork(boolean tcpCork)
TCPSSLOptionsTCP_CORK option - only with linux native transport.setTcpCork in class NetClientOptionstcpCork - the cork valuepublic PgConnectOptions setTcpQuickAck(boolean tcpQuickAck)
TCPSSLOptionsTCP_QUICKACK option - only with linux native transport.setTcpQuickAck in class NetClientOptionstcpQuickAck - the quick ack valuepublic PgConnectOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols)
TCPSSLOptionssetEnabledSecureTransportProtocols in class NetClientOptionsenabledSecureTransportProtocols - the SSL/TLS protocols to enablepublic PgConnectOptions setSslHandshakeTimeout(long sslHandshakeTimeout)
TCPSSLOptionssetSslHandshakeTimeout in class NetClientOptionssslHandshakeTimeout - the SSL handshake timeout to set, in millisecondspublic PgConnectOptions setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit)
TCPSSLOptionssetSslHandshakeTimeoutUnit in class NetClientOptionssslHandshakeTimeoutUnit - specify time unit.public PgConnectOptions setTracingPolicy(TracingPolicy tracingPolicy)
SqlConnectOptionssetTracingPolicy in class SqlConnectOptionstracingPolicy - the tracing policyprotected void init()
init in class SqlConnectOptionspublic JsonObject toJson()
ClientOptionsBasetoJson in class SqlConnectOptionspublic SocketAddress getSocketAddress()
getSocketAddress in class SqlConnectOptionspublic boolean isUsingDomainSocket()
Copyright © 2021 Eclipse. All rights reserved.