Class Pgx


  • public final class Pgx
    extends java.lang.Object
    Main entry point for PGX applications.
    • Field Detail

      • EMBEDDED_URL

        public static final java.lang.String EMBEDDED_URL
        constant indicating this URL refers to an embedded PGX instance.
    • Constructor Detail

      • Pgx

        public Pgx()
    • Method Detail

      • setDefaultUrl

        public static void setDefaultUrl​(java.lang.String url)
        set the default base url used by invocations of getInstance(). The new default url affects sub-sequent calls of getInstance().
        Parameters:
        url - default url
      • getDefaultUrl

        public static java.lang.String getDefaultUrl()
        The default url is set by default to EMBEDDED_URL. You can overwrite the *default* default url by setting the -DpgxDefaultUrl system property.
        Returns:
        the currently set default url.
      • getProviderFor

        public static oracle.pgx.api.internal.ApiProvider getProviderFor​(java.lang.String url)
      • getInstance

        public static ServerInstance getInstance()
                                          throws java.util.concurrent.ExecutionException,
                                                 java.lang.InterruptedException
        Get a handle to a PGX instance using getDefaultUrl().
        Returns:
        the ServerInstance instance
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • getInstance

        public static ServerInstance getInstance​(java.lang.String baseUrl)
        Get a handle to a PGX instance.
        Parameters:
        baseUrl - base url pointing to a PGX server instance, e.g. myhost:7000/pgx
        Returns:
        the ServerInstance instance
      • getInstance

        public static ServerInstance getInstance​(java.lang.String baseUrl,
                                                 java.lang.String token)
        Get a handle to a PGX instance, providing the token for authentication.
        Parameters:
        baseUrl - base url pointing to a PGX server instance, e.g. myhost:7000/pgx
        token - an authentication token
        Returns:
        the ServerInstance instance
      • getInstance

        public static ServerInstance getInstance​(java.lang.String baseUrl,
                                                 oracle.pgx.realm.client.RealmClient realmClient)
        Get a handle to a PGX instance, using a RealmClient that provides authentication tokens
        Parameters:
        baseUrl - base url pointing to a PGX server instance, e.g. myhost:7000/pgx
        realmClient - a RealmClient to provide authentication tokens
        Returns:
        the ServerInstance instance
        Since:
        21.1
      • getInstance

        public static ServerInstance getInstance​(ClientConfig config)
        Get a handle to a PGX instance.
        Parameters:
        config - the config identifying the instance
        Returns:
        the ServerInstance instance
      • getInstance

        public static ServerInstance getInstance​(ClientConfig config,
                                                 oracle.pgx.realm.client.RealmClient realmClient)
        Get a handle to a PGX instance.
        Parameters:
        config - the config identifying the instance
        realmClient - a RealmClient to provide authentication tokens
        Returns:
        the ServerInstance instance
        Since:
        21.2.0
      • createSession

        public static PgxSession createSession​(java.lang.String baseUrl,
                                               java.lang.String source)
                                        throws java.util.concurrent.ExecutionException,
                                               java.lang.InterruptedException
        Creates a session.
        Parameters:
        baseUrl - the base URL pointing to a PGX server instance the session should be created on
        source - the session source string
        Returns:
        the created session
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • createSession

        public static PgxSession createSession​(java.lang.String source)
                                        throws java.util.concurrent.ExecutionException,
                                               java.lang.InterruptedException
        Creates a session on the default instance. This is a convenience method around {@link #createSession(String, * String)} using getDefaultUrl() as base URL.
        Parameters:
        source - the session source string
        Returns:
        the created session
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException