Interface LockManagerBase.ILockManagerTransaction
This interface must be implemented by the inheriting class.
Inherited Members
Namespace:FubarDev.WebDavServer.Locking
Assembly:FubarDev.WebDavServer.dll
Syntax
protected interface ILockManagerTransaction : IDisposable
Methods
| Improve this Doc View SourceAddAsync(IActiveLock, CancellationToken)
Adds a new active lock
Declaration
[NotNull]
Task<bool> AddAsync([NotNull] IActiveLock activeLock, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IActiveLock | activeLock | The active lock to add |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<Boolean> | true when adding the lock succeeded |
CommitAsync(CancellationToken)
Commits the changes made during the transaction
Declaration
[NotNull]
Task CommitAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task | The async task |
GetActiveLocksAsync(CancellationToken)
Gets all active locks
Declaration
[NotNull]
[ItemNotNull]
Task<IReadOnlyCollection<IActiveLock>> GetActiveLocksAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IActiveLock>> | The collection of all active locks |
GetAsync(String, CancellationToken)
Gets an active lock by its stateToken
Declaration
[NotNull]
[ItemCanBeNull]
Task<IActiveLock> GetAsync([NotNull] string stateToken, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | stateToken | The state token to search for |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IActiveLock> | The active lock for the state token or null when the lock wasn't found |
RemoveAsync(String, CancellationToken)
Removes an active lock with the given stateToken
Declaration
[NotNull]
Task<bool> RemoveAsync([NotNull] string stateToken, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | stateToken | The state token of the active lock to remove |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<Boolean> | true when a lock with the given stateToken existed and could be removed |
UpdateAsync(IActiveLock, CancellationToken)
Updates the active lock
Declaration
[NotNull]
Task<bool> UpdateAsync([NotNull] IActiveLock activeLock, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IActiveLock | activeLock | The active lock with the updated values |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<Boolean> | true when the lock was updatet, false when the lock was added instead |