public class MUCServiceImpl extends MUCService
autoOpenConfigValuesTexts, DEFAULT_AUTO_OPEN_BEHAVIOUR, DISABLED_PROPERTY, OPEN_ON_ACTIVITY, OPEN_ON_IMPORTANT_MESSAGE, OPEN_ON_MESSAGE
Constructor and Description |
---|
MUCServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
acceptInvitation(ChatRoomInvitation invitation)
Called to accept an incoming invitation.
|
void |
addChatRoomListChangeListener(ChatRoomListChangeListener l)
Adds a change listener to the ChatRoomList.
|
void |
addChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
Adds a ChatRoomProviderWrapperListener to the listener list.
|
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.
|
ChatRoomWrapper |
createChatRoom(java.lang.String roomName,
ProtocolProviderService protocolProvider,
java.util.Collection<java.lang.String> contacts,
java.lang.String reason,
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.
|
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.
|
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.
|
void |
destroyChatRoom(ChatRoomWrapper chatRoomWrapper,
java.lang.String reason,
java.lang.String alternateAddress)
Destroys the given ChatRoom from the list of all chat rooms.
|
ChatRoomWrapper |
findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
Returns the ChatRoomWrapper that correspond to the given
ChatRoom.
|
ChatRoomWrapper |
findChatRoomWrapperFromChatRoomID(java.lang.String chatRoomID,
ProtocolProviderService pps)
Finds the ChatRoomWrapper instance associated with the
chat room.
|
ChatRoomWrapper |
findChatRoomWrapperFromSourceContact(SourceContact contact)
Finds the ChatRoomWrapper instance associated with the
source contact.
|
ChatRoomProviderWrapper |
findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
Returns the ChatRoomProviderWrapper that correspond to the
given ProtocolProviderService.
|
void |
fireChatRoomListChangedEvent(ChatRoomWrapper chatRoomWrapper,
int eventID)
Fires a ChatRoomListChangedEvent event.
|
java.util.Iterator<ChatRoomProviderWrapper> |
getChatRoomProviders()
Returns an iterator to the list of chat room providers.
|
ChatRoomWrapper |
getChatRoomWrapperByChatRoom(ChatRoom chatRoom,
boolean create)
Searches for chat room wrapper in chat room list by chat room.
|
java.util.List<java.lang.String> |
getExistingChatRooms(ChatRoomProviderWrapper chatRoomProvider)
Returns existing chat rooms for the given chatRoomProvider.
|
ContactSourceService |
getServerChatRoomsContactSourceForProvider(ChatRoomProviderWrapper pps)
Returns instance of the ServerChatRoomContactSourceService
contact source.
|
boolean |
isMUCSourceContact(SourceContact contact)
Returns true if the contact is ChatRoomSourceContact
|
void |
joinChatRoom(ChatRoom chatRoom,
java.lang.String nickname,
byte[] password)
Joins the given chat room and manages all the exceptions that could
occur during the join process.
|
void |
joinChatRoom(ChatRoomWrapper chatRoomWrapper)
Join chat room.
|
void |
joinChatRoom(ChatRoomWrapper chatRoomWrapper,
java.lang.String nickName,
byte[] password)
Joins the given chat room with the given password and manages all the
exceptions that could occur during the join process.
|
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.
|
void |
joinChatRoom(java.lang.String chatRoomName,
ChatRoomProviderWrapper chatRoomProvider)
Joins the room with the given name though the given chat room provider.
|
ChatRoomWrapper |
leaveChatRoom(ChatRoomWrapper chatRoomWrapper)
Leaves the given chat room.
|
void |
openChatRoom(ChatRoomWrapper room)
Opens a chat window for the chat room.
|
void |
rejectInvitation(OperationSetMultiUserChat multiUserChatOpSet,
ChatRoomInvitation invitation,
java.lang.String reason)
Rejects the given invitation with the specified reason.
|
void |
removeChatRoom(ChatRoomWrapper chatRoomWrapper)
Removes the given ChatRoom from the list of all chat rooms.
|
void |
removeChatRoomListChangeListener(ChatRoomListChangeListener l)
Removes a change listener to the ChatRoomList.
|
void |
removeChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
Removes the ChatRoomProviderWrapperListener to the listener list.
|
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. |
getChatRoomAutoOpenOption, getMultiUserChatOpSet, isPrivate, setChatRoomAutoOpenOption
public void acceptInvitation(ChatRoomInvitation invitation)
acceptInvitation
in class MUCService
invitation
- the invitation to accept.public void addChatRoomListChangeListener(ChatRoomListChangeListener l)
l
- the listener.public void removeChatRoomListChangeListener(ChatRoomListChangeListener l)
l
- the listener.public void fireChatRoomListChangedEvent(ChatRoomWrapper chatRoomWrapper, int eventID)
fireChatRoomListChangedEvent
in class MUCService
chatRoomWrapper
- the chat room.eventID
- the id of the event.public void joinChatRoom(ChatRoomWrapper chatRoomWrapper, java.lang.String nickName, byte[] password)
chatRoomWrapper
- the chat room to join.nickName
- the nickname we choose for the given chat room.password
- the password.public void joinChatRoom(ChatRoomWrapper chatRoomWrapper, java.lang.String nickName, byte[] password, java.lang.String subject)
joinChatRoom
in class MUCService
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 void joinChatRoom(ChatRoomWrapper chatRoomWrapper)
chatRoomWrapper
- public void joinChatRoom(ChatRoom chatRoom, java.lang.String nickname, byte[] password)
chatRoom
- the chat room to joinnickname
- the nickname we're using to joinpassword
- the password we're using to joinpublic void joinChatRoom(java.lang.String chatRoomName, ChatRoomProviderWrapper chatRoomProvider)
joinChatRoom
in class MUCService
chatRoomName
- the name of the room to join.chatRoomProvider
- the chat room provider to join through.public ChatRoomWrapper createChatRoom(java.lang.String roomName, ProtocolProviderService protocolProvider, java.util.Collection<java.lang.String> contacts, java.lang.String reason, boolean persistent, boolean isPrivate)
roomName
- the name of the roomprotocolProvider
- the parent protocol provider.contacts
- the contacts invited when creating the chat room.reason
- persistent
- is the room persistentisPrivate
- whether the room will be private or public.public ChatRoomWrapper createChatRoom(java.lang.String roomName, ProtocolProviderService protocolProvider, java.util.Collection<java.lang.String> contacts, java.lang.String reason, boolean persistent)
createChatRoom
in class MUCService
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 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)
createChatRoom
in class MUCService
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 ChatRoomWrapper createPrivateChatRoom(ProtocolProviderService protocolProvider, java.util.Collection<java.lang.String> contacts, java.lang.String reason, boolean persistent)
createPrivateChatRoom
in class MUCService
protocolProvider
- the parent protocol provider.contacts
- the contacts invited when creating the chat room.reason
- persistent
- is the room persistentpublic java.util.List<java.lang.String> getExistingChatRooms(ChatRoomProviderWrapper chatRoomProvider)
getExistingChatRooms
in class MUCService
chatRoomProvider
- the ChatRoomProviderWrapper, which
chat rooms we're looking forpublic void rejectInvitation(OperationSetMultiUserChat multiUserChatOpSet, ChatRoomInvitation invitation, java.lang.String reason)
rejectInvitation
in class MUCService
multiUserChatOpSet
- the operation set to use for rejecting the
invitationinvitation
- the invitation to rejectreason
- the reason for the rejectionpublic ChatRoomWrapper leaveChatRoom(ChatRoomWrapper chatRoomWrapper)
leaveChatRoom
in class MUCService
chatRoomWrapper
- the chat room to leave.public ChatRoomWrapper findChatRoomWrapperFromSourceContact(SourceContact contact)
findChatRoomWrapperFromSourceContact
in class MUCService
contact
- the source contact.public ChatRoomWrapper findChatRoomWrapperFromChatRoomID(java.lang.String chatRoomID, ProtocolProviderService pps)
findChatRoomWrapperFromChatRoomID
in class MUCService
chatRoomID
- the id of the chat room.pps
- the provider of the chat room.public ChatRoomWrapper getChatRoomWrapperByChatRoom(ChatRoom chatRoom, boolean create)
getChatRoomWrapperByChatRoom
in class MUCService
chatRoom
- the chat room.create
- if true and the chat room wrapper is not found new
chatRoomWrapper is created.public 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.synchronizeOpSetWithLocalContactList
in class MUCService
protocolProvider
- the protocol provider for the account to
synchronizeopSet
- the multi user chat operation set, which give us access to
chat room serverpublic java.util.Iterator<ChatRoomProviderWrapper> getChatRoomProviders()
getChatRoomProviders
in class MUCService
public void removeChatRoom(ChatRoomWrapper chatRoomWrapper)
removeChatRoom
in class MUCService
chatRoomWrapper
- the ChatRoomWrapper to removepublic void destroyChatRoom(ChatRoomWrapper chatRoomWrapper, java.lang.String reason, java.lang.String alternateAddress)
chatRoomWrapper
- the ChatRoomWrapper to be destroyed.reason
- the reason for destroying.alternateAddress
- the alternate address.public void addChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
addChatRoomProviderWrapperListener
in class MUCService
listener
- the ChatRoomProviderWrapperListener to be addedpublic void removeChatRoomProviderWrapperListener(ChatRoomProviderWrapperListener listener)
removeChatRoomProviderWrapperListener
in class MUCService
listener
- the ChatRoomProviderWrapperListener to be removedpublic ChatRoomProviderWrapper findServerWrapperFromProvider(ProtocolProviderService protocolProvider)
findServerWrapperFromProvider
in class MUCService
protocolProvider
- the protocol provider that we're looking forpublic ChatRoomWrapper findChatRoomWrapperFromChatRoom(ChatRoom chatRoom)
findChatRoomWrapperFromChatRoom
in class MUCService
chatRoom
- the ChatRoom that we're looking forpublic void openChatRoom(ChatRoomWrapper room)
openChatRoom
in class MUCService
room
- the chat room.public ContactSourceService getServerChatRoomsContactSourceForProvider(ChatRoomProviderWrapper pps)
getServerChatRoomsContactSourceForProvider
in class MUCService
public boolean isMUCSourceContact(SourceContact contact)
isMUCSourceContact
in class MUCService
contact
- the contact
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.