use of org.jivesoftware.smackx.ServiceDiscoveryManager in project ecf by eclipse.
the class XMPPChatRoomManager method checkRoom.
/**
* check if the MultiUserChat room is already existing on the XMPP server.
*
* @param conference
* @param room
* the name of the room
* @return true, if the room exists, false otherwise
* @throws XMPPException
*/
protected boolean checkRoom(String conference, String room) throws XMPPException {
final XMPPConnection conn = ecfConnection.getXMPPConnection();
final ServiceDiscoveryManager serviceDiscoveryManager = new ServiceDiscoveryManager(conn);
final DiscoverItems result = serviceDiscoveryManager.discoverItems(conference);
for (final Iterator items = result.getItems(); items.hasNext(); ) {
final DiscoverItems.Item item = ((DiscoverItems.Item) items.next());
if (room.equals(item.getEntityID())) {
return true;
}
}
return false;
}
Aggregations