public synchronized boolean removeDetached(LocalSession localSession) {
        LocalSession other = this.detachedSessions.get(localSession.getStreamID());
        if (other == localSession) {
            Log.trace( "Removing detached session '{}' ({}).", localSession.getAddress(), localSession.getStreamID() );
            return this.detachedSessions.remove(localSession.getStreamID()) != null;
        }
        return false;
    }
Remove a session as being detached. This is idempotent.
This should be called by the LocalSession itself either when resumed or when
closed.

@param localSession the LocalSession (this) which has been resumed or closed.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionManager.java