Class RedisLockService
java.lang.Object
overit.geocallapp.wfm.scheduling.bl.lock.service.RedisLockService
- All Implemented Interfaces:
LockService
RedisLockService is an implementation of the LockService interface
that manages locks using a redis approach.
This service ensures that resources, activities, and operation centers are locked
within specified time slots to prevent concurrent access during scheduling operations.
The locks are stored and managed in a redis cache
- Since:
- 18.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacquireLock(String uuid, String key, int timeout) This method acquires a new lockvoidextendLock(String uuid, int timeout) booleanvoidvoidreleaseLock(String uuid) This method releases all the stored locks
-
Constructor Details
-
RedisLockService
public RedisLockService()
-
-
Method Details
-
acquireLock
public boolean acquireLock(String uuid, String key, int timeout) throws DAValidateException, DAException This method acquires a new lock- Specified by:
acquireLockin interfaceLockService- Parameters:
uuid- the uuidkey- the lock keytimeout- the timeout after which the lock expires- Throws:
DAExceptionDAValidateException
-
releaseLock
This method releases all the stored locks- Specified by:
releaseLockin interfaceLockService- Parameters:
uuid- the uuid- Throws:
DAExceptionDAValidateException
-
releaseAllLocks
- Specified by:
releaseAllLocksin interfaceLockService- Throws:
DAExceptionDAValidateException
-
extendLock
- Specified by:
extendLockin interfaceLockService- Throws:
DAValidateException
-
isLocked
public boolean isLocked(String baseLockKey, boolean checkTotalCOScope) throws DAValidateException, DAException - Specified by:
isLockedin interfaceLockService- Throws:
DAValidateExceptionDAException
-