Class OpenBiApiClientObjectLockExtensions
- Namespace
- BiExcellence.OpenBi.Api.ObjectLocks
- Assembly
- BiExcellence.OpenBi.Api.Client.dll
Extension methods for the /objectlocks REST API.
public static class OpenBiApiClientObjectLockExtensions
- Inheritance
-
objectOpenBiApiClientObjectLockExtensions
Methods
GetObjectLockAsync(IOpenBiApiClient, string, string, CancellationToken)
Gets the lock held on the given table/id, or null if it isn't locked.
public static Task<ObjectLock?> GetObjectLockAsync(this IOpenBiApiClient client, string table, string id, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidstringcancellationTokenCancellationToken
Returns
- Task<ObjectLock>
GetObjectLocksAsync(IOpenBiApiClient, string?, string?, string?, CancellationToken)
Lists object locks, optionally filtered by table, id and/or the username holding the lock. A caller who is not a system administrator only sees locks held by users in their own organisation(s). Locks are advisory: they keep cooperating editors apart, nothing blocks a write at the database level.
public static Task<OpenBiListResult<ObjectLock>> GetObjectLocksAsync(this IOpenBiApiClient client, string? table = null, string? id = null, string? username = null, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidstringusernamestringcancellationTokenCancellationToken
Returns
- Task<OpenBiListResult<ObjectLock>>
GetObjectLocksByTableAsync(IOpenBiApiClient, string, CancellationToken)
Lists every lock currently held on rows of the given table.
public static Task<IReadOnlyList<ObjectLock>> GetObjectLocksByTableAsync(this IOpenBiApiClient client, string table, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringcancellationTokenCancellationToken
Returns
- Task<IReadOnlyList<ObjectLock>>
LockObjectAsync(IOpenBiApiClient, string, string, ObjectLockMode, CancellationToken)
Locks a single row of table for the caller.
public static Task LockObjectAsync(this IOpenBiApiClient client, string table, string id, ObjectLockMode mode = ObjectLockMode.Default, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidstringmodeObjectLockModecancellationTokenCancellationToken
Returns
- Task
LockObjectStrictAsync(IOpenBiApiClient, string, string, CancellationToken)
Locks a single row of table, treating a lock already held by the caller's own session as a conflict too.
public static Task LockObjectStrictAsync(this IOpenBiApiClient client, string table, string id, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidstringcancellationTokenCancellationToken
Returns
- Task
LockObjectsAsync(IOpenBiApiClient, string, IEnumerable<string>, ObjectLockMode, CancellationToken)
Locks one or more rows of table for the caller. Throws OpenBiApiException
(409) listing whoever already holds a conflicting lock.
public static Task LockObjectsAsync(this IOpenBiApiClient client, string table, IEnumerable<string> ids, ObjectLockMode mode = ObjectLockMode.Default, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidsIEnumerable<string>modeObjectLockModecancellationTokenCancellationToken
Returns
- Task
UnlockObjectAsync(IOpenBiApiClient, string, string, ObjectUnlockMode, CancellationToken)
Unlocks a single row of table that the caller's own session locked.
public static Task UnlockObjectAsync(this IOpenBiApiClient client, string table, string id, ObjectUnlockMode mode = ObjectUnlockMode.Default, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidstringmodeObjectUnlockModecancellationTokenCancellationToken
Returns
- Task
UnlockObjectForceAsync(IOpenBiApiClient, string, string, CancellationToken)
Unlocks a single row of table regardless of who holds it - for system administrators;
for anyone else it only removes the caller's own session's lock.
public static Task UnlockObjectForceAsync(this IOpenBiApiClient client, string table, string id, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidstringcancellationTokenCancellationToken
Returns
- Task
UnlockObjectUserAsync(IOpenBiApiClient, string, string, CancellationToken)
Unlocks a single row of table held by any session of the caller's own user account.
public static Task UnlockObjectUserAsync(this IOpenBiApiClient client, string table, string id, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidstringcancellationTokenCancellationToken
Returns
- Task
UnlockObjectsAsync(IOpenBiApiClient, string, IEnumerable<string>, ObjectUnlockMode, CancellationToken)
Unlocks one or more rows of table; mode decides whose locks go.
Releasing a lock that is not held is not an error.
public static Task UnlockObjectsAsync(this IOpenBiApiClient client, string table, IEnumerable<string> ids, ObjectUnlockMode mode = ObjectUnlockMode.Default, CancellationToken cancellationToken = default)
Parameters
clientIOpenBiApiClienttablestringidsIEnumerable<string>modeObjectUnlockModecancellationTokenCancellationToken
Returns
- Task