@Test public void testRemoveSessionInformationNoSession() throws Exception { loggingSessionRegistry.removeSessionInformation("session-id"); verifyNoInteractions(monitoringService); }
@Override public void removeSessionInformation(String sessionId) { LOGGER.debug("Attempting to remove session '{}'", sessionId); SessionInformation sessionInformation = getSessionInformation(sessionId); if (sessionInformation == null) { super.removeSessionInformation(sessionId); return; } Object principal = sessionInformation.getPrincipal(); if (principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; if (sessionInformation.isExpired()) { monitoringService.logUserSessionExpired(user.getHsaId(), user.getAuthenticationScheme()); } else { monitoringService.logUserLogout(user.getHsaId(), user.getAuthenticationScheme()); } } super.removeSessionInformation(sessionId); }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void removeSessionInformation(String sessionId) { LOGGER.debug("Attempting to remove session '{}'", sessionId); SessionInformation sessionInformation = getSessionInformation(sessionId); if (sessionInformation == null) { super.removeSessionInformation(sessionId); return; } Object principal = sessionInformation.getPrincipal(); if (principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; if (sessionInformation.isExpired()) { monitoringService.logUserSessionExpired(user.getHsaId(), user.getAuthenticationScheme()); } else { monitoringService.logUserLogout(user.getHsaId(), user.getAuthenticationScheme()); } } super.removeSessionInformation(sessionId); } }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void removeSessionInformation(String sessionId) { LOGGER.debug("Attempting to remove session '{}'", sessionId); SessionInformation sessionInformation = getSessionInformation(sessionId); if (sessionInformation == null) { super.removeSessionInformation(sessionId); return; } Object principal = sessionInformation.getPrincipal(); if (principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; if (sessionInformation.isExpired()) { monitoringService.logUserSessionExpired(user.getHsaId(), user.getAuthenticationScheme()); } else { monitoringService.logUserLogout(user.getHsaId(), user.getAuthenticationScheme()); } } super.removeSessionInformation(sessionId); }  }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void removeSessionInformation(String sessionId) { LOGGER.debug("Attempting to remove session '{}'", sessionId); SessionInformation sessionInformation = getSessionInformation(sessionId); if (sessionInformation == null) { super.removeSessionInformation(sessionId); return; } Object principal = sessionInformation.getPrincipal(); if (principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; if (sessionInformation.isExpired()) { monitoringService.logUserSessionExpired(user.getHsaId(), user.getAuthenticationScheme()); } else { monitoringService.logUserLogout(user.getHsaId(), user.getAuthenticationScheme()); } } super.removeSessionInformation(sessionId); }  @Override void registerNewSession(String sessionId, Object principal); @Override void removeSessionInformation(String sessionId); }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void removeSessionInformation(String sessionId) { LOGGER.debug("Attempting to remove session '{}'", sessionId); SessionInformation sessionInformation = getSessionInformation(sessionId); if (sessionInformation == null) { super.removeSessionInformation(sessionId); return; } Object principal = sessionInformation.getPrincipal(); if (principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; if (sessionInformation.isExpired()) { monitoringService.logUserSessionExpired(user.getHsaId(), user.getAuthenticationScheme()); } else { monitoringService.logUserLogout(user.getHsaId(), user.getAuthenticationScheme()); } } super.removeSessionInformation(sessionId); }  @Override void registerNewSession(String sessionId, Object principal); @Override void removeSessionInformation(String sessionId);  }