Package rocks.xmpp.extensions.muc
Class ChatService
- java.lang.Object
-
- rocks.xmpp.extensions.muc.ChatService
-
- All Implemented Interfaces:
Comparable<ChatService>
,Addressable
public final class ChatService extends Object implements Addressable, Comparable<ChatService>
A chat service hosts chat rooms. It allows you to discover public chat rooms or create new (instant) rooms, if allowed by the service.You get an instance of this class by either using the
MultiUserChatManager.createChatService(Jid)
method or by discovering the chat services at your connected domain.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(ChatService o)
Compares this chat service first by their name and then by their service address.ChatRoom
createRoom(String room)
Creates a new chat room.AsyncResult<List<ChatRoom>>
discoverRooms()
Discovers the list of chat rooms hosted by this chat service.Jid
getAddress()
Deprecated.UsegetJid()
Jid
getJid()
Gets the service address.String
getName()
Gets the name of this service.String
toString()
-
-
-
Method Detail
-
discoverRooms
public AsyncResult<List<ChatRoom>> discoverRooms()
Discovers the list of chat rooms hosted by this chat service.- Returns:
- The async result with the list of public rooms.
- See Also:
- 6.3 Discovering Rooms
-
createRoom
public ChatRoom createRoom(String room)
Creates a new chat room. Note that this room is only created locally.- Parameters:
room
- The room. This is the local part of the room address, e.g. room@service.- Returns:
- The chat room.
-
getAddress
@Deprecated public Jid getAddress()
Deprecated.UsegetJid()
Gets the service address.- Returns:
- The service address.
-
getJid
public Jid getJid()
Gets the service address.- Specified by:
getJid
in interfaceAddressable
- Returns:
- The service address.
-
getName
public String getName()
Gets the name of this service.- Returns:
- The name or null, if the name is unknown.
-
compareTo
public int compareTo(ChatService o)
Compares this chat service first by their name and then by their service address.- Specified by:
compareTo
in interfaceComparable<ChatService>
- Parameters:
o
- The other chat service.- Returns:
- The comparison result.
-
-