-
public interface Lock
-
-
Method Summary
Modifier and Type Method Description abstract Stringacquire(List<String> keys, String storeId, Long expiration)Try to acquire the lock. abstract Booleanrelease(List<String> keys, String storeId, String token)Try to release the lock if token held by the lock has not changed. abstract Booleanrefresh(List<String> keys, String storeId, String token, Long expiration)Try to refresh the lock expiration. -
-
Method Detail
-
acquire
abstract String acquire(List<String> keys, String storeId, Long expiration)
Try to acquire the lock.
- Parameters:
keys- keys to try to lockstoreId- lock store id to save keys in (table, collection, ...expiration- how long to wait before releasing the key automatically, in millis
-
release
abstract Boolean release(List<String> keys, String storeId, String token)
Try to release the lock if token held by the lock has not changed.
- Parameters:
keys- keys to try to unlockstoreId- lock store id to release keys in (table, collection, ...token- token used to check if lock is still held by this lock
-
refresh
abstract Boolean refresh(List<String> keys, String storeId, String token, Long expiration)
Try to refresh the lock expiration.
- Parameters:
keys- keys to try to refreshstoreId- lock store id to refresh keys in (table, collection, ...token- token used to check if lock is still held by this lockexpiration- how long to wait before releasing the key automatically, in millis
-
-
-
-