Table of Contents

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
object
OpenBiApiClientObjectLockExtensions

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

client IOpenBiApiClient
table string
id string
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
id string
username string
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
id string
mode ObjectLockMode
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
id string
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
ids IEnumerable<string>
mode ObjectLockMode
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
id string
mode ObjectUnlockMode
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
id string
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
id string
cancellationToken CancellationToken

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

client IOpenBiApiClient
table string
ids IEnumerable<string>
mode ObjectUnlockMode
cancellationToken CancellationToken

Returns

Task