private ClientRoute getClientRouteForLocalUser(JID jid) {
        if (jid.getNode() == null || jid.getResource() == null) {
            Log.trace("getClientRouteForLocalUser() invoked with a JID that's not a full JID: {}", jid);
            return null;
        }

        final Lock lock = usersSessionsCache.getLock(jid.toBareJID());
        lock.lock();
        try {
            return usersCache.get(jid.toFullJID());
        } finally {
            lock.unlock();
        }
    }
Routes packets that are sent to the XMPP domain itself (excluding subdomains).

@param jid
           the recipient of the packet to route.
@param packet
           the packet to route.
@throws PacketException
            thrown if the packet is malformed (results in the sender's
            session being shutdown).
@return {@code true} if the packet was routed successfully,
        {@code false} otherwise.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/RoutingTableImpl.java