@Override
    public int getNumberChatRooms() {
        // Note that inactive, persistent rooms might not live in memory, only in the database.
        int persisted = MUCPersistenceManager.countRooms(this);
        final long nonPersisted = localMUCRoomManager.getNonPersistentRoomCount();
        return persisted + (int) nonPersisted;
    }
Returns the number of existing rooms in the server (i.e. persistent or not,
in memory or not).

@return the number of existing rooms in the server.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/MultiUserChatServiceImpl.java