@Test public void testRegisterNewSessionNoWebCertUser() throws Exception { final String sessionId = "session-id"; loggingSessionRegistry.registerNewSession(sessionId, "principal"); verifyNoInteractions(monitoringService); }
@Override public void registerNewSession(String sessionId, Object principal) { LOGGER.debug("Attempting to register new session '{}'", sessionId); if (principal != null && principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; String userRole = user.getRoles() != null && user.getRoles().size() == 1 ? user.getRoles().keySet().iterator().next() : "noRole?"; monitoringService .logUserLogin(user.getHsaId(), userRole, user.getRoleTypeName(), user.getAuthenticationScheme(), user.getOrigin()); } super.registerNewSession(sessionId, principal); }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void registerNewSession(String sessionId, Object principal) { LOGGER.debug("Attempting to register new session '{}'", sessionId); if (principal != null && principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; String userRole = user.getRoles() != null && user.getRoles().size() == 1 ? user.getRoles().keySet().iterator().next() : "noRole?"; monitoringService .logUserLogin(user.getHsaId(), userRole, user.getRoleTypeName(), user.getAuthenticationScheme(), user.getOrigin()); } super.registerNewSession(sessionId, principal); } }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void registerNewSession(String sessionId, Object principal) { LOGGER.debug("Attempting to register new session '{}'", sessionId); if (principal != null && principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; String userRole = user.getRoles() != null && user.getRoles().size() == 1 ? user.getRoles().keySet().iterator().next() : "noRole?"; monitoringService .logUserLogin(user.getHsaId(), userRole, user.getRoleTypeName(), user.getAuthenticationScheme(), user.getOrigin()); } super.registerNewSession(sessionId, principal); }  }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void registerNewSession(String sessionId, Object principal) { LOGGER.debug("Attempting to register new session '{}'", sessionId); if (principal != null && principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; String userRole = user.getRoles() != null && user.getRoles().size() == 1 ? user.getRoles().keySet().iterator().next() : "noRole?"; monitoringService .logUserLogin(user.getHsaId(), userRole, user.getRoleTypeName(), user.getAuthenticationScheme(), user.getOrigin()); } super.registerNewSession(sessionId, principal); }  @Override void registerNewSession(String sessionId, Object principal); @Override void removeSessionInformation(String sessionId); }
WebcertLoggingSessionRegistryImpl extends SessionRegistryImpl { @Override public void registerNewSession(String sessionId, Object principal) { LOGGER.debug("Attempting to register new session '{}'", sessionId); if (principal != null && principal instanceof WebCertUser) { WebCertUser user = (WebCertUser) principal; String userRole = user.getRoles() != null && user.getRoles().size() == 1 ? user.getRoles().keySet().iterator().next() : "noRole?"; monitoringService .logUserLogin(user.getHsaId(), userRole, user.getRoleTypeName(), user.getAuthenticationScheme(), user.getOrigin()); } super.registerNewSession(sessionId, principal); }  @Override void registerNewSession(String sessionId, Object principal); @Override void removeSessionInformation(String sessionId);  }