Show / Hide Table of Contents

Class BaseAsyncHttpConnector

Abstract Base Class for HTTP Based IAsyncStorageProvider implementations.

Inheritance
object
BaseHttpConnector
BaseAsyncHttpConnector
BaseSesameHttpProtocolConnector
BaseStardogConnector
FourStoreConnector
SparqlHttpProtocolConnector
Implements
IAsyncStorageProvider
IStorageCapabilities
IDisposable
Inherited Members
BaseHttpConnector.HttpClient
BaseHttpConnector.HttpClientHandler
BaseHttpConnector.SetProxy(string)
BaseHttpConnector.SetProxy(Uri)
BaseHttpConnector.Proxy
BaseHttpConnector.ClearProxy()
BaseHttpConnector.SetProxyCredentials(string, string)
BaseHttpConnector.SetProxyCredentials(string, string, string)
BaseHttpConnector.ProxyCredentials
BaseHttpConnector.ClearProxyCredentials()
BaseHttpConnector.Timeout
BaseHttpConnector.SerializeStandardConfig(INode, ConfigurationSerializationContext)
BaseHttpConnector.SetCredentials(string, string)
BaseHttpConnector.Dispose()
BaseHttpConnector.Dispose(bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseAsyncHttpConnector : BaseHttpConnector, IAsyncStorageProvider, IStorageCapabilities, IDisposable
Remarks

It is expected that most classes extending from this will also then implement IStorageProvider separately for their synchronous communication, this class purely provides partial helper implementations for the asynchronous communication.

Constructors

| Edit this page View Source

BaseAsyncHttpConnector()

Create a new connector.

Declaration
protected BaseAsyncHttpConnector()
| Edit this page View Source

BaseAsyncHttpConnector(HttpClientHandler)

Create a new connector.

Declaration
protected BaseAsyncHttpConnector(HttpClientHandler httpClientHandler)
Parameters
Type Name Description
HttpClientHandler httpClientHandler

Properties

| Edit this page View Source

AsyncParentServer

Gets the parent server (if any).

Declaration
public virtual IAsyncStorageServer AsyncParentServer { get; }
Property Value
Type Description
IAsyncStorageServer
| Edit this page View Source

DeleteSupported

Gets whether the Store supports Graph deletion via the DeleteGraph() method.

Declaration
public abstract bool DeleteSupported { get; }
Property Value
Type Description
bool
| Edit this page View Source

IOBehaviour

Gets the IO Behaviour of the Store.

Declaration
public abstract IOBehaviour IOBehaviour { get; }
Property Value
Type Description
IOBehaviour
| Edit this page View Source

IsReadOnly

Gets whether the Store is read only.

Declaration
public abstract bool IsReadOnly { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsReady

Indicates whether the Store is ready to accept requests.

Declaration
public abstract bool IsReady { get; }
Property Value
Type Description
bool
| Edit this page View Source

ListGraphsSupported

Gets whether the Store supports listing graphs via the ListGraphs() method.

Declaration
public abstract bool ListGraphsSupported { get; }
Property Value
Type Description
bool
| Edit this page View Source

ParentServer

Gets the parent server (if any).

Declaration
public virtual IStorageServer ParentServer { get; }
Property Value
Type Description
IStorageServer
| Edit this page View Source

UpdateSupported

Gets whether the Store supports Triple level updates via the UpdateGraph() method.

Declaration
public abstract bool UpdateSupported { get; }
Property Value
Type Description
bool
| Edit this page View Source

UriFactory

Gets or sets the URI factory for the connector to use.

Declaration
protected IUriFactory UriFactory { get; set; }
Property Value
Type Description
IUriFactory

Methods

| Edit this page View Source

DeleteGraph(string, AsyncStorageCallback, object)

Deletes a Graph from the Store.

Declaration
public abstract void DeleteGraph(string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string graphUri

URI of the Graph to delete.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

DeleteGraph(Uri, AsyncStorageCallback, object)

Deletes a Graph from the Store.

Declaration
public virtual void DeleteGraph(Uri graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
Uri graphUri

URI of the Graph to delete.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

DeleteGraphAsync(HttpRequestMessage, bool, string, AsyncStorageCallback, object)

Helper method for doing async delete operations, callers just need to provide an appropriately prepared HTTP request.

Declaration
protected void DeleteGraphAsync(HttpRequestMessage request, bool allow404, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpRequestMessage request

HTTP request.

bool allow404

Whether a 404 response counts as success.

string graphUri

URI of the Graph to delete.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

DeleteGraphAsync(HttpRequestMessage, bool, CancellationToken)

Helper method for deleting a graph from a store.

Declaration
protected Task DeleteGraphAsync(HttpRequestMessage request, bool allow404, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpRequestMessage request

The delete request to send.

bool allow404

True if the client should ignore a 404 returned as the result of trying to delete a non-existent graph.

CancellationToken cancellationToken
Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

| Edit this page View Source

DeleteGraphAsync(HttpWebRequest, bool, string, AsyncStorageCallback, object)

Helper method for doing async delete operations, callers just need to provide an appropriately prepared HTTP request.

Declaration
[Obsolete("This method is obsolete and will be removed in a future release")]
protected void DeleteGraphAsync(HttpWebRequest request, bool allow404, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpWebRequest request

HTTP request.

bool allow404

Whether a 404 response counts as success.

string graphUri

URI of the Graph to delete.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

DeleteGraphAsync(string, CancellationToken)

Deletes a graph from the store asynchronously.

Declaration
public abstract Task DeleteGraphAsync(string graphName, CancellationToken cancellationToken)
Parameters
Type Name Description
string graphName

Name of the graph to delete.

CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

ListGraphs(AsyncStorageCallback, object)

Lists the Graphs in the Store asynchronously.

Declaration
[Obsolete("Replaced with ListGraphsAsync(CancellationToken)")]
public virtual void ListGraphs(AsyncStorageCallback callback, object state)
Parameters
Type Name Description
AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

ListGraphsAsync(CancellationToken)

List the names of the graph on the remote server asynchronously.

Declaration
public virtual Task<IEnumerable<string>> ListGraphsAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<IEnumerable<string>>

Task that returns the list of graph names.

Remarks

This implementation uses a SPARQL query to list the names of the graphs in the store. Many stores support more efficient means of listing graphs and so this method SHOULD be overridden. If the store does not implement the IAsyncQueryableStorage interface, then this method MUST be overridden.

Exceptions
Type Condition
RdfStorageException

Raised if the store does not support the asynchronous SPARQL query required to retrieve a list of graph names.

| Edit this page View Source

LoadGraph(IGraph, string, AsyncStorageCallback, object)

Loads a Graph from the Store asynchronously.

Declaration
public virtual void LoadGraph(IGraph g, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IGraph g

Graph to load into.

string graphUri

URI of the Graph to load.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

LoadGraph(IGraph, Uri, AsyncStorageCallback, object)

Loads a Graph from the Store asynchronously.

Declaration
public virtual void LoadGraph(IGraph g, Uri graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IGraph g

Graph to load into.

Uri graphUri

URI of the Graph to load.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

LoadGraph(IRdfHandler, string, AsyncStorageCallback, object)

Loads a Graph from the Store asynchronously.

Declaration
public abstract void LoadGraph(IRdfHandler handler, string graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IRdfHandler handler

Handler to load with.

string graphUri

URI of the Graph to load.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

LoadGraph(IRdfHandler, Uri, AsyncStorageCallback, object)

Loads a Graph from the Store asynchronously.

Declaration
public virtual void LoadGraph(IRdfHandler handler, Uri graphUri, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IRdfHandler handler

Handler to load with.

Uri graphUri

URI of the Graph to load.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

LoadGraphAsync(HttpRequestMessage, IRdfHandler, CancellationToken)

Helper method for doing async load operations, callers just need to provide an appropriately prepared HTTP request.

Declaration
protected Task LoadGraphAsync(HttpRequestMessage request, IRdfHandler handler, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpRequestMessage request

HTTP Request.

IRdfHandler handler

Handler to load with.

CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

LoadGraphAsync(HttpRequestMessage, IRdfHandler, AsyncStorageCallback, object)

Helper method for doing async load operations, callers just need to provide an appropriately prepared HTTP request.

Declaration
protected void LoadGraphAsync(HttpRequestMessage request, IRdfHandler handler, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpRequestMessage request

HTTP Request.

IRdfHandler handler

Handler to load with.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

LoadGraphAsync(IGraph, string, CancellationToken)

Loads a graph from the store asynchronously.

Declaration
public virtual Task LoadGraphAsync(IGraph g, string graphName, CancellationToken cancellationToken)
Parameters
Type Name Description
IGraph g

The graph to load data into.

string graphName

The name of the graph to retrieve from the store.

CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

This implementation delegates to the LoadGraphAsync(IRdfHandler, string, CancellationToken) method by wrapping g in a GraphHandler.

| Edit this page View Source

LoadGraphAsync(IRdfHandler, string, CancellationToken)

Loads a graph from the store asynchronously.

Declaration
public abstract Task LoadGraphAsync(IRdfHandler handler, string graphName, CancellationToken cancellationToken)
Parameters
Type Name Description
IRdfHandler handler

The handler to receive the loaded triples.

string graphName

Name of the graph to load.

CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

MakeRequestSequence(IEnumerable<HttpRequestMessage>, AsyncStorageCallback, object)

Helper method for doing async operations where a sequence of HTTP requests must be run.

Declaration
protected void MakeRequestSequence(IEnumerable<HttpRequestMessage> requests, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IEnumerable<HttpRequestMessage> requests

HTTP requests.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

SaveGraph(IGraph, AsyncStorageCallback, object)

Saves a Graph to the Store asynchronously.

Declaration
public abstract void SaveGraph(IGraph g, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
IGraph g

Graph to save.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

SaveGraphAsync(HttpRequestMessage, CancellationToken)

Helper method for doing async save operations.

Declaration
protected Task SaveGraphAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpRequestMessage request

A request message with the request content already set.

CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

SaveGraphAsync(HttpRequestMessage, IGraph, AsyncStorageCallback, object)

Helper method for doing callback-based async save operations.

Declaration
protected void SaveGraphAsync(HttpRequestMessage request, IGraph g, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpRequestMessage request

A request message with the request content already set.

IGraph g

The graph to be saved.

AsyncStorageCallback callback

The callback to invoke on completion.

object state

State to pass to the callback.

| Edit this page View Source

SaveGraphAsync(HttpRequestMessage, IRdfWriter, IGraph, AsyncStorageCallback, object)

Helper method for doing callback-based async save operations.

Declaration
protected void SaveGraphAsync(HttpRequestMessage request, IRdfWriter writer, IGraph g, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpRequestMessage request

A request message whose content will be set by this method.

IRdfWriter writer

RDF writer to use to write graph content to the request stream.

IGraph g

The graph to be saved.

AsyncStorageCallback callback

The callback to invoke on completion.

object state

State to pass to the callback.

| Edit this page View Source

SaveGraphAsync(HttpWebRequest, IRdfWriter, IGraph, AsyncStorageCallback, object)

Helper method for doing async save operations, callers just need to provide an appropriately prepared HTTP requests and a RDF writer which will be used to write the data to the request body.

Declaration
[Obsolete("This method is obsolete and will be removed in a future release.")]
protected void SaveGraphAsync(HttpWebRequest request, IRdfWriter writer, IGraph g, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpWebRequest request

HTTP request.

IRdfWriter writer

RDF Writer.

IGraph g

Graph to save.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

SaveGraphAsync(IGraph, CancellationToken)

Saves a Graph to the Store asynchronously.

Declaration
public abstract Task SaveGraphAsync(IGraph g, CancellationToken cancellationToken)
Parameters
Type Name Description
IGraph g

Graph to save.

CancellationToken cancellationToken
Returns
Type Description
Task
| Edit this page View Source

UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)

Updates a Graph in the Store asynchronously.

Declaration
public abstract void UpdateGraph(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
string graphUri

URI of the Graph to update.

IEnumerable<Triple> additions

Triples to be added.

IEnumerable<Triple> removals

Triples to be removed.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)

Updates a Graph in the Store asynchronously.

Declaration
public virtual void UpdateGraph(Uri graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
Uri graphUri

URI of the Graph to update.

IEnumerable<Triple> additions

Triples to be added.

IEnumerable<Triple> removals

Triples to be removed.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

UpdateGraphAsync(HttpRequestMessage, IRdfWriter, IEnumerable<Triple>, CancellationToken)

Helper method for simple updates that only add triples to a graph in the store.

Declaration
protected Task UpdateGraphAsync(HttpRequestMessage request, IRdfWriter writer, IEnumerable<Triple> additions, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpRequestMessage request

A pre-prepared request message without its content set.

IRdfWriter writer

The RDF writer to use to create the request content.

IEnumerable<Triple> additions

The triples to be added to the store.

CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

This helper method sets the content of request to a new GraphContent instance using the provided writer. It then sends the request to the server and provides a default handling of the response message.

| Edit this page View Source

UpdateGraphAsync(HttpRequestMessage, IRdfWriter, Uri, IEnumerable<Triple>, AsyncStorageCallback, object)

Helper method for doing async update operations, callers just need to provide an appropriately prepared HTTP request and a RDF writer which will be used to write the data to the request body.

Declaration
protected void UpdateGraphAsync(HttpRequestMessage request, IRdfWriter writer, Uri graphUri, IEnumerable<Triple> additions, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpRequestMessage request

HTTP Request.

IRdfWriter writer

RDF writer.

Uri graphUri

URI of the Graph to update.

IEnumerable<Triple> additions

Triples.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

UpdateGraphAsync(HttpWebRequest, IRdfWriter, Uri, IEnumerable<Triple>, AsyncStorageCallback, object)

Helper method for doing async update operations, callers just need to provide an appropriately prepared HTTP request and a RDF writer which will be used to write the data to the request body.

Declaration
[Obsolete("This method is obsolete and will be removed in a future release")]
protected void UpdateGraphAsync(HttpWebRequest request, IRdfWriter writer, Uri graphUri, IEnumerable<Triple> ts, AsyncStorageCallback callback, object state)
Parameters
Type Name Description
HttpWebRequest request

HTTP Request.

IRdfWriter writer

RDF writer.

Uri graphUri

URI of the Graph to update.

IEnumerable<Triple> ts

Triples.

AsyncStorageCallback callback

Callback.

object state

State to pass to the callback.

| Edit this page View Source

UpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)

Updates a graph in the store asynchronously.

Declaration
public abstract Task UpdateGraphAsync(string graphUri, IEnumerable<Triple> additions, IEnumerable<Triple> removals, CancellationToken cancellationToken)
Parameters
Type Name Description
string graphUri
IEnumerable<Triple> additions

Triples to be added.

IEnumerable<Triple> removals

Triples to be removed.

CancellationToken cancellationToken
Returns
Type Description
Task

Implements

IAsyncStorageProvider
IStorageCapabilities
IDisposable

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Constructors
    • BaseAsyncHttpConnector()
    • BaseAsyncHttpConnector(HttpClientHandler)
  • Properties
    • AsyncParentServer
    • DeleteSupported
    • IOBehaviour
    • IsReadOnly
    • IsReady
    • ListGraphsSupported
    • ParentServer
    • UpdateSupported
    • UriFactory
  • Methods
    • DeleteGraph(string, AsyncStorageCallback, object)
    • DeleteGraph(Uri, AsyncStorageCallback, object)
    • DeleteGraphAsync(HttpRequestMessage, bool, string, AsyncStorageCallback, object)
    • DeleteGraphAsync(HttpRequestMessage, bool, CancellationToken)
    • DeleteGraphAsync(HttpWebRequest, bool, string, AsyncStorageCallback, object)
    • DeleteGraphAsync(string, CancellationToken)
    • ListGraphs(AsyncStorageCallback, object)
    • ListGraphsAsync(CancellationToken)
    • LoadGraph(IGraph, string, AsyncStorageCallback, object)
    • LoadGraph(IGraph, Uri, AsyncStorageCallback, object)
    • LoadGraph(IRdfHandler, string, AsyncStorageCallback, object)
    • LoadGraph(IRdfHandler, Uri, AsyncStorageCallback, object)
    • LoadGraphAsync(HttpRequestMessage, IRdfHandler, CancellationToken)
    • LoadGraphAsync(HttpRequestMessage, IRdfHandler, AsyncStorageCallback, object)
    • LoadGraphAsync(IGraph, string, CancellationToken)
    • LoadGraphAsync(IRdfHandler, string, CancellationToken)
    • MakeRequestSequence(IEnumerable<HttpRequestMessage>, AsyncStorageCallback, object)
    • SaveGraph(IGraph, AsyncStorageCallback, object)
    • SaveGraphAsync(HttpRequestMessage, CancellationToken)
    • SaveGraphAsync(HttpRequestMessage, IGraph, AsyncStorageCallback, object)
    • SaveGraphAsync(HttpRequestMessage, IRdfWriter, IGraph, AsyncStorageCallback, object)
    • SaveGraphAsync(HttpWebRequest, IRdfWriter, IGraph, AsyncStorageCallback, object)
    • SaveGraphAsync(IGraph, CancellationToken)
    • UpdateGraph(string, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
    • UpdateGraph(Uri, IEnumerable<Triple>, IEnumerable<Triple>, AsyncStorageCallback, object)
    • UpdateGraphAsync(HttpRequestMessage, IRdfWriter, IEnumerable<Triple>, CancellationToken)
    • UpdateGraphAsync(HttpRequestMessage, IRdfWriter, Uri, IEnumerable<Triple>, AsyncStorageCallback, object)
    • UpdateGraphAsync(HttpWebRequest, IRdfWriter, Uri, IEnumerable<Triple>, AsyncStorageCallback, object)
    • UpdateGraphAsync(string, IEnumerable<Triple>, IEnumerable<Triple>, CancellationToken)
  • Implements
  • Extension Methods
Back to top Generated by DocFX