Package oracle.pgx.api.graphalteration
Interface GraphAlterationBuilder
-
- All Known Subinterfaces:
GraphAlterationEmptyEdgeProviderBuilder
,GraphAlterationEmptyProviderBuilder
,GraphAlterationEmptyVertexProviderBuilder
public interface GraphAlterationBuilder
Builder to describe the alterations (graph schema modification) to perform to a graph. It is for example possible to add or remove vertex and edge providers.- Since:
- 20.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description GraphAlterationBuilder
addEdgeProvider(java.lang.String pathToEdgeProviderConfig)
Adds an edge provider for which the configuration is in a file at the specified pathGraphAlterationBuilder
addEdgeProvider(EntityProviderConfig edgeProviderConfig)
Adds an edge provider specified by the provided configurationGraphAlterationEmptyEdgeProviderBuilder
addEmptyEdgeProvider(java.lang.String providerName, java.lang.String sourceProvider, java.lang.String destProvider)
Adds an empty edge providerGraphAlterationEmptyVertexProviderBuilder
addEmptyVertexProvider(java.lang.String providerName)
Adds an empty vertex providerGraphAlterationBuilder
addVertexProvider(java.lang.String pathToVertexProviderConfig)
Adds a vertex provider for which the configuration is in a file at the specified pathGraphAlterationBuilder
addVertexProvider(EntityProviderConfig vertexProviderConfig)
Adds a vertex provider specified by the provided configurationdefault PgxGraph
build()
Create a new graph that is the result of the alteration of the current graph.default PgxGraph
build(java.lang.String newGraphName)
Create a new graph that is the result of the alteration of the current graph.default PgxFuture<PgxGraph>
buildAsync()
Create a new graph that is the result of the alteration of the current graph.PgxFuture<PgxGraph>
buildAsync(java.lang.String newGraphName)
Create a new graph that is the result of the alteration of the current graph.default PgxGraph
buildNewSnapshot()
Create a new snapshot for the current graph that is the result of the alteration of the current snapshot.PgxFuture<PgxGraph>
buildNewSnapshotAsync()
Create a new snapshot for the current graph that is the result of the alteration of the current snapshot.GraphAlterationBuilder
cascadeEdgeProviderRemovals(boolean cascadeEdgeProviderRemovals)
Specifies if the edge providers associated to a vertex provider (the vertex provider is either the source or destination provider for that edge provider) being removed should be automatically removed too or not.GraphAlterationBuilder
removeEdgeProvider(java.lang.String edgeProviderName)
Removes the edge provider that has the given nameGraphAlterationBuilder
removeVertexProvider(java.lang.String vertexProviderName)
Removes the vertex provider that has the given name.void
setDataSourceVersion(java.lang.String version)
Sets the version information for the built graph or snapshot
-
-
-
Method Detail
-
setDataSourceVersion
void setDataSourceVersion(java.lang.String version)
Sets the version information for the built graph or snapshot- Parameters:
version
- the version information- Since:
- 21.1
-
cascadeEdgeProviderRemovals
GraphAlterationBuilder cascadeEdgeProviderRemovals(boolean cascadeEdgeProviderRemovals)
Specifies if the edge providers associated to a vertex provider (the vertex provider is either the source or destination provider for that edge provider) being removed should be automatically removed too or not. By default, edge providers are not automatically removed whenever an associated vertex is removed. In that setting, if the associated edge providers are not specifically removed, an exception will be thrown to indicate that issue.- Parameters:
cascadeEdgeProviderRemovals
- whether or not to automatically remove associated edge providers of removed vertex providers- Returns:
- the current alteration builder
-
addVertexProvider
GraphAlterationBuilder addVertexProvider(java.lang.String pathToVertexProviderConfig) throws java.io.IOException
Adds a vertex provider for which the configuration is in a file at the specified path- Parameters:
pathToVertexProviderConfig
- the path to the JSON configuration of the vertex provider- Returns:
- the current alteration builder
- Throws:
java.io.IOException
-
addVertexProvider
GraphAlterationBuilder addVertexProvider(EntityProviderConfig vertexProviderConfig)
Adds a vertex provider specified by the provided configuration- Parameters:
vertexProviderConfig
- the configuration of the vertex provider to add- Returns:
- the current alteration builder
-
addEmptyVertexProvider
GraphAlterationEmptyVertexProviderBuilder addEmptyVertexProvider(java.lang.String providerName)
Adds an empty vertex provider- Parameters:
providerName
- the name of the vertex provider to add- Returns:
- the builder to define the vertex provider
- Since:
- 21.4
-
removeVertexProvider
GraphAlterationBuilder removeVertexProvider(java.lang.String vertexProviderName)
Removes the vertex provider that has the given name. Also removes the associated edge providers if true was specified when callingcascadeEdgeProviderRemovals(boolean)
.- Parameters:
vertexProviderName
- the name of the provider to remove- Returns:
- the current alteration builder
-
addEdgeProvider
GraphAlterationBuilder addEdgeProvider(java.lang.String pathToEdgeProviderConfig) throws java.io.IOException
Adds an edge provider for which the configuration is in a file at the specified path- Parameters:
pathToEdgeProviderConfig
- the path to the JSON configuration of the edge provider- Returns:
- the current alteration builder
- Throws:
java.io.IOException
-
addEdgeProvider
GraphAlterationBuilder addEdgeProvider(EntityProviderConfig edgeProviderConfig)
Adds an edge provider specified by the provided configuration- Parameters:
edgeProviderConfig
- the configuration of the edge provider to add- Returns:
- the current alteration builder
-
addEmptyEdgeProvider
GraphAlterationEmptyEdgeProviderBuilder addEmptyEdgeProvider(java.lang.String providerName, java.lang.String sourceProvider, java.lang.String destProvider)
Adds an empty edge provider- Parameters:
providerName
- the name of the edge provider to addsourceProvider
- the name of the vertex provider for the source of the edgesdestProvider
- the name of the vertex provider for the destination of the edges- Returns:
- the builder to define the edge provider
- Since:
- 21.4
-
removeEdgeProvider
GraphAlterationBuilder removeEdgeProvider(java.lang.String edgeProviderName)
Removes the edge provider that has the given name- Parameters:
edgeProviderName
- the name of the provider to remove- Returns:
- the current alteration builder
-
buildAsync
PgxFuture<PgxGraph> buildAsync(java.lang.String newGraphName)
Create a new graph that is the result of the alteration of the current graph.- Parameters:
newGraphName
- name of the new graph to create- Returns:
- the current alteration builder
-
buildAsync
default PgxFuture<PgxGraph> buildAsync()
Create a new graph that is the result of the alteration of the current graph.- Returns:
- a reference to the created graph
-
build
default PgxGraph build(java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Create a new graph that is the result of the alteration of the current graph. (Blocking version ofbuildAsync(String)
)- Parameters:
newGraphName
- name of the new graph to create- Returns:
- a reference to the created graph
- Throws:
java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
build
default PgxGraph build() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Create a new graph that is the result of the alteration of the current graph. (Blocking version ofbuildAsync()
)- Returns:
- a reference to the created graph
- Throws:
java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
buildNewSnapshotAsync
PgxFuture<PgxGraph> buildNewSnapshotAsync()
Create a new snapshot for the current graph that is the result of the alteration of the current snapshot.- Returns:
- a reference to the created graph snapshot
-
buildNewSnapshot
default PgxGraph buildNewSnapshot() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Create a new snapshot for the current graph that is the result of the alteration of the current snapshot. (Blocking version ofbuildNewSnapshotAsync()
)- Returns:
- a reference to the created graph snapshot
- Throws:
java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.
-
-