Search in sources :

Example 1 with MUCServiceException

use of org.jivesoftware.openfire.exception.MUCServiceException in project Openfire by igniterealtime.

the class MUCRoomController method getChatRoom.

/**
	 * Gets the chat room.
	 * 
	 * @param roomName
	 *            the room name
	 * @param serviceName
	 *            the service name
	 * @return the chat room
	 * @throws MUCServiceException
	 *             the MUC service exception
	 */
public MUCRoomEntity getChatRoom(String roomName, String serviceName) throws MUCServiceException {
    MUCRoom chatRoom = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(serviceName).getChatRoom(roomName);
    if (chatRoom == null) {
        throw new MUCServiceException("Could not fetch the channel", roomName, "Chat room could be not found");
    }
    MUCRoomEntity mucRoomEntity = convertToMUCRoomEntity(chatRoom);
    return mucRoomEntity;
}
Also used : MUCRoom(org.jivesoftware.openfire.muc.MUCRoom) MUCServiceException(org.jivesoftware.openfire.exception.MUCServiceException) MUCRoomEntity(org.jivesoftware.openfire.entity.MUCRoomEntity)

Aggregations

MUCRoomEntity (org.jivesoftware.openfire.entity.MUCRoomEntity)1 MUCServiceException (org.jivesoftware.openfire.exception.MUCServiceException)1 MUCRoom (org.jivesoftware.openfire.muc.MUCRoom)1