@Override
    public ClientSession getClientRoute(JID jid) {
        // Check if this session is hosted by this cluster node
        ClientSession session = localClientRoutingTable.getRoute(jid);
        if (session == null) {
            // The session is not in this JVM so assume remote
            RemoteSessionLocator locator = server.getRemoteSessionLocator();
            if (locator != null) {
                // Check if the session is hosted by other cluster node
                ClientRoute route = getClientRouteForLocalUser(jid);
                if (route != null) {
                    session = locator.getClientSession(route.getNodeID().toByteArray(), jid);
                }
            }
        }
        return session;
    }
Gets the non-negative session from a minimal priority.

@param sessions The sessions.
@param min      The minimal priority.
@return The filtered sessions.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/RoutingTableImpl.java