Package org.graylog2.cluster.lock
Interface LockService
- All Known Implementing Classes:
MongoLockService
public interface LockService
-
Method Summary
Modifier and TypeMethodDescriptionextendLock
(Lock existingLock) Extend the expiry time of an existing lock.Request a lock.Request a lock.Unlock an existing lock.Unlock an existing lock.
-
Method Details
-
lock
Request a lock. If a lock already exists, the lock expiry time will be extended.- Parameters:
resource
- Unique identifier for the resource that should be guarded by this lock.lockContext
- an identifier that will be appended to the callers' node id. This will create the lock owner string. A context can be used for resources that should only allow a single lock to be acquired, even from the same node. If the lockContext is null, only the nodeId will be used.- Returns:
- A
Lock
object, if a lock was obtained. An emptyOptional
, if no lock could be acquired.
-
lock
Request a lock. If a lock already exists, the lock expiry time will be extended. -
extendLock
Extend the expiry time of an existing lock. -
unlock
Unlock an existing lock. -
unlock
Unlock an existing lock.
-