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
| Edit this page View SourceSesameServer(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. |
SesameServer(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. |
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, 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. |
IWebProxy | proxy | Proxy Server. |
Fields
| Edit this page View SourceSystemRepositoryID
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 |
---|---|
List<Type> |
_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 |
---|---|
bool |
_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 |
Properties
| Edit this page View SourceIOBehaviour
Gets the IO Behaviour of the server.
Declaration
public IOBehaviour IOBehaviour { get; }
Property Value
Type | Description |
---|---|
IOBehaviour |
Methods
| Edit this page 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. |
HttpMethod | method | HTTP Method. |
Dictionary<string, string> | queryParams | Querystring Parameters. |
Returns
Type | Description |
---|---|
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. |
Dictionary<string, string> | queryParams | Querystring Parameters. |
Returns
Type | Description |
---|---|
HttpWebRequest |
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 |
---|---|
bool |
Remarks
Templates must inherit from BaseSesameTemplate.
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. |
object | state | State to pass to the callback. |
Remarks
Template 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. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> |
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.
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. |
object | state | State to pass to the callback. |
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. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
Dispose(bool)
Disposes of the server.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Overrides
| Edit this page View SourceEnsureSystemConnection()
Ensures the connection to the Sesame SYSTEM repository is prepared if it isn't already.
Declaration
protected virtual void EnsureSystemConnection()
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 |
---|---|
IEnumerable<IStoreTemplate> |
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. |
object | state | State to pass to the callback. |
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. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<IStoreTemplate>> |
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 |
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. |
object | state | State to pass to the callback. |
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. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IStoreTemplate> |
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.
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. |
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.
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. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IAsyncStorageProvider> |
ListStores()
Gets the list of available stores.
Declaration
public virtual IEnumerable<string> ListStores()
Returns
Type | Description |
---|---|
IEnumerable<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. |
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 |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<string>> |
SerializeConfiguration(ConfigurationSerializationContext)
Serializes the connection's configuration.
Declaration
public virtual void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationSerializationContext | context | Configuration Serialization Context. |