| API Call | client.asyncGetLock(key [, getl-expiry ], transcoder) | ||
| Asynchronous | yes | ||
| Description | Get the value for a key, lock the key from changes | ||
| Returns | Future<CASValue<T>> (
Asynchronous request value, as CASValue as Transcoded object
) | ||
| Arguments | |||
String key | Document ID used to identify the value | ||
int getl-expiry | Expiry time for lock | ||
| Default | 15 | ||
| Maximum | 30 | ||
Transcoder<T> transcoder | Transcoder class to be used to serialize value | ||
| API Call | client.asyncGetLock(key [, getl-expiry ]) | ||
| Asynchronous | yes | ||
| Description | Get the value for a key, lock the key from changes | ||
| Returns | Future<CASValue<Object>> (
Asynchronous request value, as CASValue, as Object
) | ||
| Arguments | |||
String key | Document ID used to identify the value | ||
int getl-expiry | Expiry time for lock | ||
| Default | 15 | ||
| Maximum | 30 | ||
| API Call | client.getAndLock(key [, getl-expiry ], transcoder) | ||
| Asynchronous | no | ||
| Description | Get the value for a key, lock the key from changes | ||
| Returns | CASValue<T> (
CASValue as Transcoded object
) | ||
| Arguments | |||
String key | Document ID used to identify the value | ||
int getl-expiry | Expiry time for lock | ||
| Default | 15 | ||
| Maximum | 30 | ||
Transcoder<T> transcoder | Transcoder class to be used to serialize value | ||
| Exceptions | |||
OperationTimeoutException | Exception timeout occured while waiting for value. | ||
RuntimeException | Exception object specifying interruption while waiting for value. | ||
The simplest form of the method is without the transcoder as below.
| API Call | client.getAndLock(key [, getl-expiry ]) | ||
| Asynchronous | yes | ||
| Description | Get the value for a key, lock the key from changes | ||
| Returns | CASValue<Object> (
CASValue as Object
) | ||
| Arguments | |||
String key | Document ID used to identify the value | ||
int getl-expiry | Expiry time for lock | ||
| Default | 15 | ||
| Maximum | 30 | ||
| Exceptions | |||
OperationTimeoutException | Exception timeout occured while waiting for value. | ||
RuntimeException | Exception object specifying interruption while waiting for value. | ||
CASValue<Object> casv = client.getAndLock("keyA", 3);Will lock keyA for 3 seconds or until an Unlock is issued.