Package oracle.pgx.api
Class Pgx
- java.lang.Object
-
- oracle.pgx.api.Pgx
-
public final class Pgx extends java.lang.Object
Main entry point for PGX applications.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DIST_URL
static java.lang.String
EMBEDDED_URL
constant indicating this URL refers to an embedded PGX instance.
-
Constructor Summary
Constructors Constructor Description Pgx()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PgxSession
createSession(java.lang.String source)
Creates a session on the default instance.static PgxSession
createSession(java.lang.String baseUrl, java.lang.String source)
Creates a session.static java.lang.String
getDefaultUrl()
The default url is set by default toEMBEDDED_URL
.static ServerInstance
getInstance()
Get a handle to a PGX instance usinggetDefaultUrl()
.static ServerInstance
getInstance(java.lang.String baseUrl)
Get a handle to a PGX instance.static ServerInstance
getInstance(java.lang.String baseUrl, java.lang.String token)
Get a handle to a PGX instance, providing the token for authentication.static ServerInstance
getInstance(java.lang.String baseUrl, oracle.pgx.realm.client.RealmClient realmClient)
Get a handle to a PGX instance, using aRealmClient
that provides authentication tokensstatic ServerInstance
getInstance(ClientConfig config)
Get a handle to a PGX instance.static ServerInstance
getInstance(ClientConfig config, oracle.pgx.realm.client.RealmClient realmClient)
Get a handle to a PGX instance.static oracle.pgx.api.internal.ApiProvider
getProviderFor(java.lang.String url)
static void
setDefaultUrl(java.lang.String url)
set the default base url used by invocations ofgetInstance()
.
-
-
-
Field Detail
-
EMBEDDED_URL
public static final java.lang.String EMBEDDED_URL
constant indicating this URL refers to an embedded PGX instance.
-
DIST_URL
public static final java.lang.String DIST_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDefaultUrl
public static void setDefaultUrl(java.lang.String url)
set the default base url used by invocations ofgetInstance()
. The new default url affects sub-sequent calls ofgetInstance()
.- Parameters:
url
- default url
-
getDefaultUrl
public static java.lang.String getDefaultUrl()
The default url is set by default toEMBEDDED_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 usinggetDefaultUrl()
.- 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/pgxtoken
- 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 aRealmClient
that provides authentication tokens- Parameters:
baseUrl
- base url pointing to a PGX server instance, e.g. myhost:7000/pgxrealmClient
- aRealmClient
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 instancerealmClient
- aRealmClient
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 onsource
- 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)} usinggetDefaultUrl()
as base URL.- Parameters:
source
- the session source string- Returns:
- the created session
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
-