public boolean isDetached(LocalSession localSession) {
        return this.detachedSessions.containsKey(localSession.getStreamID());
    }
Checks if a session is currently in the detached state (ie, has no connection,
but has not been formally closed yet either).

@param localSession A session
@return true if the session is currently in 'detached' state, otherwise 'false'.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionManager.java