Interface IChatManager

  • All Known Implementing Classes:
    ChatManager

    @StableMinor(version="14.0",
                 sinceVersion="4.0")
    public interface IChatManager
    Interface for managing Chat Objects
    Since:
    4.0.5
    Version:
    $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
    • Method Detail

      • 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
      • 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
      • getLatestMessages

        @Deprecated
        List<ChatMessageConfig> getLatestMessages​(SessionConfig sessionConfig,
                                                  String conversationId,
                                                  String chatUserId,
                                                  int maxMessages,
                                                  boolean getMessagesToModerate,
                                                  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 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

        List<ChatMessageConfig> getLatestMessages​(SessionConfig sessionConfig,
                                                  String conversationId,
                                                  String chatUserId,
                                                  int firstMessageIndex,
                                                  int maxMessages,
                                                  boolean getMessagesToModerate,
                                                  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 the firstMessage 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

        String getMessagesXml​(SessionConfig sessionConfig,
                              Collection<ChatMessageConfig> chatMessageConfigs,
                              boolean getMessagesToModerate,
                              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,
                                   String conversationId,
                                   String chatUserId,
                                   boolean getMessagesToModerate,
                                   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