java.lang.Object
org.apache.jena.http.AsyncHttpRDF
A collection of convenience operations for HTTP level operations
for RDF related tasks which are performed asynchronously.
See also
HttpRDF.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<DatasetGraph>Get a dataset, asynchronouslystatic CompletableFuture<DatasetGraph>asyncGetDatasetGraph(HttpClient httpClient, String url) Get a dataset, asynchronouslystatic CompletableFuture<org.apache.jena.graph.Graph>asyncGetGraph(String url) Get a graph, asynchronouslystatic CompletableFuture<org.apache.jena.graph.Graph>asyncGetGraph(HttpClient httpClient, String url) Get a graph, asynchronouslystatic CompletableFuture<Void>asyncGetToStream(HttpClient httpClient, String url, String acceptHeader, StreamRDF dest, Transactional transactional) Execute an asynchronous GET and parse the result to a StreamRDF.static CompletableFuture<Void>asyncLoadDatasetGraph(String url, DatasetGraph dsg) Load a DatasetGraph asynchronously.static CompletableFuture<Void>asyncLoadDatasetGraph(HttpClient httpClient, String url, Map<String, String> headers, DatasetGraph dsg) Load a DatasetGraph asynchronously.static CompletableFuture<Void>asyncLoadDatasetGraph(HttpClient httpClient, String url, DatasetGraph dsg) Load a DatasetGraph asynchronously.static <T> TgetOrElseThrow(CompletableFuture<T> cf) Wait for theCompletableFuturethen return the result or throw a runtime exception.static <T> TgetOrElseThrow(CompletableFuture<T> cf, HttpRequest httpRequest) Get the value of aCompletableFuturethat executes of an HTTP request.static voidWait for theCompletableFutureor throw a runtime exception.
-
Constructor Details
-
AsyncHttpRDF
public AsyncHttpRDF()
-
-
Method Details
-
asyncGetGraph
Get a graph, asynchronously -
asyncGetGraph
public static CompletableFuture<org.apache.jena.graph.Graph> asyncGetGraph(HttpClient httpClient, String url) Get a graph, asynchronously -
asyncGetDatasetGraph
Get a dataset, asynchronously -
asyncGetDatasetGraph
public static CompletableFuture<DatasetGraph> asyncGetDatasetGraph(HttpClient httpClient, String url) Get a dataset, asynchronously -
asyncLoadDatasetGraph
Load a DatasetGraph asynchronously. The dataset is updated inside a transaction. -
asyncLoadDatasetGraph
public static CompletableFuture<Void> asyncLoadDatasetGraph(HttpClient httpClient, String url, DatasetGraph dsg) Load a DatasetGraph asynchronously. The dataset is updated inside a transaction. -
asyncLoadDatasetGraph
public static CompletableFuture<Void> asyncLoadDatasetGraph(HttpClient httpClient, String url, Map<String, String> headers, DatasetGraph dsg) Load a DatasetGraph asynchronously. The dataset is updated inside a transaction. -
asyncGetToStream
public static CompletableFuture<Void> asyncGetToStream(HttpClient httpClient, String url, String acceptHeader, StreamRDF dest, Transactional transactional) Execute an asynchronous GET and parse the result to a StreamRDF. If "transactional" is not null, the object is used a write transaction around the parsing step.Call
CompletableFuture.join()to await completion.
CallsyncOrElseThrow(CompletableFuture)to await completion, with exceptions translated to the underlyingRuntimeException. -
syncOrElseThrow
Wait for theCompletableFutureor throw a runtime exception. This operation extracts RuntimeException from theCompletableFuture. -
getOrElseThrow
Wait for theCompletableFuturethen return the result or throw a runtime exception. This operation extracts RuntimeException from theCompletableFuture. -
getOrElseThrow
Get the value of aCompletableFuturethat executes of an HTTP request. In case on any error, anHttpExceptionis thrown.- Type Parameters:
T- The type of the value being computed.- Parameters:
cf- The completable future.httpRequest- An optional HttpRequest for improving feedback in case of exceptions.- Returns:
- The value computed by the completable future.
-