@Override public UserSession loginAnonymous() throws LoginException { return anonymousSessionHolder.getAnonymousSession(); }
@Override public void applicationStarted() { initializeAnonymousSession(); }
protected void initializeAnonymousSession() { log.debug("Initialize anonymous session"); try { this.session = loginAnonymous(); log.debug("Anonymous session initialized with id {}", session.getId()); } catch (LoginException e) { // Server should not start in this case throw new RuntimeException("Unable to create anonymous session. It is required for system to start", e); } }
@Nonnull @Override public UserSession getAnonymousSession(String trustedClientPassword) throws LoginException { checkTrustedClientCredentials(trustedClientPassword); return anonymousSessionHolder.getAnonymousSession(); }