Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat:
de.fu_berlin.inf.dpp.communication.chat.AbstractChat de.fu_berlin.inf.dpp.communication.chat.IChat

List of all members.

Public Member Functions

synchronized JID getJID ()
synchronized Set< JIDgetParticipants ()
synchronized String getThreadID ()
void sendMessage (Message message) throws XMPPException
void sendMessage (String text) throws XMPPException
synchronized void setCurrentState (ChatState newState) throws XMPPException
boolean disconnect ()
synchronized boolean isConnected ()

Package Functions

 SingleUserChat ()
synchronized void initChat (String userJID, Chat chat, ChatStateManager chatStateManager)
synchronized MessageListener getMessageListener ()
void setConnected (boolean isConnected)

Detailed Description

This object represents a chat with a single user.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.SingleUserChat ( ) [package]

Member Function Documentation

boolean de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.disconnect ( )

This method does nothing as SingleUserChats are stateless despite the global connection status.

Returns:
true

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

synchronized JID de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.getJID ( )

Returns the JID of the local user.

Returns:
the JID of the local user

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

synchronized MessageListener de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.getMessageListener ( ) [package]

Returns the chat's MessageListener.

Returns:
the chat's MessageListener
synchronized Set<JID> de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.getParticipants ( )

Returns the names of the user the chat is with.

Returns:
the names of the user the chat is with.

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

synchronized String de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.getThreadID ( )

Returns the thread id associated with this chat, which corresponds to the thread field of XMPP messages.

Returns:
the thread id associated with this chat, which corresponds to the thread field of XMPP messages.

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

synchronized void de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.initChat ( String  userJID,
Chat  chat,
ChatStateManager  chatStateManager 
) [package]

Initializes the chat so that it is possible to exchange messages with the participant.

Parameters:
userJIDJID of the local user
chatChat object from Smack, contains the recipient
chatStateManagerChatStateManager of the current connection
synchronized boolean de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.isConnected ( )

Returns if it is possible to post messages to the chat.

Returns:
true if it is possible to post messages, otherwise false

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

void de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.sendMessage ( String  text) throws XMPPException

Sends the specified text as a message to the other chat participants.

Parameters:
textthe specified text as a message to the other chat participant.
Exceptions:
XMPPException

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

void de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.sendMessage ( Message  message) throws XMPPException

Sends a message to the other chat participants.

Parameters:
messagethe message to send
Exceptions:
XMPPException

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

void de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.setConnected ( boolean  isConnected) [package]

Notify the chat that it has been connected or disconnected which causes it to notify listeners and add ChatElements to its ChatHistory representing the event.

Parameters:
isConnected
synchronized void de.fu_berlin.inf.dpp.communication.chat.single.SingleUserChat.setCurrentState ( ChatState  newState) throws XMPPException

Set this chat's ChatState and notify participants of the change.

Parameters:
newStateChatState to set
Exceptions:
XMPPException

Implements de.fu_berlin.inf.dpp.communication.chat.IChat.

 All Classes Namespaces Files Functions Variables Enumerations