public abstract class MUCService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
autoOpenConfigValuesTexts
Map for the auto open configuration values and their text representation
|
static java.lang.String |
DEFAULT_AUTO_OPEN_BEHAVIOUR
The default for chat room auto-open behaviour.
|
static java.lang.String |
DISABLED_PROPERTY
The configuration property to disable
|
static java.lang.String |
OPEN_ON_ACTIVITY
The value for chat room configuration property to open automatically on
activity
|
static java.lang.String |
OPEN_ON_IMPORTANT_MESSAGE
The value for chat room configuration property to open automatically on
important messages.
|
static java.lang.String |
OPEN_ON_MESSAGE
The value for chat room configuration property to open automatically on
message
|
Constructor and Description |
---|
MUCService() |
Modifier and Type | Method and Description |
---|---|
abstract void |
acceptInvitation(ChatRoomInvitation invitation)
Called to accept an incoming invitation.
|
abstract void |
addChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
Adds a ChatRoomProviderWrapperListener to the listener list.
|
abstract ChatRoomWrapper |
createChatRoom(java.lang.String roomName,
ProtocolProviderService protocolProvider,
java.util.Collection<java.lang.String> contacts,
java.lang.String reason,
boolean persistent)
Creates a chat room, by specifying the chat room name, the parent
protocol provider and eventually, the contacts invited to participate in
this chat room.
|
abstract ChatRoomWrapper |
createChatRoom(java.lang.String roomName,
ProtocolProviderService protocolProvider,
java.util.Collection<java.lang.String> contacts,
java.lang.String reason,
boolean join,
boolean persistent,
boolean isPrivate)
Creates a chat room, by specifying the chat room name, the parent
protocol provider and eventually, the contacts invited to participate in
this chat room.
|
abstract ChatRoomWrapper |
createPrivateChatRoom(ProtocolProviderService protocolProvider,
java.util.Collection<java.lang.String> contacts,
java.lang.String reason,
boolean persistent)
Creates a private chat room, by specifying the parent
protocol provider and eventually, the contacts invited to participate in
this chat room.
|
abstract ChatRoomWrapper |
findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
Returns the ChatRoomWrapper that correspond to the given
ChatRoom.
|
abstract ChatRoomWrapper |
findChatRoomWrapperFromChatRoomID(java.lang.String chatRoomID,
ProtocolProviderService pps)
Finds the ChatRoomWrapper instance associated with the
chat room.
|
abstract ChatRoomWrapper |
findChatRoomWrapperFromSourceContact(SourceContact contact)
Finds ChatRoomWrapper instance associated with the given source
contact.
|
abstract ChatRoomProviderWrapper |
findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
Returns the ChatRoomProviderWrapper that correspond to the
given ProtocolProviderService.
|
abstract void |
fireChatRoomListChangedEvent(ChatRoomWrapper chatRoomWrapper,
int eventID)
Fires a ChatRoomListChangedEvent event.
|
static java.lang.String |
getChatRoomAutoOpenOption(ProtocolProviderService pps,
java.lang.String chatRoomId)
Returns the value of the chat room open automatically property
|
abstract java.util.Iterator<ChatRoomProviderWrapper> |
getChatRoomProviders()
Returns an iterator to the list of chat room providers.
|
abstract ChatRoomWrapper |
getChatRoomWrapperByChatRoom(ChatRoom chatRoom,
boolean create)
Searches for chat room wrapper in chat room list by chat room.
|
abstract java.util.List<java.lang.String> |
getExistingChatRooms(ChatRoomProviderWrapper chatRoomProvider)
Returns existing chat rooms for the given chatRoomProvider.
|
static OperationSetMultiUserChat |
getMultiUserChatOpSet(ProtocolProviderService protocolProvider)
Returns the multi user chat operation set for the given protocol provider.
|
abstract ContactSourceService |
getServerChatRoomsContactSourceForProvider(ChatRoomProviderWrapper pps)
Returns instance of the ServerChatRoomContactSourceService
contact source.
|
abstract boolean |
isMUCSourceContact(SourceContact contact)
Returns true if the contact is ChatRoomSourceContact
|
static boolean |
isPrivate(ChatRoom chatRoom)
Determines whether a specific
ChatRoom is private i.e. |
abstract void |
joinChatRoom(ChatRoomWrapper chatRoomWrapper,
java.lang.String nickName,
byte[] password,
java.lang.String subject)
Joins the given chat room with the given password and manages all the
exceptions that could occur during the join process.
|
abstract void |
joinChatRoom(java.lang.String chatRoomName,
ChatRoomProviderWrapper chatRoomProvider)
Joins the room with the given name though the given chat room provider.
|
abstract ChatRoomWrapper |
leaveChatRoom(ChatRoomWrapper chatRoomWrapper)
Leaves the given chat room.
|
abstract void |
openChatRoom(ChatRoomWrapper room)
Opens a chat window for the chat room.
|
abstract void |
rejectInvitation(OperationSetMultiUserChat multiUserChatOpSet,
ChatRoomInvitation invitation,
java.lang.String reason)
Rejects the given invitation with the specified reason.
|
abstract void |
removeChatRoom(ChatRoomWrapper chatRoomWrapper)
Removes the given ChatRoom from the list of all chat rooms.
|
abstract void |
removeChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
Removes the ChatRoomProviderWrapperListener to the listener list.
|
static void |
setChatRoomAutoOpenOption(ProtocolProviderService pps,
java.lang.String chatRoomId,
java.lang.String value)
Sets chat room open automatically property
|
abstract void |
synchronizeOpSetWithLocalContactList(ProtocolProviderService protocolProvider,
OperationSetMultiUserChat opSet)
Goes through the locally stored chat rooms list and for each
ChatRoomWrapper tries to find the corresponding server stored
ChatRoom in the specified operation set. |
public static final java.lang.String DISABLED_PROPERTY
public static java.lang.String OPEN_ON_ACTIVITY
public static java.lang.String OPEN_ON_MESSAGE
public static java.lang.String OPEN_ON_IMPORTANT_MESSAGE
public static java.lang.String DEFAULT_AUTO_OPEN_BEHAVIOUR
public static java.util.Map<java.lang.String,java.lang.String> autoOpenConfigValuesTexts
public static void setChatRoomAutoOpenOption(ProtocolProviderService pps, java.lang.String chatRoomId, java.lang.String value)
pps
- the providerchatRoomId
- the chat room idvalue
- the new value for the propertypublic static java.lang.String getChatRoomAutoOpenOption(ProtocolProviderService pps, java.lang.String chatRoomId)
pps
- the providerchatRoomId
- the chat room idpublic abstract void fireChatRoomListChangedEvent(ChatRoomWrapper chatRoomWrapper, int eventID)
chatRoomWrapper
- the chat room.eventID
- the id of the event.public abstract void joinChatRoom(ChatRoomWrapper chatRoomWrapper, java.lang.String nickName, byte[] password, java.lang.String subject)
chatRoomWrapper
- the chat room to join.nickName
- the nickname we choose for the given chat room.password
- the password.subject
- the subject which will be set to the room after the user
join successful.public abstract ChatRoomWrapper createChatRoom(java.lang.String roomName, ProtocolProviderService protocolProvider, java.util.Collection<java.lang.String> contacts, java.lang.String reason, boolean persistent)
roomName
- the name of the roomprotocolProvider
- the parent protocol provider.contacts
- the contacts invited when creating the chat room.reason
- persistent
- is the room persistentpublic abstract ChatRoomWrapper createPrivateChatRoom(ProtocolProviderService protocolProvider, java.util.Collection<java.lang.String> contacts, java.lang.String reason, boolean persistent)
protocolProvider
- the parent protocol provider.contacts
- the contacts invited when creating the chat room.reason
- persistent
- is the room persistentpublic abstract ChatRoomWrapper createChatRoom(java.lang.String roomName, ProtocolProviderService protocolProvider, java.util.Collection<java.lang.String> contacts, java.lang.String reason, boolean join, boolean persistent, boolean isPrivate)
roomName
- the name of the roomprotocolProvider
- the parent protocol provider.contacts
- the contacts invited when creating the chat room.reason
- join
- whether we should join the room after creating it.persistent
- whether the newly created room will be persistent.isPrivate
- whether the room will be private or public.public abstract void joinChatRoom(java.lang.String chatRoomName, ChatRoomProviderWrapper chatRoomProvider)
chatRoomName
- the name of the room to join.chatRoomProvider
- the chat room provider to join through.public abstract java.util.List<java.lang.String> getExistingChatRooms(ChatRoomProviderWrapper chatRoomProvider)
chatRoomProvider
- the ChatRoomProviderWrapper, which
chat rooms we're looking forpublic abstract void acceptInvitation(ChatRoomInvitation invitation)
invitation
- the invitation to accept.public abstract void rejectInvitation(OperationSetMultiUserChat multiUserChatOpSet, ChatRoomInvitation invitation, java.lang.String reason)
multiUserChatOpSet
- the operation set to use for rejecting the
invitationinvitation
- the invitation to rejectreason
- the reason for the rejectionpublic static boolean isPrivate(ChatRoom chatRoom)
ChatRoom
is private i.e.
represents a one-to-one conversation which is not a channel. Since the
interface ChatRoom
does not expose the private property, an
heuristic is used as a workaround: (1) a system ChatRoom
is
obviously not private and (2) a ChatRoom
is private if it
has only one ChatRoomMember
who is not the local user.chatRoom
- the ChatRoom
to be determined as private or notChatRoom
is private;
otherwise, falsepublic abstract ChatRoomWrapper leaveChatRoom(ChatRoomWrapper chatRoomWrapper)
chatRoomWrapper
- the chat room to leave.public abstract ChatRoomWrapper findChatRoomWrapperFromSourceContact(SourceContact contact)
contact
- the contact.public abstract ChatRoomWrapper getChatRoomWrapperByChatRoom(ChatRoom chatRoom, boolean create)
chatRoom
- the chat room.create
- if true and the chat room wrapper is not found new
chatRoomWrapper is created.public static OperationSetMultiUserChat getMultiUserChatOpSet(ProtocolProviderService protocolProvider)
protocolProvider
- The protocol provider for which the multi user
chat operation set is about.public abstract ChatRoomWrapper findChatRoomWrapperFromChatRoomID(java.lang.String chatRoomID, ProtocolProviderService pps)
chatRoomID
- the id of the chat room.pps
- the provider of the chat room.public abstract void synchronizeOpSetWithLocalContactList(ProtocolProviderService protocolProvider, OperationSetMultiUserChat opSet)
ChatRoomWrapper
tries to find the corresponding server stored
ChatRoom
in the specified operation set. Joins automatically all
found chat rooms.protocolProvider
- the protocol provider for the account to
synchronizeopSet
- the multi user chat operation set, which give us access to
chat room serverpublic abstract java.util.Iterator<ChatRoomProviderWrapper> getChatRoomProviders()
public abstract void removeChatRoom(ChatRoomWrapper chatRoomWrapper)
chatRoomWrapper
- the ChatRoomWrapper to removepublic abstract void addChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
listener
- the ChatRoomProviderWrapperListener to be addedpublic abstract void removeChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
listener
- the ChatRoomProviderWrapperListener to be removedpublic abstract ChatRoomProviderWrapper findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
protocolProvider
- the protocol provider that we're looking forpublic abstract ChatRoomWrapper findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
chatRoom
- the ChatRoom that we're looking forpublic abstract void openChatRoom(ChatRoomWrapper room)
room
- the chat room.public abstract ContactSourceService getServerChatRoomsContactSourceForProvider(ChatRoomProviderWrapper pps)
public abstract boolean isMUCSourceContact(SourceContact contact)
contact
- the contact
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.