Package oracle.pg.rdbms
Class AdbGraphClientConfiguration
- java.lang.Object
-
- oracle.pg.rdbms.AdbGraphClientConfiguration
-
public class AdbGraphClientConfiguration extends java.lang.ObjectADB Graph Client configuration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAdbGraphClientConfiguration.AdbGraphClientConfigurationBuilder
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.TimeUnitDEFAULT_REFRESH_TIME_BEFORE_TOKEN_EXPIRY_TIME_UNITDefault value forrefreshTimeBeforeTokenExpiryTimeUnit
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AdbGraphClientConfiguration.AdbGraphClientConfigurationBuilderbuilder()java.net.URIcreateBrokerBaseURI()java.net.URIcreateGraphStudioBaseURI()java.net.URIcreatePgxBaseURI()static AdbGraphClientConfigurationfromConnection(java.sql.Connection connection, java.lang.String password)Creates a configuration object given a connection and the password to the database.static AdbGraphClientConfigurationfromCredentials(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.StringgetBrokerBaseUrl()Set the broker base URL to use.java.lang.StringgetDatabase()The Autonomous Database name.java.lang.StringgetDatabaseOcid()The OCID of the Autonomous Database.java.lang.StringgetDataStudioApiVersion()The API version of the Data Studio REST endpoints to use.java.lang.StringgetEndpoint()ADB Graph endpoint URL.java.util.concurrent.ExecutorServicegetExecutorService()TheExecutorServicethis client should use for background polling threads.java.lang.StringgetGraphStudioApiVersion()The API version of the Graph Studio REST endpoints to use.java.lang.StringgetGraphStudioBaseUrl()Set the Graph Studio base URL to use.org.apache.hc.client5.http.classic.HttpClientgetHttpClient()The ApacheHttpClientobject to use for HTTP requests.longgetJobPollInterval()The time interval to use when polling the server for job updates.java.util.concurrent.TimeUnitgetJobPollIntervalTimeUnit()The time unit for thejobPollIntervaltime value.java.lang.StringgetPassword()The Database password to use for login.java.lang.StringgetPgxBaseUrl()Set the PGX base URL to use.intgetRefreshTimeBeforeTokenExpiry()The time to refresh the authentication token automatically before it expires.java.util.concurrent.TimeUnitgetRefreshTimeBeforeTokenExpiryTimeUnit()The time unit of therefreshTimeBeforeTokenExpirytime value.java.lang.StringgetTenancyOcid()The OCID of the tenancy the Autonomous Database belongs to.java.lang.StringgetUsername()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 ApacheHttpClientobject 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 therefreshTimeBeforeTokenExpiryTimeUnitconfiguration. Optional configuration. If not set, thenGraphServer.DEFAULT_TIME_BEFORE_EXPIRYwill be used.- Returns:
- the refresh time before expiry value.
-
getRefreshTimeBeforeTokenExpiryTimeUnit
public java.util.concurrent.TimeUnit getRefreshTimeBeforeTokenExpiryTimeUnit()
The time unit of therefreshTimeBeforeTokenExpirytime value. Optional configuration. If not set, thenDEFAULT_REFRESH_TIME_BEFORE_TOKEN_EXPIRY_TIME_UNITwill be used.- Returns:
- the refresh time before expiry time unit.
-
getExecutorService
public java.util.concurrent.ExecutorService getExecutorService()
TheExecutorServicethis 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
ExecutorServiceof 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 thejobPollIntervalTimeUnitconfiguration. Optional configuration. If not set, thenDEFAULT_JOB_POLL_INTERVALwill be used.- Returns:
- the job poll interval time.
-
getJobPollIntervalTimeUnit
public java.util.concurrent.TimeUnit getJobPollIntervalTimeUnit()
The time unit for thejobPollIntervaltime value. Optional configuration. If not set, thenDEFAULT_JOB_POLL_INTERVAL_TIME_UNITwill 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_VERSIONwill 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_VERSIONwill 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'
-
-