private void checkMaxSessionsLimit() { if (sessions.size() >= maxSessions) { expiredSessionChecker.removeExpiredSessions(clock.instant()); if (sessions.size() >= maxSessions) { throw new IllegalStateException("Max sessions limit reached: " + sessions.size()); } } }
public void checkIfNecessary(Instant now) { if (this.checkTime.isBefore(now)) { removeExpiredSessions(now); } }
private void checkMaxSessionsLimit() { if (sessions.size() >= maxSessions) { expiredSessionChecker.removeExpiredSessions(clock.instant()); if (sessions.size() >= maxSessions) { throw new IllegalStateException("Max sessions limit reached: " + sessions.size()); } } }
@Override public Mono<Void> save() { if (sessions.size() >= maxSessions) { expiredSessionChecker.removeExpiredSessions(clock.instant()); if (sessions.size() >= maxSessions) { return Mono.error(new IllegalStateException("Max sessions limit reached: " + sessions.size())); } } if (!getAttributes().isEmpty()) { this.state.compareAndSet(State.NEW, State.STARTED); } InMemoryWebSessionStore.this.sessions.put(this.getId(), this); return Mono.empty(); }
public void checkIfNecessary(Instant now) { if (this.checkTime.isBefore(now)) { removeExpiredSessions(now); } }
/** * Check for expired sessions and remove them. Typically such checks are * kicked off lazily during calls to {@link #createWebSession() create} or * {@link #retrieveSession retrieve}, no less than 60 seconds apart. * This method can be called to force a check at a specific time. * @since 5.0.8 */ public void removeExpiredSessions() { this.expiredSessionChecker.removeExpiredSessions(this.clock.instant()); }
private void checkMaxSessionsLimit() { if (sessions.size() >= maxSessions) { expiredSessionChecker.removeExpiredSessions(clock.instant()); if (sessions.size() >= maxSessions) { throw new IllegalStateException("Max sessions limit reached: " + sessions.size()); } } }
/** * Check for expired sessions and remove them. Typically such checks are * kicked off lazily during calls to {@link #createWebSession() create} or * {@link #retrieveSession retrieve}, no less than 60 seconds apart. * This method can be called to force a check at a specific time. * @since 5.0.8 */ public void removeExpiredSessions() { this.expiredSessionChecker.removeExpiredSessions(this.clock.instant()); }
public void checkIfNecessary(Instant now) { if (this.checkTime.isBefore(now)) { removeExpiredSessions(now); } }
public void checkIfNecessary(Instant now) { if (this.checkTime.isBefore(now)) { removeExpiredSessions(now); } }
/** * Check for expired sessions and remove them. Typically such checks are * kicked off lazily during calls to {@link #createWebSession() create} or * {@link #retrieveSession retrieve}, no less than 60 seconds apart. * This method can be called to force a check at a specific time. * @since 5.0.8 */ public void removeExpiredSessions() { this.expiredSessionChecker.removeExpiredSessions(this.clock.instant()); }
/** * Check for expired sessions and remove them. Typically such checks are * kicked off lazily during calls to {@link #createWebSession() create} or * {@link #retrieveSession retrieve}, no less than 60 seconds apart. * This method can be called to force a check at a specific time. * @since 5.0.8 */ public void removeExpiredSessions() { this.expiredSessionChecker.removeExpiredSessions(this.clock.instant()); }