public interface LockStorage
Locker class.| Modifier and Type | Method and Description |
|---|---|
LockState |
createLock(String processName,
LocalDateTime until,
String unlockKey)
Method stores lock.
|
LocalDateTime |
getCurrentDatabaseTime()
Returns current database time, that is shared among nodes.
|
LockState |
getProcessLock(String processName,
LocalDateTime currentDate)
Method returns data about existing / nonexistent lock.
|
LockState |
releaseProcess(String processName,
String unlockKey)
Method releases lock.
|
LockState |
renewLease(String processName,
String unlockKey,
LocalDateTime until)
Renews lease date for particular process, if you have correct unlock key (otherwise exception is thrown)
|
LocalDateTime getCurrentDatabaseTime()
LockState getProcessLock(String processName, LocalDateTime currentDate)
LockState createLock(String processName, LocalDateTime until, String unlockKey)
processName - name of the process we want to lockuntil - date until lock should be kept providing no one has unlock it by thenunlockKey - unlock key to be stored with lockLockState releaseProcess(String processName, String unlockKey) throws IllegalStateException
processName - name of the process we want to unlockunlockKey - key for unlocking the processIllegalStateException - when no lock for the process was foundLockState renewLease(String processName, String unlockKey, LocalDateTime until)
Copyright © 2020 FG Forrest, a.s.. All rights reserved.