com.arsdigita.acs.chat
Class Chat
java.lang.Object
|
+--com.arsdigita.acs.chat.Chat
- public class Chat
- extends Object
Constructor Summary |
Chat()
|
Method Summary |
static ChatRoom |
getRoomProperties(Database db,
Integer roomId)
|
static String |
getSystemName()
|
static Integer[] |
lastPersonalPost(Database db,
Integer userId,
Integer chatterId)
|
static Integer |
lastPost(Database db,
Integer roomId)
Returns chat_msg_id of most recent post in a room; used by JavaScript client to
figure out whether an update to the main window is needed
5/28/2000
mbryzek added a unique index chat_msgs_room_approved_id_idx
on chat_msgs(chat_room_id, approved_p, chat_msg_id)
to avoid hitting the chat_msgs table at all when we're calling
chat_last_post. |
static void |
postMessage(Database db,
String msg,
Integer userId,
Integer roomId,
String remoteAddr)
Post a normal message to the chat room. |
static void |
postPersonalMessage(Database db,
String msg,
Integer userId,
Integer recipientId,
String remoteAddr)
Post a normal message to the chat room. |
static void |
postSystemNote(Database db,
String msg,
Integer userId,
Integer roomId,
String remoteAddr)
Post message to the chat room marked as a system note. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Chat
public Chat()
getRoomProperties
public static ChatRoom getRoomProperties(Database db,
Integer roomId)
throws ACSException
- Returns:
- properties for the given chat room
- Throws:
WarningException
- (with a friendly error message for the user)
if the room does not exist
getSystemName
public static String getSystemName()
- Returns:
- the SystemName parameter
postSystemNote
public static void postSystemNote(Database db,
String msg,
Integer userId,
Integer roomId,
String remoteAddr)
throws ACSException
- Post message to the chat room marked as a system note.
postMessage
public static void postMessage(Database db,
String msg,
Integer userId,
Integer roomId,
String remoteAddr)
throws ACSException
- Post a normal message to the chat room.
postPersonalMessage
public static void postPersonalMessage(Database db,
String msg,
Integer userId,
Integer recipientId,
String remoteAddr)
throws ACSException
- Post a normal message to the chat room.
lastPost
public static Integer lastPost(Database db,
Integer roomId)
throws ACSException,
SQLException
- Returns chat_msg_id of most recent post in a room; used by JavaScript client to
figure out whether an update to the main window is needed
5/28/2000
mbryzek added a unique index chat_msgs_room_approved_id_idx
on chat_msgs(chat_room_id, approved_p, chat_msg_id)
to avoid hitting the chat_msgs table at all when we're calling
chat_last_post. (this is important because the JavaScript
client calls this like crazy)
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 SORT (AGGREGATE)
2 1 INDEX (RANGE SCAN) OF 'CHAT_MSGS_ROOM_APPROVED_ID_IDX' (
UNIQUE)
lastPersonalPost
public static Integer[] lastPersonalPost(Database db,
Integer userId,
Integer chatterId)
throws ACSException,
SQLException
- Returns:
- Integer array: first element is the time of the last post between
currently connected user and argument-specified user. second element
is the user id that wrote the post.