public interface Connection
extends java.lang.AutoCloseable
To create a Connection object, call
DataGrid.connect.
A program that creates a connection should explicitly call
Connection.close to reclaim its resources.
Since Version 4.10: Whenever a Connection that did not have its
Connection.close method called is garbage collected, the
native resources will be reclaimed automatically. This behavior is controlled by the
com.tibco.tibdg.autoclose System Property. If the property is not set or set to "cleanup"
(the default), the native resources will be reclaimed as if the
Connection.close method had been called. If the System Property is
set to "warn", a warning will be printed to stderr instead of doing the cleanup.
If the property is set to "inactive", this feature will not be activated.
This interface is implemented internally. Applications do not implement this interface.
| Modifier and Type | Field and Description |
|---|---|
static long |
TIBDG_CONNECTION_BINDSTRATEGY_BALANCED |
static long |
TIBDG_CONNECTION_BINDSTRATEGY_NAMED |
static long |
TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_BALANCED |
static long |
TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_RANDOM |
static long |
TIBDG_CONNECTION_BINDSTRATEGY_RANDOM |
static java.lang.String |
TIBDG_CONNECTION_HTTPS_CONNECTION_TRUST_EVERYONE
Property name to Trust any realm server; property value constant.
|
static java.lang.String |
TIBDG_CONNECTION_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_FILE
Trust a realm server if its certificate is in a trust file; property value constant.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_BOOLEAN_IMMUTABLE_ROWS
Property to specify immutability of rows returned from ResultSet/Get APIs.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_DOUBLE_CONNECT_WAIT_TIME
Property name for initial connection timeout; double.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_DOUBLE_TIMEOUT
Property name for connection timeout; double.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_LONG_BINDSTRATEGY
Property name for specifying how a client chooses a proxy to establish a connection
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_LONG_CONNECT_NUMRESPONSES
Property name to cutoff wait time using TIBDG_BINDSTRATEGY_RANDOM, TIBDG_CONNECTION_BINDSTRATEGY_BALANCED, TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_RANDOM, or TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_BALANCED
No effect for other bind strategies
After receiving this many responses, the client will stop looking for additional responses
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_LONG_OWNER_ID
Property to specify owner ID of this connection; long.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_LONG_REALM_CONNECT_RETRIES
Property name for initial realm connection retries; long.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_LONG_TRANSPORT_TYPE
Property to indicate the type of transport the client will use to connect to proxies
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_CERT
Property name for client identity certificate; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_LABEL
Property name for client label; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_PRIVATE_KEY
Property name for client certificate's private key; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_PRIVATE_KEY_PASSWORD
Property name for client certificate's private key password; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYNAMES
Property name for specifying pipe '|' delimited list of proxy names for TIBDG_CONNECTION_BINDSTRATEGY_NAMED
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYPATTERN
Property specifying a PCRE regular expression for matching proxy names for TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_RANDOM or TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_BALANCED
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_GRIDNAME
Property name for data grid name; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_ID
Property name for OAuth 2.0 client id, this client id is required
to get the OAuth 2.0 access token; string
Supply this property to
DataGrid.connect. |
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_SECRET
Property name for OAuth 2.0 client secret, this client secret is required to get
the OAuth 2.0 access token; string
Supply this property to
DataGrid.connect. |
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_SERVER_TRUST_FILE
Property name for OAuth 2.0 server specific trust file.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_SERVER_URL
Property name for OAuth 2.0 server URL.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_REALMURL
Property name for realm server url; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_SECONDARY_REALM
Property name for specifying secondary/backup realm server; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_TRUST_FILE
Property name for secure realm server trust file; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_TRUST_TYPE
Property name for secure realm server trust type; long.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_USERNAME
Property name for realm server username; string.
|
static java.lang.String |
TIBDG_CONNECTION_PROPERTY_STRING_USERPASSWORD
Property name for realm server password; string.
|
static long |
TIBDG_CONNECTION_TRANSPORT_TYPE_AUTO |
static long |
TIBDG_CONNECTION_TRANSPORT_TYPE_DTCP |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close a connection object.
|
Session |
createSession(java.util.Properties props)
Create a session object to perform operations.
|
GridMetadata |
getGridMetadata()
Retrieve the current data grid metadata in an object.
|
GridMetadata |
getGridMetadata(java.util.Properties props)
Retrieve the current data grid metadata in an object.
|
void |
interrupt()
Interrupts all outstanding requests on the connection forcing them to return an
interrupted exception (
InterruptedException). |
static final java.lang.String TIBDG_CONNECTION_PROPERTY_DOUBLE_CONNECT_WAIT_TIME
When connecting to a data grid,
supply this property to DataGrid.connect
This value sets the fixed amount of time the call will wait inside
DataGrid.connect while it collects proxy responses.
The value must be set to greater than the client-proxy roundtrip time
or the connection will fail and must be retried. Default is 0.1 seconds.
This value should generally be kept to less than 10 seconds.
For ways to reduce to reduce the binding time, refer to the documentation for Connection.TIBDG_CONNECTION_PROPERTY_LONG_BINDSTRATEGY
and related properties.
Note: this duration applies once the realm connection has been established. If the realm server
experiences disruption, up to 5 additional seconds may be required.
static final java.lang.String TIBDG_CONNECTION_PROPERTY_LONG_REALM_CONNECT_RETRIES
When connecting to a data grid, supply this property to DataGrid.connect.
This value sets the number of times the underlying TIBCO FTL client library will attempt to connect
to the Realm. The default is 5.
static final java.lang.String TIBDG_CONNECTION_PROPERTY_LONG_BINDSTRATEGY
Supply this property to DataGrid.connect.
TIBDG_CONNECTION_BINDSTRATEGY_RANDOM will choose a proxy at random from the responses received.
TIBDG_CONNECTION_BINDSTRATEGY_NAMED will choose only a proxy supplied using the property
TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYNAME
TIBDG_CONNECTION_BINDSTRATEGY_BALANCED will choose the proxy with the lowest load from the responses received.
TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_RANDOM will randomly select a proxy that responds with a name matching the pattern supplied using the property
TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYPATTERN
TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_BALANCED will select a proxy with the lowest load that responds with a name matching the pattern supplied using the property
TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYPATTERN
static final long TIBDG_CONNECTION_BINDSTRATEGY_RANDOM
static final long TIBDG_CONNECTION_BINDSTRATEGY_NAMED
static final long TIBDG_CONNECTION_BINDSTRATEGY_BALANCED
static final long TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_RANDOM
static final long TIBDG_CONNECTION_BINDSTRATEGY_PATTERN_BALANCED
static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYNAMES
A client using TIBDG_CONNECTION_BINDSTRATEGY_NAMED will not bind to a proxy not in the list Note: existing proxy names utilizing this reserved character are not eligible
static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYPATTERN
A PCRE2 regular expression for matching proxy names. E.g.
zone1.*would match proxies named zone1.p1 and zone1.p2 but not proxies zone2.p1 or zone2.p2. Wrap the expression with start / end anchors to match the entire proxy name only, e.g.
^p1$to match proxy p1 only, or
^(p1|p2|p3)$to match proxy names p1, p2, or p3 but not proxy name p10.
static final java.lang.String TIBDG_CONNECTION_PROPERTY_LONG_CONNECT_NUMRESPONSES
static final java.lang.String TIBDG_CONNECTION_PROPERTY_BOOLEAN_IMMUTABLE_ROWS
Supply this property to DataGrid.connect.
If true, rows returned cannot be modified.
If unspecified, the default value is false.
static final java.lang.String TIBDG_CONNECTION_PROPERTY_LONG_TRANSPORT_TYPE
Supply this property to DataGrid.connect.
The type of transport used by the client when this property is not provided is determined by the
grid configuration.
TIBDG_CONNECTION_TRANSPORT_TYPE_DTCP will enable the client to connect to proxy processes via DTCP
TIBDG_CONNECTION_TRANSPORT_TYPE_AUTO will enable the client to connect to proxies via an Auto Transport
static final long TIBDG_CONNECTION_TRANSPORT_TYPE_DTCP
static final long TIBDG_CONNECTION_TRANSPORT_TYPE_AUTO
static final java.lang.String TIBDG_CONNECTION_PROPERTY_DOUBLE_TIMEOUT
When connecting to a data grid,
supply this property to DataGrid.connect
Its value determines
how long all calls, other than DataGrid.connect, block waiting for the data grid to respond.
Default is 5.0 seconds.
static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_USERNAME
Supply this property to DataGrid.connect if using a secure realm server.
static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_USERPASSWORD
DataGrid.connect if using a secure realm server.static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_SECONDARY_REALM
DataGrid.connect if using a secondary/backup realm serverstatic final java.lang.String TIBDG_CONNECTION_HTTPS_CONNECTION_TRUST_EVERYONE
Connection.TIBDG_CONNECTION_PROPERTY_STRING_TRUST_TYPE
in the method DataGrid.connect.
The client trusts any realm server without
verifying trust in the server's certificate.
Do not use this value except for
convenience in development and testing.
It is not secure.static final java.lang.String TIBDG_CONNECTION_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_FILE
Connection.TIBDG_CONNECTION_PROPERTY_STRING_TRUST_TYPE
in the method DataGrid.connect.
The client trusts the realm server based on the
trust file
created by the realm server
and distributed by the administrator.
Specify the file path of the trust file
in the property
Connection.TIBDG_CONNECTION_PROPERTY_STRING_TRUST_FILEstatic final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_TRUST_TYPE
DataGrid.connect.
Its value determines
trust in the realm server's certificate.
Connection.TIBDG_CONNECTION_HTTPS_CONNECTION_TRUST_EVERYONE
Connection.TIBDG_CONNECTION_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_FILEstatic final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_TRUST_FILE
DataGrid.connect.
If the grid connect call specifies the trust type as
Connection.TIBDG_CONNECTION_HTTPS_CONNECTION_USE_SPECIFIED_TRUST_FILE
use this property to indicate the location of the trust file.static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_CERT
DataGrid.connect.
As an alternative to user/password, client applications may use a
TLS certificate to authenticate to the grid. A TLS connection is
required. Applications must also specify the private key alongside
the certificate.
The value of this property must be a PEM file containing the certificate.
The PEM file may also include intermediate certificates.
Administrators are responsible for distributing client certificates
to applications. The client's auth roles should be encoded as a comma-
separated list in the common name (CN) field of the client certificate.
Connection.TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_PRIVATE_KEY
Connection.TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_PRIVATE_KEY_PASSWORDstatic final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_PRIVATE_KEY
DataGrid.connect.
When using a TLS certificate to authenticate to the grid, the
corresponding private key and passphrase must be specified as well.
The value of this property must be a PEM file containing the private key.
Connection.TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_CERT
Connection.TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_CERTstatic final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_PRIVATE_KEY_PASSWORD
DataGrid.connect.
When using a TLS certificate to authenticate to the grid, the
corresponding private key and passphrase must be specified as well.
The value of this property must be a passphrase used to decrypt the private key.
Connection.TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_CERT
Connection.TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_CERTstatic final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_SERVER_URL
DataGrid.connect.
When this parameter is specified along with TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_SECRET
and TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_ID, application will connect to the
OAuth 2.0 server specified to get the OAuth 2.0 access token prior to connecting to the grid.
If this url scheme starts with https:// then either the trust file for the OAuth 2.0 server must be
available from the system trust store or specify TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_SERVER_TRUST_FILE
;stringstatic final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_ID
DataGrid.connect.
When this parameter is specified along with TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_SERVER_URL and
TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_SECRET, application will connect to
the OAuth 2.0 server specified to get the OAuth 2.0 access token prior to connecting
to the grid.static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_SECRET
DataGrid.connect.
When this parameter is specified along with TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_SERVER_URL and
TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_CLIENT_ID, application will connect to
the OAuth 2.0 server specified to get the OAuth 2.0 access token prior to connecting
to the grid.static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_OAUTH2_SERVER_TRUST_FILE
DataGrid.connect.
When the connection to the OAuth 2.0 server is secure, specify this trust file, so the client knows
who to trust. Can be omitted if the trust file is available from the system trust store.static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_GRIDNAME
static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_REALMURL
static final java.lang.String TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_LABEL
DataGrid.connect
calls of every application program. Administrators can use client
labels in monitoring and management to recognize and distinguish
among processes.static final java.lang.String TIBDG_CONNECTION_PROPERTY_LONG_OWNER_ID
Session createSession(java.util.Properties props) throws DataGridException
A session object provides the context for a thread of operations involving grid resources.
The session object is NOT thread-safe. Do not invoke multiple operations on a single session using more than one thread. Behavior is not defined if this happens.
props - Optional, null to omit
DataGridException - in case of failuresGridMetadata getGridMetadata(java.util.Properties props) throws DataGridException
A grid metadata object contains information about the data grid including name, version, and additional metadata about tables.
The information in a grid metadata object will be current when the request returns and will not be updated after that point.
A grid metadata object must be closed to release internal state and no further access should be made to the grid metadata object or any nested objects after it has been closed.
props - Optional, null to omitDataGridException - in case of failuresGridMetadata getGridMetadata() throws DataGridException
A grid metadata object contains information about the data grid including name, version, and additional metadata about tables.
The information in a grid metadata object will be current when the request returns and will not be updated after that point.
A grid metadata object must be closed to release internal state and no further access should be made to the grid metadata object or any nested objects after it has been closed.
DataGridException - in case of failuresvoid close()
throws DataGridException
Releases all resources associated with this connection object.
Note that all resources created or opened by this object are invalidated by this call. These resources should be destroyed or closed before closing this connection.
close in interface java.lang.AutoCloseableDataGridException - in case of failuresvoid interrupt()
throws DataGridException
InterruptedException).DataGridException - in case of failures