Package oracle.pg.rdbms
Class AdbGraphClientConfiguration
- java.lang.Object
-
- oracle.pg.rdbms.AdbGraphClientConfiguration
-
public class AdbGraphClientConfiguration extends java.lang.Object
ADB Graph Client configuration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AdbGraphClientConfiguration.AdbGraphClientConfigurationBuilder
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.TimeUnit
DEFAULT_REFRESH_TIME_BEFORE_TOKEN_EXPIRY_TIME_UNIT
Default value forrefreshTimeBeforeTokenExpiryTimeUnit
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AdbGraphClientConfiguration.AdbGraphClientConfigurationBuilder
builder()
java.net.URI
createBrokerBaseURI()
java.net.URI
createGraphStudioBaseURI()
java.net.URI
createPgxBaseURI()
static AdbGraphClientConfiguration
fromConnection(java.sql.Connection connection, java.lang.String password)
Creates a configuration object given a connection and the password to the database.static AdbGraphClientConfiguration
fromCredentials(java.lang.String jdbcUrl, java.lang.String username, java.lang.String password)
Creates a configuration object given the JDBC URL, username and password to the database.java.lang.String
getBrokerBaseUrl()
Set the broker base URL to use.java.lang.String
getDatabase()
The Autonomous Database name.java.lang.String
getDatabaseOcid()
The OCID of the Autonomous Database.java.lang.String
getDataStudioApiVersion()
The API version of the Data Studio REST endpoints to use.java.lang.String
getEndpoint()
ADB Graph endpoint URL.java.util.concurrent.ExecutorService
getExecutorService()
TheExecutorService
this client should use for background polling threads.java.lang.String
getGraphStudioApiVersion()
The API version of the Graph Studio REST endpoints to use.java.lang.String
getGraphStudioBaseUrl()
Set the Graph Studio base URL to use.org.apache.hc.client5.http.classic.HttpClient
getHttpClient()
The ApacheHttpClient
object to use for HTTP requests.long
getJobPollInterval()
The time interval to use when polling the server for job updates.java.util.concurrent.TimeUnit
getJobPollIntervalTimeUnit()
The time unit for thejobPollInterval
time value.java.lang.String
getPassword()
The Database password to use for login.java.lang.String
getPgxBaseUrl()
Set the PGX base URL to use.int
getRefreshTimeBeforeTokenExpiry()
The time to refresh the authentication token automatically before it expires.java.util.concurrent.TimeUnit
getRefreshTimeBeforeTokenExpiryTimeUnit()
The time unit of therefreshTimeBeforeTokenExpiry
time value.java.lang.String
getTenancyOcid()
The OCID of the tenancy the Autonomous Database belongs to.java.lang.String
getUsername()
The Database username to use for login.
-
-
-
Field Detail
-
DEFAULT_REFRESH_TIME_BEFORE_TOKEN_EXPIRY_TIME_UNIT
public static final java.util.concurrent.TimeUnit DEFAULT_REFRESH_TIME_BEFORE_TOKEN_EXPIRY_TIME_UNIT
Default value forrefreshTimeBeforeTokenExpiryTimeUnit
-
-
Method Detail
-
createBrokerBaseURI
public java.net.URI createBrokerBaseURI()
-
createPgxBaseURI
public java.net.URI createPgxBaseURI()
-
createGraphStudioBaseURI
public java.net.URI createGraphStudioBaseURI()
-
fromConnection
public static AdbGraphClientConfiguration fromConnection(java.sql.Connection connection, java.lang.String password)
Creates a configuration object given a connection and the password to the database.To use this API, the user must execute a GRANT statement for selection on the V$PDBS table for the GRAPH_DEVELOPER role.
- Parameters:
connection
- The connection to the database.password
- The password of the database.- Returns:
- The configuration object created from the connection.
-
fromCredentials
public static AdbGraphClientConfiguration fromCredentials(java.lang.String jdbcUrl, java.lang.String username, java.lang.String password)
Creates a configuration object given the JDBC URL, username and password to the database.To use this API, the user must execute a GRANT statement for selection on the V$PDBS table for the GRAPH_DEVELOPER role.
- Parameters:
jdbcUrl
- The JDBC URL of the database.username
- The username of the database.password
- The password of the database.- Returns:
- The configuration object created from the connection.
-
builder
public static AdbGraphClientConfiguration.AdbGraphClientConfigurationBuilder builder()
-
getEndpoint
public java.lang.String getEndpoint()
ADB Graph endpoint URL. Can be obtained from the details page of the Autonomous Database in the OCI console. Mandatory configuration.- Returns:
- the endpoint.
-
getDatabase
public java.lang.String getDatabase()
The Autonomous Database name. Note: this is *not* the display name, but the actual database name. Can be obtained from the details page of the Autonomous Database in the OCI console.- Returns:
- the tenant name.
-
getUsername
public java.lang.String getUsername()
The Database username to use for login. Mandatory configuration.- Returns:
- the database username.
-
getPassword
public java.lang.String getPassword()
The Database password to use for login. Mandatory configuration.- Returns:
- the database password.
-
getTenancyOcid
public java.lang.String getTenancyOcid()
The OCID of the tenancy the Autonomous Database belongs to. Can be obtained from the tenancy details page in the OCI console. Mandatory configuration.- Returns:
- the database OCID.
-
getDatabaseOcid
public java.lang.String getDatabaseOcid()
The OCID of the Autonomous Database. Can be obtained from the details page of the Autonomous Database in the OCI console. Mandatory configuration.- Returns:
- the database OCID.
-
getHttpClient
public org.apache.hc.client5.http.classic.HttpClient getHttpClient()
The ApacheHttpClient
object to use for HTTP requests. Optional configuration. If not set, thenHttpClients.createDefault()
will be used.- Returns:
- the HTTP client
-
getRefreshTimeBeforeTokenExpiry
public int getRefreshTimeBeforeTokenExpiry()
The time to refresh the authentication token automatically before it expires. The unit of this time value can be specified via therefreshTimeBeforeTokenExpiryTimeUnit
configuration. Optional configuration. If not set, thenGraphServer.DEFAULT_TIME_BEFORE_EXPIRY
will be used.- Returns:
- the refresh time before expiry value.
-
getRefreshTimeBeforeTokenExpiryTimeUnit
public java.util.concurrent.TimeUnit getRefreshTimeBeforeTokenExpiryTimeUnit()
The time unit of therefreshTimeBeforeTokenExpiry
time value. Optional configuration. If not set, thenDEFAULT_REFRESH_TIME_BEFORE_TOKEN_EXPIRY_TIME_UNIT
will be used.- Returns:
- the refresh time before expiry time unit.
-
getExecutorService
public java.util.concurrent.ExecutorService getExecutorService()
TheExecutorService
this client should use for background polling threads. Optional configuration. If not set, thenExecutors.newFixedThreadPool(int)
will be used with the number of threads equalingRuntime.availableProcessors()
.- Returns:
- the
ExecutorService
of this configuration.
-
getJobPollInterval
public long getJobPollInterval()
The time interval to use when polling the server for job updates. The unit of this time value can be specified via thejobPollIntervalTimeUnit
configuration. Optional configuration. If not set, thenDEFAULT_JOB_POLL_INTERVAL
will be used.- Returns:
- the job poll interval time.
-
getJobPollIntervalTimeUnit
public java.util.concurrent.TimeUnit getJobPollIntervalTimeUnit()
The time unit for thejobPollInterval
time value. Optional configuration. If not set, thenDEFAULT_JOB_POLL_INTERVAL_TIME_UNIT
will be used.- Returns:
- the job poll interval time unit.
-
getGraphStudioApiVersion
public java.lang.String getGraphStudioApiVersion()
The API version of the Graph Studio REST endpoints to use. Optional configuration. If not set, thenDEFAULT_GRAPH_STUDIO_API_VERSION
will be used.- Returns:
- the graph studio API version.
-
getDataStudioApiVersion
public java.lang.String getDataStudioApiVersion()
The API version of the Data Studio REST endpoints to use. Optional configuration. If not set, thenDEFAULT_DATA_STUDIO_API_VERSION
will be used.- Returns:
- the data studio API version.
-
getBrokerBaseUrl
public java.lang.String getBrokerBaseUrl()
Set the broker base URL to use. If not set, broker URL will be derived fromgetEndpoint()
. URL is expected to end with '/broker/pdbcs'
-
getPgxBaseUrl
public java.lang.String getPgxBaseUrl()
Set the PGX base URL to use. If not set, PGX URL will be derived fromgetEndpoint()
. URL is expected to end with '/graph/pgx'
-
getGraphStudioBaseUrl
public java.lang.String getGraphStudioBaseUrl()
Set the Graph Studio base URL to use. If not set, Graph Studio URL will be derived fromgetEndpoint()
. URL is expected to end with '/graphstudio'
-
-