API lock - RapturePlatform/Rapture GitHub Wiki
The Lock API contains functionality for working with semaphore locks.
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.
Parameter | Type | Description |
---|---|---|
managerUri | String |
Type | Description |
---|---|
List |
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.
Parameter | Type | Description |
---|---|---|
managerUri | String | |
config | String | |
pathPosition | String |
Type | Description |
---|---|
RaptureLockConfig |
Metadata used by objects in the Lock API.
Field | Type |
---|---|
name | String |
config | String |
authority | String |
pathPosition | String |
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.
Parameter | Type | Description |
---|---|---|
managerUri | String |
Type | Description |
---|---|
boolean |
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.
Parameter | Type | Description |
---|---|---|
managerUri | String |
Type | Description |
---|---|
RaptureLockConfig |
Metadata used by objects in the Lock API.
Field | Type |
---|---|
name | String |
config | String |
authority | String |
pathPosition | String |
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.
Parameter | Type | Description |
---|---|---|
managerUri | String |
Type | Description |
---|---|
void |
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.
Parameter | Type | Description |
---|---|---|
managerUri | String | |
lockName | String | |
secondsToWait | long | |
secondsToKeep | long |
Type | Description |
---|---|
LockHandle |
Handle to a Rapture lock.
Field | Type |
---|---|
lockName | String |
handle | String |
lockHolder | String |
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.
Parameter | Type | Description |
---|---|---|
managerUri | String | |
lockName | String | |
lockHandle | LockHandle |
Type | Description |
---|---|
boolean |
Handle to a Rapture lock.
Field | Type |
---|---|
lockName | String |
handle | String |
lockHolder | String |
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.
Parameter | Type | Description |
---|---|---|
managerUri | String | |
lockName | String |
Type | Description |
---|---|
void |