Class AdbGraphClientConfiguration


  • public class AdbGraphClientConfiguration
    extends java.lang.Object
    ADB Graph Client configuration
    • 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
    • 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.
      • 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 Apache HttpClient object to use for HTTP requests. Optional configuration. If not set, then HttpClients.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 the refreshTimeBeforeTokenExpiryTimeUnit configuration. Optional configuration. If not set, then GraphServer.DEFAULT_TIME_BEFORE_EXPIRY will be used.
        Returns:
        the refresh time before expiry value.
      • getExecutorService

        public java.util.concurrent.ExecutorService getExecutorService()
        The ExecutorService this client should use for background polling threads. Optional configuration. If not set, then Executors.newFixedThreadPool(int) will be used with the number of threads equaling Runtime.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 the jobPollIntervalTimeUnit configuration. Optional configuration. If not set, then DEFAULT_JOB_POLL_INTERVAL will be used.
        Returns:
        the job poll interval time.
      • getJobPollIntervalTimeUnit

        public java.util.concurrent.TimeUnit getJobPollIntervalTimeUnit()
        The time unit for the jobPollInterval time value. Optional configuration. If not set, then DEFAULT_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, then DEFAULT_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, then DEFAULT_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 from getEndpoint(). 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 from getEndpoint(). 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 from getEndpoint(). URL is expected to end with '/graphstudio'