Class RecordLockManager

java.lang.Object
io.goobi.viewer.model.security.recordlock.RecordLockManager

public class RecordLockManager extends Object
  • Constructor Details

    • RecordLockManager

      public RecordLockManager()
  • Method Details

    • lockRecord

      public void lockRecord(String pi, String sessionId, Integer limit) throws RecordLimitExceededException
      Parameters:
      pi - Record identifier
      sessionId - HTTP session ID
      limit - Optional number of concurrent views for the record
      Throws:
      RecordLimitExceededException
    • removeLocksForSessionId

      public int removeLocksForSessionId(String sessionId, List<String> skipPiList)
      Parameters:
      sessionId - HTTP session ID
      skipPiList - Optional list of identifiers to skip
      Returns:
      true if session id removed from list successfully; false otherwise
    • removeLockForPiAndSessionId

      public boolean removeLockForPiAndSessionId(String pi, String sessionId)
      Parameters:
      pi -
      sessionId -
      Returns:
      true if lock removed successfully; false otherwise
    • removeOldLocks

      public int removeOldLocks(long maxAge)
      Removes all record locks that are older that maxAge 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

      public void emptyCacheForRecord(String pi)
      Parameters:
      pi -
    • getRecordAccessConditionsCache

      public Map<String,List<String>> getRecordAccessConditionsCache()
      Returns:
      the recordAccessConditionsCache
    • getRecordLimitsCache

      public Map<String,List<String>> getRecordLimitsCache()
      Returns:
      the recordLimitsCache