com.jivesoftware.spark
Class ChatManager

java.lang.Object
  extended bycom.jivesoftware.spark.ChatManager

public class ChatManager
extends java.lang.Object

Handles the Chat Management of each individual Workspace. The ChatManager is responsible for creation and removal of chat rooms, transcripts, and transfers and room invitations.


Constructor Summary
ChatManager()
          Create a new instance of ChatManager.
 
Method Summary
 void addChatRoomListener(ChatRoomListener listener)
          Used to listen for rooms opening, closing or being activated( already opened, but tabbed to )
 void addMessageFilter(MessageFilter filter)
          Adds a new MessageFilter.
 ChatRoom createChatRoom(java.lang.String userJID, java.lang.String nickname, java.lang.String title)
          Creates and/or opens a chat room with the specified user.
 ChatRoom createConferenceRoom(java.lang.String roomName, java.lang.String serviceName)
          Creates a new public Conference Room.
 void filterIncomingMessage(org.jivesoftware.smack.packet.Message message)
           
 void filterOutgoingMessage(org.jivesoftware.smack.packet.Message message)
           
 ChatContainer getChatContainer()
          Returns all ChatRooms currently active.
 ChatRoom getChatRoom(java.lang.String jid)
          Returns the ChatRoom for the giving jid.
 GroupChatRoom getGroupChat(java.lang.String roomName)
          Returns the MultiUserChat associated with the specified roomname.
 java.util.Collection getMessageFilters()
          Returns a Collection of MessageFilters registered to Spark.
 void removeChat(ChatRoom chatRoom)
          Removes the personal 1 to 1 chat from the ChatFrame.
 void removeChatRoomListener(ChatRoomListener listener)
          Simplace facade for chatroom.
 void removeMessageFilter(MessageFilter filter)
          Removes a MessageFilter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatManager

public ChatManager()
Create a new instance of ChatManager.

Method Detail

addChatRoomListener

public void addChatRoomListener(ChatRoomListener listener)
Used to listen for rooms opening, closing or being activated( already opened, but tabbed to )

Parameters:
listener - the ChatRoomListener to add

removeChatRoomListener

public void removeChatRoomListener(ChatRoomListener listener)
Simplace facade for chatroom. Removes a listener

Parameters:
listener - the ChatRoomListener to remove

removeChat

public void removeChat(ChatRoom chatRoom)
Removes the personal 1 to 1 chat from the ChatFrame.

Parameters:
chatRoom - the ChatRoom to remove.

getChatContainer

public ChatContainer getChatContainer()
Returns all ChatRooms currently active.

Returns:
all ChatRooms.

getGroupChat

public GroupChatRoom getGroupChat(java.lang.String roomName)
                           throws ChatNotFoundException
Returns the MultiUserChat associated with the specified roomname.

Parameters:
roomName - the name of the chat room.
Returns:
the MultiUserChat found for that room.
Throws:
ChatNotFoundException

createChatRoom

public ChatRoom createChatRoom(java.lang.String userJID,
                               java.lang.String nickname,
                               java.lang.String title)
Creates and/or opens a chat room with the specified user.

Parameters:
userJID - the jid of the user to chat with.
nickname - the nickname to use for the user.

getChatRoom

public ChatRoom getChatRoom(java.lang.String jid)
Returns the ChatRoom for the giving jid. If the ChatRoom is not found, a new ChatRoom will be created.

Parameters:
jid - the jid of the user to chat with.
Returns:
the ChatRoom.

createConferenceRoom

public ChatRoom createConferenceRoom(java.lang.String roomName,
                                     java.lang.String serviceName)
Creates a new public Conference Room.

Parameters:
roomName - the name of the room.
serviceName - the service name to use (ex.conference.jivesoftware.com)
Returns:
the new ChatRoom created. If an error occured, null will be returned.

addMessageFilter

public void addMessageFilter(MessageFilter filter)
Adds a new MessageFilter.

Parameters:
filter - the MessageFilter.

removeMessageFilter

public void removeMessageFilter(MessageFilter filter)
Removes a MessageFilter.

Parameters:
filter - the MessageFilter.

getMessageFilters

public java.util.Collection getMessageFilters()
Returns a Collection of MessageFilters registered to Spark.

Returns:
the Collection of MessageFilters.

filterIncomingMessage

public void filterIncomingMessage(org.jivesoftware.smack.packet.Message message)

filterOutgoingMessage

public void filterOutgoingMessage(org.jivesoftware.smack.packet.Message message)