Class PropertyStoreBase
Common functionality for a property store implementation
Inheritance
Inherited Members
Namespace:FubarDev.WebDavServer.Props.Store
Assembly:FubarDev.WebDavServer.dll
Syntax
public abstract class PropertyStoreBase : IPropertyStore
Constructors
| Improve this Doc View SourcePropertyStoreBase(IDeadPropertyFactory)
Initializes a new instance of the PropertyStoreBase class.
Declaration
protected PropertyStoreBase([NotNull] IDeadPropertyFactory deadPropertyFactory)
Parameters
Type | Name | Description |
---|---|---|
IDeadPropertyFactory | deadPropertyFactory | The factory to create dead properties |
Properties
| Improve this Doc View SourceCost
Gets the cost to query the properties of a property store
Declaration
public abstract int Cost { get; }
Property Value
Type | Description |
---|---|
Int32 |
Implements
| Improve this Doc View SourceDeadPropertyFactory
Gets the dead property factory
Declaration
[NotNull]
protected IDeadPropertyFactory DeadPropertyFactory { get; }
Property Value
Type | Description |
---|---|
IDeadPropertyFactory |
Methods
| Improve this Doc View SourceCreate(IEntry, XName)
Creates a dead property by its name for a given entry
Declaration
public IDeadProperty Create(IEntry entry, XName name)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to create the dead property with the given name for |
XName | name | The name of the dead property to create for the given entry for |
Returns
Type | Description |
---|---|
IDeadProperty | The created dead property with the given name for the given entry |
Implements
| Improve this Doc View SourceGetAsync(IEntry, CancellationToken)
Gets all dead properties for a given entry
Declaration
public abstract Task<IReadOnlyCollection<XElement>> GetAsync(IEntry entry, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to get all the dead properties for |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<XElement>> | The collection of all dead properties |
Implements
Remarks
A GetETagProperty will not be returned by this function.
GetAsync(IEntry, XName, CancellationToken)
Gets a dead property with the given name for the given entry
Declaration
public virtual Task<XElement> GetAsync(IEntry entry, XName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to get the property with the given name for |
XName | name | The name of the parameter to get for a given entry |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<XElement> | The XElement for the given dead property |
Implements
Remarks
A GetETagProperty will not be returned by this function.
GetDeadETagAsync(IEntry, CancellationToken)
Gets a GetETagProperty from the property store
Declaration
protected abstract Task<EntityTag> GetDeadETagAsync(IEntry entry, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to get the |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<EntityTag> | The entity tag for the entry |
GetETagAsync(IEntry, CancellationToken)
Gets the entity tag for a given entry
Declaration
public Task<EntityTag> GetETagAsync(IEntry entry, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to get the entity tag for |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<EntityTag> | The loaded entity tag |
Implements
| Improve this Doc View SourceLoadAsync(IEntry, CancellationToken)
Loads all dead properties for a given entry into IDeadProperty implementations
Declaration
public virtual Task<IReadOnlyCollection<IDeadProperty>> LoadAsync(IEntry entry, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to load the dead properties for |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IDeadProperty>> | The collection of the loaded dead properties |
Implements
| Improve this Doc View SourceLoadAsync(IEntry, XName, CancellationToken)
Loads the dead property with the given name into a IDeadProperty implementation
Declaration
public virtual Task<IDeadProperty> LoadAsync(IEntry entry, XName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to load the dead property for |
XName | name | The name of the dead property |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IDeadProperty> | The implementation of the dead property |
Implements
| Improve this Doc View SourceRemoveAsync(IEntry, IEnumerable<XName>, CancellationToken)
Remove multiple dead properties by its name at once from the given entry
Declaration
public abstract Task<IReadOnlyCollection<bool>> RemoveAsync(IEntry entry, IEnumerable<XName> names, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to remove the given property names from |
IEnumerable<XName> | names | The names of the dead properties to remove from the given entry |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<Boolean>> | A collection of booleans where a true value indicates that there was a dead property for a given name that could be removed from the entry. A GetETagProperty cannot be removed by this function. |
Implements
| Improve this Doc View SourceRemoveAsync(IEntry, CancellationToken)
Remove all dead propertied (including a probably exting GetETagProperty) from a given entry
Declaration
public virtual Task RemoveAsync(IEntry entry, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to remove all the dead properties from |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task | The async task |
Implements
| Improve this Doc View SourceRemoveAsync(IEntry, XName, CancellationToken)
Removes a dead property with a given name from the given entry
Declaration
public virtual Task<bool> RemoveAsync(IEntry entry, XName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to remove the dead property with the given name from |
XName | name | The name of the parameter to remove from the entry |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<Boolean> | true when there was a dead property with the given name that could be removed |
Implements
Remarks
A GetETagProperty cannot be removed by this function.
SetAsync(IEntry, IEnumerable<XElement>, CancellationToken)
Sets all given dead properties for the given entry
Declaration
public abstract Task SetAsync(IEntry entry, IEnumerable<XElement> properties, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to set all the dead properties for |
IEnumerable<XElement> | properties | The properties to set for the given entry |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task | The async task |
Implements
Remarks
A GetETagProperty cannot be updated using this method
SetAsync(IEntry, XElement, CancellationToken)
Sets a dead property for the given entry to the given element
Declaration
public virtual Task SetAsync(IEntry entry, XElement element, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to set the property element for |
XElement | element | The element to set the entry for |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task | The async task |
Implements
Remarks
A GetETagProperty cannot be updated by this function.
UpdateDeadETagAsync(IEntry, CancellationToken)
Updates a GetETagProperty in the property store
Declaration
protected abstract Task<EntityTag> UpdateDeadETagAsync(IEntry entry, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to update the |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<EntityTag> | The updated entity tag for the entry |
UpdateETagAsync(IEntry, CancellationToken)
Updates an entity tag for a given entry
Declaration
public Task<EntityTag> UpdateETagAsync(IEntry entry, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEntry | entry | The entry to get the entity tag for |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<EntityTag> | The updated entity tag |