Package org.jivesoftware.smack.chat
Class ChatManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smack.chat.ChatManager
-
@Deprecated public final class ChatManager extends Manager
Deprecated.useorg.jivesoftware.smack.chat2.ChatManager
fromsmack-extensions
instead.The chat manager keeps track of references to all current chats. It will not hold any references in memory on its own so it is necessary to keep a reference to the chat object itself. To be made aware of new chats, register a listener by callingaddChatListener(ChatManagerListener)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChatManager.MatchMode
Deprecated.Defines the different modes under which a match will be attempted with an existing chat when the incoming message does not have a thread id.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addChatListener(ChatManagerListener listener)
Deprecated.Register a new listener with the ChatManager to receive events related to chats.void
addOutgoingMessageInterceptor(MessageListener messageInterceptor)
Deprecated.Adds an interceptor which intercepts any messages sent through chats.void
addOutgoingMessageInterceptor(MessageListener messageInterceptor, StanzaFilter filter)
Deprecated.Chat
createChat(EntityJid userJID)
Deprecated.Creates a new chat and returns it.Chat
createChat(EntityJid userJID, java.lang.String thread, ChatMessageListener listener)
Deprecated.Creates a new chat using the specified thread ID, then returns it.Chat
createChat(EntityJid userJID, ChatMessageListener listener)
Deprecated.Creates a new chat and returns it.java.util.Set<ChatManagerListener>
getChatListeners()
Deprecated.Returns an unmodifiable set of all chat listeners currently registered with this manager.static ChatManager
getInstanceFor(XMPPConnection connection)
Deprecated.Returns the ChatManager instance associated with a given XMPPConnection.ChatManager.MatchMode
getMatchMode()
Deprecated.Gets the current mode for matching messages with NO thread id to existing chats.Chat
getThreadChat(java.lang.String thread)
Deprecated.boolean
isNormalIncluded()
Deprecated.Determines whether incoming messages of type normal will be used for creating new chats or matching a message to existing ones.void
removeChatListener(ChatManagerListener listener)
Deprecated.Removes a listener, it will no longer be notified of new events related to chats.static void
setDefaultIsNormalIncluded(boolean allowNormal)
Deprecated.static void
setDefaultMatchMode(ChatManager.MatchMode mode)
Deprecated.void
setMatchMode(ChatManager.MatchMode matchMode)
Deprecated.Sets the mode for matching messages with NO thread id to existing chats.void
setNormalIncluded(boolean normalIncluded)
Deprecated.Sets whether to allow incoming messages of type normal to be used for creating new chats or matching a message to an existing one.-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Method Detail
-
getInstanceFor
public static ChatManager getInstanceFor(XMPPConnection connection)
Deprecated.Returns the ChatManager instance associated with a given XMPPConnection.- Parameters:
connection
- the connection used to look for the proper ServiceDiscoveryManager.- Returns:
- the ChatManager associated with a given XMPPConnection.
-
isNormalIncluded
public boolean isNormalIncluded()
Deprecated.Determines whether incoming messages of type normal will be used for creating new chats or matching a message to existing ones.- Returns:
- true if normal is allowed, false otherwise.
-
setNormalIncluded
public void setNormalIncluded(boolean normalIncluded)
Deprecated.Sets whether to allow incoming messages of type normal to be used for creating new chats or matching a message to an existing one.- Parameters:
normalIncluded
- true to allow normal, false otherwise.
-
getMatchMode
public ChatManager.MatchMode getMatchMode()
Deprecated.Gets the current mode for matching messages with NO thread id to existing chats.- Returns:
- The current mode.
-
setMatchMode
public void setMatchMode(ChatManager.MatchMode matchMode)
Deprecated.Sets the mode for matching messages with NO thread id to existing chats.- Parameters:
matchMode
- The mode to set.
-
createChat
public Chat createChat(EntityJid userJID)
Deprecated.Creates a new chat and returns it.- Parameters:
userJID
- the user this chat is with.- Returns:
- the created chat.
-
createChat
public Chat createChat(EntityJid userJID, ChatMessageListener listener)
Deprecated.Creates a new chat and returns it.- Parameters:
userJID
- the user this chat is with.listener
- the optional listener which will listen for new messages from this chat.- Returns:
- the created chat.
-
createChat
public Chat createChat(EntityJid userJID, java.lang.String thread, ChatMessageListener listener)
Deprecated.Creates a new chat using the specified thread ID, then returns it.- Parameters:
userJID
- the jid of the user this chat is withthread
- the thread of the created chat.listener
- the optional listener to add to the chat- Returns:
- the created chat.
-
getThreadChat
public Chat getThreadChat(java.lang.String thread)
Deprecated.
-
addChatListener
public void addChatListener(ChatManagerListener listener)
Deprecated.Register a new listener with the ChatManager to receive events related to chats.- Parameters:
listener
- the listener.
-
removeChatListener
public void removeChatListener(ChatManagerListener listener)
Deprecated.Removes a listener, it will no longer be notified of new events related to chats.- Parameters:
listener
- the listener that is being removed
-
getChatListeners
public java.util.Set<ChatManagerListener> getChatListeners()
Deprecated.Returns an unmodifiable set of all chat listeners currently registered with this manager.- Returns:
- an unmodifiable collection of all chat listeners currently registered with this manager.
-
addOutgoingMessageInterceptor
public void addOutgoingMessageInterceptor(MessageListener messageInterceptor)
Deprecated.Adds an interceptor which intercepts any messages sent through chats.- Parameters:
messageInterceptor
- the interceptor.
-
addOutgoingMessageInterceptor
public void addOutgoingMessageInterceptor(MessageListener messageInterceptor, StanzaFilter filter)
Deprecated.
-
setDefaultMatchMode
public static void setDefaultMatchMode(ChatManager.MatchMode mode)
Deprecated.
-
setDefaultIsNormalIncluded
public static void setDefaultIsNormalIncluded(boolean allowNormal)
Deprecated.
-
-