Package oracle.pgx.api
Class Pgx
- java.lang.Object
-
- oracle.pgx.api.Pgx
-
public final class Pgx extends java.lang.ObjectMain entry point for PGX applications.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDIST_URLstatic java.lang.StringEMBEDDED_URLconstant 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 PgxSessioncreateSession(java.lang.String source)Creates a session on the default instance.static PgxSessioncreateSession(java.lang.String baseUrl, java.lang.String source)Creates a session.static java.lang.StringgetDefaultUrl()The default url is set by default toEMBEDDED_URL.static ServerInstancegetInstance()Get a handle to a PGX instance usinggetDefaultUrl().static ServerInstancegetInstance(boolean isCreatePartitionedGraphsWithGraphBuilder)Get a handle to a PGX instance.static ServerInstancegetInstance(java.lang.String baseUrl)Get a handle to a PGX instance.static ServerInstancegetInstance(java.lang.String baseUrl, boolean isCreatePartitionedGraphsWithGraphBuilder)Get a handle to a PGX instance.static ServerInstancegetInstance(java.lang.String baseUrl, java.lang.String token)Get a handle to a PGX instance, providing the token for authentication.static ServerInstancegetInstance(java.lang.String baseUrl, java.lang.String token, boolean isCreatePartitionedGraphsWithGraphBuilder)Get a handle to a PGX instance, providing the token for authentication.static ServerInstancegetInstance(java.lang.String baseUrl, oracle.pgx.realm.client.RealmClient realmClient)Get a handle to a PGX instance, using aRealmClientthat provides authentication tokensstatic ServerInstancegetInstance(ClientConfig config)Get a handle to a PGX instance.static ServerInstancegetInstance(ClientConfig config, oracle.pgx.realm.client.RealmClient realmClient)Get a handle to a PGX instance.static oracle.pgx.api.internal.ApiProvidergetProviderFor(java.lang.String url)static voidsetDefaultUrl(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
ServerInstanceinstance - Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
getInstance
public static ServerInstance getInstance(boolean isCreatePartitionedGraphsWithGraphBuilder) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Get a handle to a PGX instance.- Parameters:
isCreatePartitionedGraphsWithGraphBuilder- Whether the graph builder should create partitioned graphs by default- Returns:
- the
ServerInstanceinstance - Throws:
java.util.concurrent.ExecutionExceptionjava.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
ServerInstanceinstance
-
getInstance
public static ServerInstance getInstance(java.lang.String baseUrl, boolean isCreatePartitionedGraphsWithGraphBuilder)
Get a handle to a PGX instance.- Parameters:
baseUrl- base url pointing to a PGX server instance, e.g. myhost:7000/pgxisCreatePartitionedGraphsWithGraphBuilder- Whether the graph builder should create partitioned graphs by default- Returns:
- the
ServerInstanceinstance
-
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
ServerInstanceinstance
-
getInstance
public static ServerInstance getInstance(java.lang.String baseUrl, java.lang.String token, boolean isCreatePartitionedGraphsWithGraphBuilder)
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 tokenisCreatePartitionedGraphsWithGraphBuilder- Whether the graph builder should create partitioned graphs by default- Returns:
- the
ServerInstanceinstance
-
getInstance
public static ServerInstance getInstance(java.lang.String baseUrl, oracle.pgx.realm.client.RealmClient realmClient)
Get a handle to a PGX instance, using aRealmClientthat provides authentication tokens- Parameters:
baseUrl- base url pointing to a PGX server instance, e.g. myhost:7000/pgxrealmClient- aRealmClientto provide authentication tokens- Returns:
- the
ServerInstanceinstance - 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
ServerInstanceinstance
-
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- aRealmClientto provide authentication tokens- Returns:
- the
ServerInstanceinstance - 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.ExecutionExceptionjava.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.ExecutionExceptionjava.lang.InterruptedException
-
-