@Override
        public void run() {
            // Do nothing if this feature is disabled
            if (ConnectionSettings.Client.PREAUTH_TIMEOUT_PROPERTY.getValue().isNegative()) {
                return;
            }

            final Instant deadline = Instant.now().minus(ConnectionSettings.Client.PREAUTH_TIMEOUT_PROPERTY.getValue());
            final List<LocalClientSession> overdueSessions = preAuthenticatedSessions.values().stream()
                .filter(session -> session.getCreationDate().toInstant().isBefore(deadline))
                .collect(Collectors.toList());

            for (final LocalClientSession session : overdueSessions) {
                Log.debug( "PreAuthenticatedSessionCleanupTask is closing a local pre-authenticated client session that has remained unauthenticated for to long. Creation time: {}. Session to be closed: {}", session.getCreationDate(), session );
                try {
                    session.close();
                }
                catch (Throwable e) {
                    Log.error("An exception occurred while trying to close a local pre-authenticated client session that has remained unauthenticated for to long: {}", session, e);
                }
            }
        }
Task that closes pre-authenticated sessions that have not negotiated SASL for a while.
xmppserver/src/main/java/org/jivesoftware/openfire/LocalSessionManager.java