Smack

org.jivesoftware.smackx
Class ChatStateManager

java.lang.Object
  extended by org.jivesoftware.smackx.ChatStateManager

public class ChatStateManager
extends Object

Handles chat state for all chats on a particular XMPPConnection. This class manages both the packet extensions and the disco response neccesary for compliance with XEP-0085.

Author:
Alexander Wenckus
See Also:
ChatState, ChatStateExtension

Method Summary
static ChatStateManager getInstance(XMPPConnection connection)
          Returns the ChatStateManager related to the XMPPConnection and it will create one if it does not yet exist.
 void setCurrentState(ChatState newState, Chat chat)
          Sets the current state of the provided chat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ChatStateManager getInstance(XMPPConnection connection)
Returns the ChatStateManager related to the XMPPConnection and it will create one if it does not yet exist.

Parameters:
connection - the connection to return the ChatStateManager
Returns:
the ChatStateManager related the the connection.

setCurrentState

public void setCurrentState(ChatState newState,
                            Chat chat)
                     throws XMPPException
Sets the current state of the provided chat. This method will send an empty bodied Message packet with the state attached as a PacketExtension.

Parameters:
newState - the new state of the chat
chat - the chat.
Throws:
XMPPException - when there is an error sending the message packet.

Smack

Copyright © 2003-2007 Jive Software.