Class OpenBiObjectLockExtensions
Extension methods for locking / unlocking objects.
Inheritance
Namespace: BiExcellence.OpenBi.Api.Commands.Configurator
Assembly: BiExcellence.OpenBi.Api.Configurator.dll
Syntax
public static class OpenBiObjectLockExtensions
Methods
GetObjectLockAsync(IOpenBiSession, string, string, CancellationToken)
Returns information about an existing lock for a table, id combination.
Returns null
if there is no lock.
Declaration
public static Task<IObjectLock?> GetObjectLockAsync(this IOpenBiSession session, string table, string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | table | The table. |
string | id | The id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IObjectLock> | The object lock or |
GetObjectLocksByTableAsync(IOpenBiSession, string, CancellationToken)
Gets a list of existing object locks for a table.
Declaration
public static Task<IList<IObjectLock>> GetObjectLocksByTableAsync(this IOpenBiSession session, string table, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | table | The table name. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<IObjectLock>> | The list of object locks. |
GetObjectLocksByUsernameAsync(IOpenBiSession, string, CancellationToken)
Gets a list of existing object locks for a user.
Declaration
public static Task<IList<IObjectLock>> GetObjectLocksByUsernameAsync(this IOpenBiSession session, string username, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | username | The username. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IList<IObjectLock>> | The list of object locks. |
LockObjectAsync(IOpenBiSession, string, string, CancellationToken)
Acquire a lock for a table, id combination. Throws an OpenBiServerErrorException when there is already a lock from another session.
Declaration
public static Task LockObjectAsync(this IOpenBiSession session, string table, string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | table | The table name. |
string | id | The id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
OpenBiServerErrorException |
LockObjectStrictAsync(IOpenBiSession, string, string, CancellationToken)
Acquire a lock for a table, id combination. Throws an OpenBiServerErrorException when there is already a lock.
Declaration
public static Task LockObjectStrictAsync(this IOpenBiSession session, string table, string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | table | The table name. |
string | id | The id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
OpenBiServerErrorException |
UnlockObjectAsync(IOpenBiSession, string, string, CancellationToken)
Release an existing lock for a table, id combination.
Declaration
public static Task UnlockObjectAsync(this IOpenBiSession session, string table, string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | table | The table name. |
string | id | The id. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |