public Map < EntityBareJid , HostedRoom > getRoomsHostedBy ( DomainBareJid serviceName ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException , NotAMucServiceException { if ( ! providesMucService ( serviceName ) ) { throw new NotAMucServiceException ( serviceName ) ; } DiscoverItems discoverItems = serviceDiscoveryManager . discoverItems ( serviceName ) ; List < DiscoverItems . Item > items = discoverItems . getItems ( ) ; Map < EntityBareJid , HostedRoom > answer = new HashMap <> ( items . size ( ) ) ; for ( DiscoverItems . Item item : items ) { HostedRoom hostedRoom = new HostedRoom ( item ) ; HostedRoom previousRoom = answer . put ( hostedRoom . getJid ( ) , hostedRoom ) ; assert previousRoom == null ; } return answer ; }
Returns a Map of HostedRooms where each HostedRoom has the XMPP address of the room and the room s name . Once discovered the rooms hosted by a chat service it is possible to discover more detailed room information or join the room .