Package rocks.xmpp.extensions.muc
Class MultiUserChatManager
- java.lang.Object
-
- rocks.xmpp.extensions.muc.MultiUserChatManager
-
- All Implemented Interfaces:
ExtensionProtocol,InboundMessageHandler,DiscoverableInfo,ItemProvider
public final class MultiUserChatManager extends Object implements InboundMessageHandler, ItemProvider, ExtensionProtocol, DiscoverableInfo
Manages Multi-User Chat.- See Also:
- XEP-0045: Multi-User Chat
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInvitationListener(Consumer<InvitationEvent> invitationListener)Adds an invitation listener, which allows to listen for inbound multi-user chat invitations.ChatRoomcreateChatRoom(Jid roomAddress)Creates a chat room for the specified room address.ChatServicecreateChatService(Jid chatService)Creates a chat service for the specified service address.AsyncResult<List<ChatService>>discoverChatServices()Discovers the multi-user chat services hosted at the connected domain.AsyncResult<List<Item>>discoverEnteredRooms(Jid contact)Discovers the rooms, where a contact is in.Set<String>getFeatures()ResultSetProvider<DiscoverableItem>getItems(Jid to, Jid from, String node, Locale locale)StringgetNamespace()voidhandleInboundMessage(MessageEvent e)booleanisEnabled()voidremoveInvitationListener(Consumer<InvitationEvent> invitationListener)Removes a previously added invitation listener.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface rocks.xmpp.extensions.disco.model.info.DiscoverableInfo
getExtensions, getIdentities
-
-
-
-
Method Detail
-
addInvitationListener
public void addInvitationListener(Consumer<InvitationEvent> invitationListener)
Adds an invitation listener, which allows to listen for inbound multi-user chat invitations.- Parameters:
invitationListener- The listener.- See Also:
removeInvitationListener(Consumer)
-
removeInvitationListener
public void removeInvitationListener(Consumer<InvitationEvent> invitationListener)
Removes a previously added invitation listener.- Parameters:
invitationListener- The listener.- See Also:
addInvitationListener(Consumer)
-
discoverChatServices
public AsyncResult<List<ChatService>> discoverChatServices()
Discovers the multi-user chat services hosted at the connected domain.- Returns:
- The async result with the list of chat services.
- See Also:
- 6.1 Discovering a MUC Service
-
discoverEnteredRooms
public AsyncResult<List<Item>> discoverEnteredRooms(Jid contact)
Discovers the rooms, where a contact is in.- Parameters:
contact- The contact, which must be a full JID.- Returns:
- The async result with the items,
Addressable.getJid()has the room address, andItem.getName()} has the nickname. - See Also:
- 6.7 Discovering Client Support for MUC
-
createChatService
public ChatService createChatService(Jid chatService)
Creates a chat service for the specified service address.- Parameters:
chatService- The chat service address. Usually this is hosted at the subdomain "conference".- Returns:
- The chat service.
-
createChatRoom
public ChatRoom createChatRoom(Jid roomAddress)
Creates a chat room for the specified room address.- Parameters:
roomAddress- The chat room address.- Returns:
- The chat room.
-
getItems
public ResultSetProvider<DiscoverableItem> getItems(Jid to, Jid from, String node, Locale locale)
- Specified by:
getItemsin interfaceItemProvider
-
getNamespace
public final String getNamespace()
- Specified by:
getNamespacein interfaceExtensionProtocol
-
isEnabled
public final boolean isEnabled()
- Specified by:
isEnabledin interfaceExtensionProtocol
-
getFeatures
public final Set<String> getFeatures()
- Specified by:
getFeaturesin interfaceDiscoverableInfo
-
handleInboundMessage
public final void handleInboundMessage(MessageEvent e)
- Specified by:
handleInboundMessagein interfaceInboundMessageHandler
-
-