API lock - RapturePlatform/Rapture GitHub Wiki

Lock API

The Lock API contains functionality for working with semaphore locks.

getLockManagerConfigs

HttpLockApi lockApi = new HttpLockApi(loginApi);
List<RaptureLockConfig> retVal = lockApi.getLockManagerConfigs(managerUri);
retVal = baseAPI.doLock_GetLockManagerConfigs(managerUri);

Entitlement: /admin/lock

Retrieves the lock providers for a given authority.

Function Parameters

Parameter Type Description
managerUri String

Return value

Type Description
List

createLockManager

HttpLockApi lockApi = new HttpLockApi(loginApi);
RaptureLockConfig retVal = lockApi.createLockManager(managerUri, config, pathPosition);
retVal = baseAPI.doLock_CreateLockManager(managerUri, config, pathPosition);

Entitlement: /admin/lock

Creates a lock provider with an authority.

Function Parameters

Parameter Type Description
managerUri String
config String
pathPosition String

Return value

Type Description
RaptureLockConfig
Types used in this function

RaptureLockConfig

Metadata used by objects in the Lock API.

Field Type
name String
config String
authority String
pathPosition String

lockManagerExists

HttpLockApi lockApi = new HttpLockApi(loginApi);
boolean retVal = lockApi.lockManagerExists(managerUri);
retVal = baseAPI.doLock_LockManagerExists(managerUri);

Entitlement: /admin/lock

Returns true if the lock providers found.

Function Parameters

Parameter Type Description
managerUri String

Return value

Type Description
boolean

getLockManagerConfig

HttpLockApi lockApi = new HttpLockApi(loginApi);
RaptureLockConfig retVal = lockApi.getLockManagerConfig(managerUri);
retVal = baseAPI.doLock_GetLockManagerConfig(managerUri);

Entitlement: /admin/lock/$f(managerUri)

Gets a lock provider by its Uri.

Function Parameters

Parameter Type Description
managerUri String

Return value

Type Description
RaptureLockConfig
Types used in this function

RaptureLockConfig

Metadata used by objects in the Lock API.

Field Type
name String
config String
authority String
pathPosition String

deleteLockManager

HttpLockApi lockApi = new HttpLockApi(loginApi);
void retVal = lockApi.deleteLockManager(managerUri);
retVal = baseAPI.doLock_DeleteLockManager(managerUri);

Entitlement: /admin/lock/$f(managerUri)

Deletes a lock provider by its Uri.

Function Parameters

Parameter Type Description
managerUri String

Return value

Type Description
void

acquireLock

HttpLockApi lockApi = new HttpLockApi(loginApi);
LockHandle retVal = lockApi.acquireLock(managerUri, lockName, secondsToWait, secondsToKeep);
retVal = baseAPI.doLock_AcquireLock(managerUri, lockName, secondsToWait, secondsToKeep);

Entitlement: /admin/lock/$f(managerUri)

Acquire a lock. Returns a LockHandle, which you need to pass to releaseLock when calling it. Ifunable to acquire the lock, returns null.

Function Parameters

Parameter Type Description
managerUri String
lockName String
secondsToWait long
secondsToKeep long

Return value

Type Description
LockHandle
Types used in this function

LockHandle

Handle to a Rapture lock.

Field Type
lockName String
handle String
lockHolder String

releaseLock

HttpLockApi lockApi = new HttpLockApi(loginApi);
boolean retVal = lockApi.releaseLock(managerUri, lockName, lockHandle);
retVal = baseAPI.doLock_ReleaseLock(managerUri, lockName, lockHandle);

Entitlement: /admin/lock/$f(managerUri)

Releases a lock.

Function Parameters

Parameter Type Description
managerUri String
lockName String
lockHandle LockHandle

Return value

Type Description
boolean
Types used in this function

LockHandle

Handle to a Rapture lock.

Field Type
lockName String
handle String
lockHolder String

forceReleaseLock

HttpLockApi lockApi = new HttpLockApi(loginApi);
void retVal = lockApi.forceReleaseLock(managerUri, lockName);
retVal = baseAPI.doLock_ForceReleaseLock(managerUri, lockName);

Entitlement: /admin/lock/$f(managerUri)

This is a dangerous variant of release lock that will kick someone else off the lock queue.

Function Parameters

Parameter Type Description
managerUri String
lockName String

Return value

Type Description
void
⚠️ **GitHub.com Fallback** ⚠️