public int getSessionCount(String username) {
        // TODO Count ALL sessions not only available
        return routingTable.getRoutes(new JID(username, serverName, null, true), null).size();
    }
Returns the number of sessions for a user that are available. For the count
of all sessions for the user, including sessions that are just starting
or closed.

@see #getConnectionsCount(boolean)
@param username the user.
@return number of available sessions for a user.
xmppserver/src/main/java/org/jivesoftware/openfire/SessionManager.java