Beispiel #1
0
 public SessionState getSessionState() {
   SessionState sessionState = null;
   try {
     sessionState = (SessionState) getSessionAttribute(SessionState.SESSION_ATTRIBUTE_NAME);
   } catch (IllegalStateException e) {
     throw new InvalidSessionException();
   }
   if (sessionState.getUser() == null) {
     sessionState.setUser(loadAuthenticatedUser());
   }
   return sessionState;
 }
Beispiel #2
0
 public void checkIsActiveRecordLocked() throws RecordUnlockedException {
   SessionState sessionState = getSessionState();
   CollectRecord record = sessionState.getActiveRecord();
   if (record == null) {
     throw new RecordUnlockedException();
   } else if (record.getId() != null) {
     User user = sessionState.getUser();
     String lockId = sessionState.getSessionId();
     try {
       recordManager.checkIsLocked(record.getId(), user, lockId);
       sessionState.keepActiveRecordAlive();
     } catch (RecordUnlockedException e) {
       clearActiveRecord();
       throw e;
     }
   }
 }