|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.echomine.jabber.JabberChatService
public class JabberChatService
This service deals with all aspects of chatting (private one-on-one, group chats, headlines, etc). You can use this service to send private messages, to send group chat messages, or to reply to messages. A special note: most of the old group chatting functionality are replaced with the newer conference-style chatting. This service supports only the old style for backwards compatibility. In fact, currently only the commercial Jabber server supports the new conferencing protocol (and it uses a special draft conference namespace). Another service will be created to handle conferencing-style chat rooms.
There are currently several different types of chatting available. The "chat" type is your regular one-on-one chatting. The "groupchat" is the chatroom-style chatting. The "headline" is more of a notification. The "normal" is used when no type is specified. Usually you would open a new window for each specific JID you're chatting with. You should just treat "normal" types the same as "chat" types by default.
Note that the group chat capability is the predecessor of the new Conferencing feature, and are technically NOT the same thing.
Private Chatting Notes
Private chatting support both plain text and XHTML text. It is up to you to parse the HTML text if you support it. It is also up to you to create the XHTML message. The Chat Service currently gives you rudimentary methods to send messages with XHTML support. If you require any advanced function, you should instantiate your own JabberChatMessage, set the proper fields, and send the message yourself.
Field Summary |
---|
Fields inherited from interface com.echomine.jabber.PresenceCode |
---|
SHOW_AWAY, SHOW_CHAT, SHOW_DO_NOT_DISTURB, SHOW_EXTENDED_AWAY, SHOW_ONLINE, TYPE_AVAILABLE, TYPE_INVISIBLE, TYPE_PROBE, TYPE_SUBSCRIBE, TYPE_SUBSCRIBED, TYPE_UNAVAILABLE, TYPE_UNSUBSCRIBE, TYPE_UNSUBSCRIBED |
Constructor Summary | |
---|---|
JabberChatService(JabberSession session)
|
Method Summary | |
---|---|
void |
joinChatRoom(JID roomJID,
java.lang.String nick,
boolean wait)
joins a chat room with a specified arbitrary nickname. |
void |
leaveChatRoom(JID roomJID,
boolean wait)
leaves a chat room that you are currently in. |
void |
replyToPrivateMessage(JID toJID,
java.lang.String threadID,
java.lang.String body,
boolean wait)
replies to a message. |
void |
sendChatMessage(JID roomJID,
java.lang.String body,
boolean wait)
a simple method to send a text message to the chat room. |
void |
sendPrivateMessage(JID toJID,
java.lang.String body,
boolean wait)
sends a private message to a specific JID that's plain text. |
void |
setChatAvailable(JID roomJID,
java.lang.String showState,
java.lang.String status,
boolean wait)
sets status to available with optional show state and status line for a specific chat room. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JabberChatService(JabberSession session)
Method Detail |
---|
public void sendPrivateMessage(JID toJID, java.lang.String body, boolean wait) throws SendMessageFailedException
toJID
- the JID to send the message tobody
- the plain text body of the messagewait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void replyToPrivateMessage(JID toJID, java.lang.String threadID, java.lang.String body, boolean wait) throws SendMessageFailedException
toJID
- the JID to send the message back tothreadID
- the thread id of the originating messagebody
- the body textwait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void joinChatRoom(JID roomJID, java.lang.String nick, boolean wait) throws SendMessageFailedException
roomJID
- the jid of the room, in the form of room@servernick
- the nickname to be used in the roomwait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void leaveChatRoom(JID roomJID, boolean wait) throws SendMessageFailedException
roomJID
- the JID of the room to leavewait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void sendChatMessage(JID roomJID, java.lang.String body, boolean wait) throws SendMessageFailedException
roomJID
- the JID of the chat roombody
- the text to send to the chat roomwait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
public void setChatAvailable(JID roomJID, java.lang.String showState, java.lang.String status, boolean wait) throws SendMessageFailedException
roomJID
- the JID of the room to send the availability toshowState
- optional parameter to set the show state (chat, away, extended away, etc), null if not setting a statestatus
- the status to set, or null if not setting a status textwait
- true if the caller wants to wait until there is a reply to the message
SendMessageFailedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |