Class RecordLockManager
java.lang.Object
io.goobi.viewer.model.security.recordlock.RecordLockManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
lockRecord
(String pi, String sessionId, Integer limit) boolean
removeLockForPiAndSessionId
(String pi, String sessionId) int
removeLocksForSessionId
(String sessionId, List<String> skipPiList) int
removeOldLocks
(long maxAge) Removes all record locks that are older thatmaxAge
milliseconds.
-
Constructor Details
-
RecordLockManager
public RecordLockManager()
-
-
Method Details
-
lockRecord
public void lockRecord(String pi, String sessionId, Integer limit) throws RecordLimitExceededException - Parameters:
pi
- Record identifiersessionId
- HTTP session IDlimit
- Optional number of concurrent views for the record- Throws:
RecordLimitExceededException
-
removeLocksForSessionId
- Parameters:
sessionId
- HTTP session IDskipPiList
- Optional list of identifiers to skip- Returns:
- true if session id removed from list successfully; false otherwise
-
removeLockForPiAndSessionId
- Parameters:
pi
-sessionId
-- Returns:
- true if lock removed successfully; false otherwise
-
removeOldLocks
public int removeOldLocks(long maxAge) Removes all record locks that are older thatmaxAge
milliseconds. Can be used to periodically clean up locks that might have been missed by the web socket mechanism.- Parameters:
maxAge
-- Returns:
- Number of removed locks
-
emptyCacheForRecord
- Parameters:
pi
-
-
getRecordAccessConditionsCache
- Returns:
- the recordAccessConditionsCache
-
getRecordLimitsCache
- Returns:
- the recordLimitsCache
-