Package lumis.collaboration.chat
Interface IChatManager
-
- All Known Implementing Classes:
ChatManager
@StableMinor(version="17.0", sinceVersion="4.0") public interface IChatManager
Interface for managing Chat Objects- Since:
- 4.0.5
- Version:
- $Revision$ $Date$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addConversation(SessionConfig sessionConfig, ChatConversationConfig conversationConfig, ITransaction transaction)
Adds a chat conversation.void
addMessage(SessionConfig sessionConfig, ChatMessageConfig messageConfig, ITransaction transaction)
Adds a chat message to a conversation.void
addUser(SessionConfig sessionConfig, ChatUserConfig userConfig, ITransaction transaction)
Adds a chat uservoid
closeExpiredConversations(SessionConfig sessionConfig, ITransaction transaction)
closes expired conversations.void
deleteConversation(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction)
Deletes the given chat conversation.void
deleteMessage(SessionConfig sessionConfig, java.lang.String messageId, ITransaction transaction)
Deletes the given message Id from its conversation.void
deleteUser(SessionConfig sessionConfig, java.lang.String userId, ITransaction transaction)
Deletes the given user.java.util.Collection<ChatUserConfig>
getActiveUsers(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction)
Returns all the active chat users given the conversation idChatConversationConfig
getConversation(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction)
Returns a chat conversation config object.java.util.List<ChatMessageConfig>
getLatestMessages(SessionConfig sessionConfig, java.lang.String conversationId, java.lang.String chatUserId, int maxMessages, boolean getMessagesToModerate, java.util.Date greaterThanDate, ITransaction transaction)
Deprecated.Since 4.0.11 this method was replaced bygetLatestMessages(SessionConfig, String, String, int, int, boolean, Date, ITransaction)
.java.util.List<ChatMessageConfig>
getLatestMessages(SessionConfig sessionConfig, java.lang.String conversationId, java.lang.String chatUserId, int firstMessageIndex, int maxMessages, boolean getMessagesToModerate, java.util.Date greaterThanDate, ITransaction transaction)
Returns up to maxMessages messageConfigs for a given conversationId.int
getLatestMessagesCount(SessionConfig sessionConfig, java.lang.String conversationId, java.lang.String chatUserId, boolean getMessagesToModerate, java.util.Date greaterThanDate, ITransaction transaction)
Returns the number of messages that exists and would be available for the#getLatestMessages(String, String, int, int, boolean, Date, ITransaction)
method.ChatMessageConfig
getMessage(SessionConfig sessionConfig, java.lang.String messageId, ITransaction transaction)
Returns a message config object.java.util.Collection<ChatMessageConfig>
getMessages(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction)
Returns all the messages for a given conversationId.java.lang.String
getMessagesXml(SessionConfig sessionConfig, java.util.Collection<ChatMessageConfig> chatMessageConfigs, boolean getMessagesToModerate, java.util.List<IResource> resources, ITransaction transaction)
Returns the xml for the given messages.ChatUserConfig
getUser(SessionConfig sessionConfig, java.lang.String userId, java.lang.String conversationId, java.lang.String userSessionId, ITransaction transaction)
Returns a chat user given the portal user id, conversation id and optionally the user sessionIdChatUserConfig
getUser(SessionConfig sessionConfig, java.lang.String id, ITransaction transaction)
Returns a chat user given the chat user idjava.util.Collection<ChatUserConfig>
getUsers(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction)
Returns all the chat users given the conversation idvoid
openStartedConversations(SessionConfig sessionConfig, ITransaction transaction)
Opens the conversations whose startTime has already been reached.boolean
reachedUserLimit(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction)
Returns true if the conversation has reached its user limitvoid
updateActiveUserState(SessionConfig sessionConfig, ITransaction transaction)
Checks if any of the active users have not updated their last acces date.void
updateLastAccess(SessionConfig sessionConfig, java.lang.String chatUserId, ITransaction transaction)
Updates the last access date for the given chat user.void
userLeftConversation(SessionConfig sessionConfig, ChatUserConfig chatUserConfig, ITransaction transaction)
Method to indicate that a user left the conversation
-
-
-
Method Detail
-
addUser
void addUser(SessionConfig sessionConfig, ChatUserConfig userConfig, ITransaction transaction) throws PortalException
Adds a chat user- Parameters:
sessionConfig
-userConfig
-transaction
-- Throws:
PortalException
-
getUser
ChatUserConfig getUser(SessionConfig sessionConfig, java.lang.String id, ITransaction transaction) throws PortalException
Returns a chat user given the chat user id- Parameters:
sessionConfig
-userConfig
-transaction
-- Throws:
PortalException
-
getUser
ChatUserConfig getUser(SessionConfig sessionConfig, java.lang.String userId, java.lang.String conversationId, java.lang.String userSessionId, ITransaction transaction) throws PortalException
Returns a chat user given the portal user id, conversation id and optionally the user sessionId- Parameters:
sessionConfig
-userId
-conversationId
-userSessionId
-transaction
-- Returns:
- Throws:
PortalException
-
getUsers
java.util.Collection<ChatUserConfig> getUsers(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction) throws PortalException
Returns all the chat users given the conversation id- Parameters:
sessionConfig
-conversationId
-transaction
-- Returns:
- Throws:
PortalException
-
getActiveUsers
java.util.Collection<ChatUserConfig> getActiveUsers(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction) throws PortalException
Returns all the active chat users given the conversation id- Parameters:
sessionConfig
-conversationId
-transaction
-- Returns:
- Throws:
PortalException
-
updateActiveUserState
void updateActiveUserState(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
Checks if any of the active users have not updated their last acces date. If not, change their state to inactive- Parameters:
sessionConfig
-transaction
-- Throws:
PortalException
-
deleteUser
void deleteUser(SessionConfig sessionConfig, java.lang.String userId, ITransaction transaction) throws PortalException
Deletes the given user.- Parameters:
sessionConfig
-conversationId
-transaction
-- Throws:
PortalException
-
reachedUserLimit
boolean reachedUserLimit(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction) throws PortalException
Returns true if the conversation has reached its user limit- Parameters:
sessionConfig
-conversationId
-transaction
-- Returns:
- Throws:
PortalException
-
addConversation
void addConversation(SessionConfig sessionConfig, ChatConversationConfig conversationConfig, ITransaction transaction) throws PortalException
Adds a chat conversation.- Parameters:
sessionConfig
-conversationConfig
-transaction
-- Throws:
PortalException
-
getConversation
ChatConversationConfig getConversation(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction) throws PortalException
Returns a chat conversation config object.- Parameters:
sessionConfig
-conversationConfig
-transaction
-- Throws:
PortalException
-
deleteConversation
void deleteConversation(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction) throws PortalException
Deletes the given chat conversation.- Parameters:
sessionConfig
-conversationId
-transaction
-- Throws:
PortalException
-
openStartedConversations
void openStartedConversations(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
Opens the conversations whose startTime has already been reached.- Parameters:
sessionConfig
- the user session information.transaction
- the transaction for persistence access.- Throws:
PortalException
- Since:
- 4.0.11
-
closeExpiredConversations
void closeExpiredConversations(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
closes expired conversations.- Parameters:
sessionConfig
-transaction
-- Throws:
PortalException
-
addMessage
void addMessage(SessionConfig sessionConfig, ChatMessageConfig messageConfig, ITransaction transaction) throws PortalException
Adds a chat message to a conversation.- Parameters:
sessionConfig
-messageConfig
-transaction
-- Throws:
PortalException
-
getMessage
ChatMessageConfig getMessage(SessionConfig sessionConfig, java.lang.String messageId, ITransaction transaction) throws PortalException
Returns a message config object.- Parameters:
sessionConfig
-messageConfig
-transaction
-- Throws:
PortalException
-
getMessages
java.util.Collection<ChatMessageConfig> getMessages(SessionConfig sessionConfig, java.lang.String conversationId, ITransaction transaction) throws PortalException
Returns all the messages for a given conversationId. The messages are returned ordered by creation date.- Parameters:
sessionConfig
-messageId
-transaction
-- Returns:
- Throws:
PortalException
-
getLatestMessages
@Deprecated java.util.List<ChatMessageConfig> getLatestMessages(SessionConfig sessionConfig, java.lang.String conversationId, java.lang.String chatUserId, int maxMessages, boolean getMessagesToModerate, java.util.Date greaterThanDate, ITransaction transaction) throws PortalException
Deprecated.Since 4.0.11 this method was replaced bygetLatestMessages(SessionConfig, String, String, int, int, boolean, Date, ITransaction)
.Returns up to maxMessages messageConfigs for a given conversationId. If more than maxMessages exist, the most recent messages are returned. The messages are returned ordered by creation date.- Parameters:
sessionConfig
- the user session information.conversationId
- the conversation identifier.chatUserId
- the chat user identifier. If null no private messages are returned. If specified the private messages for that user are returned.maxMessages
- the maximum number of messages to be returned.getMessagesToModerate
- if true the messages to moderate are also returned.greaterThanDate
- if not null, only the message with sent date-time greater than this argument are returned.transaction
- the transaction for persistence access.- Returns:
- the messages.
- Throws:
PortalException
-
getLatestMessages
java.util.List<ChatMessageConfig> getLatestMessages(SessionConfig sessionConfig, java.lang.String conversationId, java.lang.String chatUserId, int firstMessageIndex, int maxMessages, boolean getMessagesToModerate, java.util.Date greaterThanDate, ITransaction transaction) throws PortalException
Returns up to maxMessages messageConfigs for a given conversationId. If more than maxMessages exist, the most recent messages are returned. The messages returned start at thefirstMessage
zero-based index. The messages are returned ordered by descending sent date-time.- Parameters:
sessionConfig
- the user session information.conversationId
- the conversation identifier.chatUserId
- the chat user identifier. If null no private messages are returned. If specified the private messages for that user are returned.firstMessageIndex
- the index of the first message to be returned. This index is zero based. May be used for pagination.maxMessages
- the maximum number of messages to be returned.getMessagesToModerate
- if true the messages to moderate are also returned.greaterThanDate
- if not null, only the message with sent date-time greater than this argument are returned.transaction
- the transaction for persistence access.- Returns:
- the list of messages.
- Throws:
PortalException
- Since:
- 4.0.11
-
getMessagesXml
java.lang.String getMessagesXml(SessionConfig sessionConfig, java.util.Collection<ChatMessageConfig> chatMessageConfigs, boolean getMessagesToModerate, java.util.List<IResource> resources, ITransaction transaction) throws PortalException
Returns the xml for the given messages. The collection's iterator ordering will be used.- Parameters:
sessionConfig
- the user session information.chatMessageConfigs
- the messages collection.getMessagesToModerate
- if true the messages to moderate are also returned.resources
- resources used for localization.transaction
- the transaction for persistence access.- Returns:
- the xml.
- Throws:
PortalException
- Since:
- 4.0.11
-
getLatestMessagesCount
int getLatestMessagesCount(SessionConfig sessionConfig, java.lang.String conversationId, java.lang.String chatUserId, boolean getMessagesToModerate, java.util.Date greaterThanDate, ITransaction transaction) throws PortalException
Returns the number of messages that exists and would be available for the#getLatestMessages(String, String, int, int, boolean, Date, ITransaction)
method.- Parameters:
sessionConfig
- the user session information.conversationId
- the conversation identifier.chatUserId
- the chat user identifier. If null no private messages are returned. If specified the private messages for that user are returned.getMessagesToModerate
- if true the messages to moderate are also returned.greaterThanDate
- if not null, only the message with sent date-time greater than this argument are returned.transaction
- the transaction for persistence access.- Returns:
- the number of messages.
- Throws:
PortalException
- Since:
- 4.0.11
-
deleteMessage
void deleteMessage(SessionConfig sessionConfig, java.lang.String messageId, ITransaction transaction) throws PortalException
Deletes the given message Id from its conversation.- Parameters:
sessionConfig
-messageId
-transaction
-- Throws:
PortalException
-
updateLastAccess
void updateLastAccess(SessionConfig sessionConfig, java.lang.String chatUserId, ITransaction transaction) throws PortalException
Updates the last access date for the given chat user.- Parameters:
sessionConfig
-transaction
-- Throws:
PortalException
-
userLeftConversation
void userLeftConversation(SessionConfig sessionConfig, ChatUserConfig chatUserConfig, ITransaction transaction) throws PortalException
Method to indicate that a user left the conversation- Parameters:
sessionConfig
-chatUserConfig
-transaction
-- Throws:
PortalException
-
-