@Override public void executeCloseSession(String uuid) { Session session = openSessions.get(uuid); if (session == null) { if (closedSessions.containsKey(uuid)) { log.debug("attempt to close session {} but is already closed", uuid); } else { log.warn("attempt to close session {} but is no longer cached", uuid); } } else { session.setClosed(new Timestamp(System.currentTimeMillis())); closedSessions.put(session.getUuid(), session); openSessions.remove(session.getUuid()); log.debug("closed session {}", uuid); } }
/** * Assumes that the given manager is no longer available and will clean up * all in-memory sessions. */ public int closeSessionsForManager(final String managerUuid) { // Implementation of the following SQL query in memory: // // update session set closed = now() // where closed is null and node in // (select id from Node where uuid = ?) final Node node = currentNodes.get(managerUuid); int modificationCount = 0; if (node != null) { Iterator<Session> i = node.iterateSessions(); while (i.hasNext()) { Session session = i.next(); if (session.getClosed() == null) { session.setClosed( new Timestamp(System.currentTimeMillis())); modificationCount++; } } } return modificationCount; }
setStarted((java.sql.Timestamp)value); } else if (field.equals(CLOSED)) { setClosed((java.sql.Timestamp)value); } else if (field.equals(MESSAGE)) { setMessage((java.lang.String)value);
target.setClosed(source.getClosed()); target.setDefaultEventType(source.getDefaultEventType()); target.getDetails().shallowCopy(source.getDetails());