Possible to get all Room info if joined as admin?

Newbie to XMPP…

Is it possible to get all the Rooms available on a server, if the connection made to the server is an admin connection? How do I go about doing it? code snippets would be helpful.
log.patch (844 Bytes)

I am paraphrasing here but the process is:

  1. Connect and login to the server as the admin user
  2. Call the static method getHostedRooms() on the MultiUserChat object . This will in turn return you a collection of HostedRoom objects.
  3. From the HostedRoom you can get the JID - the unique identifier - of each room (public) on the server.
  4. Now you can either join the rooms or call the static method getRoomInfo

Note that the methods may throw XMPPException if you are not authorized to view the information.