Class SesameServer
Represents a connection to a Sesame Server.
Inherited Members
Namespace: VDS.RDF.Storage.Management
Assembly: dotNetRdf.Client.dll
Syntax
public class SesameServer : BaseHttpConnector, IAsyncStorageServer, IConfigurationSerializable, IStorageServer, IDisposable
Constructors
| Improve this Doc View SourceSesameServer(string, IWebProxy)
Creates a new connection to a Sesame HTTP Protocol supporting Store.
Declaration
public SesameServer(string baseUri, IWebProxy proxy)
Parameters
Type | Name | Description |
---|---|---|
string | baseUri | Base Uri of the Store. |
System.Net.IWebProxy | proxy | Proxy Server. |
SesameServer(string, string, string, IWebProxy)
Creates a new connection to a Sesame HTTP Protocol supporting Store.
Declaration
public SesameServer(string baseUri, string username, string password, IWebProxy proxy)
Parameters
Type | Name | Description |
---|---|---|
string | baseUri | Base Uri of the Store. |
string | username | Username to use for requests that require authentication. |
string | password | Password to use for requests that require authentication. |
System.Net.IWebProxy | proxy | Proxy Server. |
SesameServer(string, string, string)
Creates a new connection to a Sesame HTTP Protocol supporting Store.
Declaration
public SesameServer(string baseUri, string username, string password)
Parameters
Type | Name | Description |
---|---|---|
string | baseUri | Base Uri of the Store. |
string | username | Username to use for requests that require authentication. |
string | password | Password to use for requests that require authentication. |
SesameServer(string)
Creates a new connection to a Sesame HTTP Protocol supporting Store.
Declaration
public SesameServer(string baseUri)
Parameters
Type | Name | Description |
---|---|---|
string | baseUri | Base Uri of the Store. |
Fields
| Improve this Doc View Source_baseUri
Base Uri for the Server.
Declaration
protected string _baseUri
Field Value
Type | Description |
---|---|
string |
_hasCredentials
Whether the User has provided credentials for accessing the Server using authentication.
Declaration
protected bool _hasCredentials
Field Value
Type | Description |
---|---|
System.Boolean |
_pwd
Password for accessing the Server.
Declaration
protected string _pwd
Field Value
Type | Description |
---|---|
string |
_repositoriesPrefix
Repositories Prefix.
Declaration
protected string _repositoriesPrefix
Field Value
Type | Description |
---|---|
string |
_username
Username for accessing the Server.
Declaration
protected string _username
Field Value
Type | Description |
---|---|
string |
SystemRepositoryID
System Repository ID.
Declaration
public const string SystemRepositoryID = "SYSTEM"
Field Value
Type | Description |
---|---|
string |
TemplateTypes
Available Sesame template types.
Declaration
protected List<Type> TemplateTypes
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<T><System.Type> |
Properties
| Improve this Doc View SourceIOBehaviour
Gets the IO Behaviour of the server.
Declaration
public IOBehaviour IOBehaviour { get; }
Property Value
Type | Description |
---|---|
IOBehaviour |
Methods
| Improve this Doc View SourceCreateRequest(string, string, HttpMethod, Dictionary<string, string>)
Helper method for creating HTTP Requests to the Store.
Declaration
protected virtual HttpRequestMessage CreateRequest(string servicePath, string accept, HttpMethod method, Dictionary<string, string> queryParams)
Parameters
Type | Name | Description |
---|---|---|
string | servicePath | Path to the Service requested. |
string | accept | Acceptable Content Types. |
System.Net.Http.HttpMethod | method | HTTP Method. |
System.Collections.Generic.Dictionary<TKey, TValue><string, string> | queryParams | Querystring Parameters. |
Returns
Type | Description |
---|---|
System.Net.Http.HttpRequestMessage |
CreateRequest(string, string, string, Dictionary<string, string>)
Helper method for creating HTTP Requests to the Store.
Declaration
[Obsolete("This method is obsolete and will be removed in a future release.")]
protected virtual HttpWebRequest CreateRequest(string servicePath, string accept, string method, Dictionary<string, string> queryParams)
Parameters
Type | Name | Description |
---|---|---|
string | servicePath | Path to the Service requested. |
string | accept | Acceptable Content Types. |
string | method | HTTP Method. |
System.Collections.Generic.Dictionary<TKey, TValue><string, string> | queryParams | Querystring Parameters. |
Returns
Type | Description |
---|---|
System.Net.HttpWebRequest |
CreateStore(IStoreTemplate, AsyncStorageCallback, object)
Creates a new store based on the given template.
Declaration
public virtual void CreateStore(IStoreTemplate template, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
IStoreTemplate | template | Template. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Remarks
Template must inherit from BaseSesameTemplate.
CreateStore(IStoreTemplate)
Creates a new Store based on the given template.
Declaration
public virtual bool CreateStore(IStoreTemplate template)
Parameters
Type | Name | Description |
---|---|---|
IStoreTemplate | template | Template. |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
Templates must inherit from BaseSesameTemplate.
CreateStoreAsync(IStoreTemplate, CancellationToken)
Creates a store asynchronously.
Declaration
public Task<string> CreateStoreAsync(IStoreTemplate template, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IStoreTemplate | template | Template for the store to be created. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><string> |
DeleteStore(string, AsyncStorageCallback, object)
Deletes a store asynchronously.
Declaration
public virtual void DeleteStore(string storeID, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
string | storeID | ID of the store to delete. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
DeleteStore(string)
Deletes the Store with the given ID.
Declaration
public virtual void DeleteStore(string storeID)
Parameters
Type | Name | Description |
---|---|---|
string | storeID | Store ID. |
Remarks
Whether attempting to delete the Store that you are accessing is permissible is up to the implementation.
DeleteStoreAsync(string, CancellationToken)
Deletes a store asynchronously.
Declaration
public virtual Task DeleteStoreAsync(string storeId, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | storeId | ID of the store to delete. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Dispose(bool)
Disposes of the server.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
| Improve this Doc View SourceEnsureSystemConnection()
Ensures the connection to the Sesame SYSTEM repository is prepared if it isn't already.
Declaration
protected virtual void EnsureSystemConnection()
GetAvailableTemplates(string, AsyncStorageCallback, object)
Gets all available templates for creating a store.
Declaration
public virtual void GetAvailableTemplates(string id, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
string | id | Store ID. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
GetAvailableTemplates(string)
Gets all available templates for creating a store.
Declaration
public virtual IEnumerable<IStoreTemplate> GetAvailableTemplates(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | Store ID. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><IStoreTemplate> |
GetAvailableTemplatesAsync(string, CancellationToken)
Gets all available templates for creating a store with the given ID.
Declaration
public Task<IEnumerable<IStoreTemplate>> GetAvailableTemplatesAsync(string id, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | id | The store ID. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><System.Collections.Generic.IEnumerable<T><IStoreTemplate>> |
GetDefaultTemplate(string, AsyncStorageCallback, object)
Gets a default template for creating a store.
Declaration
public virtual void GetDefaultTemplate(string id, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
string | id | Store ID. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
GetDefaultTemplate(string)
Gets a default template for creating a store.
Declaration
public virtual IStoreTemplate GetDefaultTemplate(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | Store ID. |
Returns
Type | Description |
---|---|
IStoreTemplate |
GetDefaultTemplateAsync(string, CancellationToken)
Gets a default template for creating a store with the given ID.
Declaration
public Task<IStoreTemplate> GetDefaultTemplateAsync(string id, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | id | The store ID. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><IStoreTemplate> |
GetStore(string, AsyncStorageCallback, object)
Gets a store asynchronously.
Declaration
public virtual void GetStore(string storeId, AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
string | storeId | Store ID. |
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
Remarks
If the store ID requested matches the current instance an instance MAY invoke the callback immediately returning a reference to itself.
GetStore(string)
Gets the Store with the given ID.
Declaration
public virtual IStorageProvider GetStore(string storeId)
Parameters
Type | Name | Description |
---|---|---|
string | storeId | Store ID. |
Returns
Type | Description |
---|---|
IStorageProvider |
Remarks
If the Store ID requested represents the current instance then it is acceptable for an implementation to return itself. Consumers of this method should be aware of this and if necessary use other means to create a connection to a store if they want a unique instance of the provider.
GetStoreAsync(string, CancellationToken)
Gets a store asynchronously.
Declaration
public virtual Task<IAsyncStorageProvider> GetStoreAsync(string storeId, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | storeId | Store ID. |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><IAsyncStorageProvider> |
ListStores()
Gets the list of available stores.
Declaration
public virtual IEnumerable<string> ListStores()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><string> |
ListStores(AsyncStorageCallback, object)
Lists the available stores asynchronously.
Declaration
[Obsolete("This method is obsolete and will be removed in a future release. Replaced by ListStoresAsync")]
public virtual void ListStores(AsyncStorageCallback callback, object state)
Parameters
Type | Name | Description |
---|---|---|
AsyncStorageCallback | callback | Callback. |
System.Object | state | State to pass to the callback. |
ListStoresAsync(CancellationToken)
Lists the available stores asynchronously.
Declaration
public Task<IEnumerable<string>> ListStoresAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><System.Collections.Generic.IEnumerable<T><string>> |
SerializeConfiguration(ConfigurationSerializationContext)
Serializes the connection's configuration.
Declaration
public virtual void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationSerializationContext | context | Configuration Serialization Context. |