Interface MessageService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<Chat> createChat​(Chat chat)
      This method creates a database entity.
      java.util.Optional<Chat> createChat​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> chatAsMap)
      This method creates a database entity.
      java.util.Optional<Chat> createChatAndNotify​(Chat chat)
      This method creates a database entity.
      java.util.Optional<Chat> createChatAndNotify​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> chatAsMap)
      This method creates a database entity.
      java.util.Optional<Message> createMessage​(Message message)
      This method creates a database entity.
      java.util.Optional<Message> createMessage​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> messageAsMap)
      This method creates a database entity.
      java.util.Optional<Message> createMessageAndNotify​(Message message)
      This method creates a database entity.
      java.util.Optional<Message> createMessageAndNotify​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> messageAsMap)
      This method creates a database entity.
      java.util.List<Profile> getActiveContacts​(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)
      This method returns list database entities.
      java.util.List<Message> getConversationByChatId​(java.lang.String chatId)
      This method returns list database entities.
      java.util.Map<java.lang.String,​java.lang.Object> getConversationPartner​(java.lang.String chatId)
      This method returns data as map.
      Message getLastMessageInChat​(java.lang.String chatId)
      This method returns a database entity.
      java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getMessagesTimeline​(java.lang.String queryExpression, java.lang.String searchTerm, java.lang.String sortName, java.lang.Integer offset, java.lang.Integer limit)
      This method retrieves a map, which can be processed in a templates.
      java.util.Map<java.lang.String,​java.lang.String> getUnreadMessagesCount​(java.lang.String chatId)
      This method does return count a database entities.
      java.util.Map<java.lang.String,​java.lang.String> getUnreadMessagesCountForUser​(java.lang.String chatId, java.lang.String profileId)
      This method does return count a database entities.
      boolean isAttachmentExist​(java.lang.String messageId)
      This method checks a database entity had attachment.
      boolean isContactOnline​(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)
      This method does check a database entity is online.
      boolean isContainsUnreadMessages​(java.lang.String chatId)
      This method does check a database entity contains to other database entity.
      boolean isNotContactOnline​(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)
      This method does check a database entity is not online.
      boolean isReplyMessage​(java.lang.String login)
      This method check a database entity status.
      boolean isRightSidedMessageAdmin​(java.lang.String messageId)
      This method checks a database entity belongs to other database entity.
      boolean isSentMessage​(java.lang.String login)
      This method check a database entity status.
      java.util.Optional<Chat> readChat​(java.lang.String chatId)
      This method returns a database entity.
      void removeAttachmentFromMessage​(java.lang.String messageId)
      This method removes relationship between database entities.
      void removeChatAndClean​(java.lang.String chatId)
      This method removes a database entity and clean all relationships from another entities.
      void removeMessageAndClean​(java.lang.String messageId)
      This method removes a database entity and clean all relationships from another entities.
      void removeMessageFromChatById​(java.lang.String messageId)
      This method removes database entity.
      void removeMessagesFromChat​(java.lang.String chatId)
      This method removes relationship between database entities.
      java.util.List<Chat> searchChats​(java.lang.String requestJson)
      This method does search requests and returns data as list.
      java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> searchMessages​(java.lang.String requestJson)
      This method retrieves a map, which can be processed in a templates.
    • Method Detail

      • searchChats

        java.util.List<Chat> searchChats​(java.lang.String requestJson)
        This method does search requests and returns data as list.
        Parameters:
        requestJson - search json
        Returns:
        database entities as list
      • searchMessages

        java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> searchMessages​(java.lang.String requestJson)
        This method retrieves a map, which can be processed in a templates.
        Parameters:
        requestJson - search json
        Returns:
        map-representation of data
      • createChatAndNotify

        java.util.Optional<Chat> createChatAndNotify​(Chat chat)
        This method creates a database entity.
        Parameters:
        chat - database entity
        Returns:
        optional value to externally interaction
      • createChatAndNotify

        java.util.Optional<Chat> createChatAndNotify​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> chatAsMap)
        This method creates a database entity.
        Parameters:
        chatAsMap - map-representation of database entity
        Returns:
        database entity
      • createChat

        java.util.Optional<Chat> createChat​(Chat chat)
        This method creates a database entity.
        Parameters:
        chat - database entity
        Returns:
        optional value to externally interaction
      • createChat

        java.util.Optional<Chat> createChat​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> chatAsMap)
        This method creates a database entity.
        Parameters:
        chatAsMap - map-representation of database entity
        Returns:
        database entity
      • createMessageAndNotify

        java.util.Optional<Message> createMessageAndNotify​(Message message)
        This method creates a database entity.
        Parameters:
        message - database entity
        Returns:
        optional value to externally interaction
      • createMessageAndNotify

        java.util.Optional<Message> createMessageAndNotify​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> messageAsMap)
        This method creates a database entity.
        Parameters:
        messageAsMap - map-representation of database entity
        Returns:
        database entity
      • createMessage

        java.util.Optional<Message> createMessage​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> messageAsMap)
        This method creates a database entity.
        Parameters:
        messageAsMap - map-representation of database entity
        Returns:
        database entity
      • createMessage

        java.util.Optional<Message> createMessage​(Message message)
        This method creates a database entity.
        Parameters:
        message - database entity
        Returns:
        optional value to externally interaction
      • readChat

        java.util.Optional<Chat> readChat​(java.lang.String chatId)
        This method returns a database entity.
        Parameters:
        chatId - database entity which will be checked and returned
        Returns:
        optional value to externally interaction
      • getConversationByChatId

        java.util.List<Message> getConversationByChatId​(java.lang.String chatId)
        This method returns list database entities.
        Parameters:
        chatId - identification for database entity from which will be filtered and returned other database entity
        Returns:
        database entities as list
      • getActiveContacts

        java.util.List<Profile> getActiveContacts​(java.lang.String dbName,
                                                  java.lang.String collection,
                                                  java.lang.String propertyName,
                                                  java.lang.String filter)
        This method returns list database entities.
        Parameters:
        dbName - name for database where will be checked
        collection - name for database collection where will be checked
        propertyName - field for database entity which will be added in JSON-Object for checked
        filter - field for database entity which will be filtered
        Returns:
        database entities as list
      • getConversationPartner

        java.util.Map<java.lang.String,​java.lang.Object> getConversationPartner​(java.lang.String chatId)
        This method returns data as map.
        Parameters:
        chatId - identification for filter and return data
        Returns:
        data as map
      • getMessagesTimeline

        java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getMessagesTimeline​(java.lang.String queryExpression,
                                                                                                   java.lang.String searchTerm,
                                                                                                   java.lang.String sortName,
                                                                                                   java.lang.Integer offset,
                                                                                                   java.lang.Integer limit)
        This method retrieves a map, which can be processed in a templates.
        Parameters:
        queryExpression - search query expression
        searchTerm - field name for database entity which will be filtered and searched
        sortName - value for database entity which will be sorted
        offset - offset for returned items
        limit - limit for returned items
        Returns:
        map-representation of data
      • getLastMessageInChat

        Message getLastMessageInChat​(java.lang.String chatId)
        This method returns a database entity.
        Parameters:
        chatId - database entity which will be filtered and returned
        Returns:
        database entity
      • isSentMessage

        boolean isSentMessage​(java.lang.String login)
        This method check a database entity status.
        Parameters:
        login - identification for database entity which will be checked
        Returns:
        value as boolean
      • isReplyMessage

        boolean isReplyMessage​(java.lang.String login)
        This method check a database entity status.
        Parameters:
        login - identification for database entity which will be checked
        Returns:
        value as boolean
      • isAttachmentExist

        boolean isAttachmentExist​(java.lang.String messageId)
        This method checks a database entity had attachment.
        Parameters:
        messageId - identification for database entity which will be checked
        Returns:
        value as boolean
      • removeChatAndClean

        void removeChatAndClean​(java.lang.String chatId)
        This method removes a database entity and clean all relationships from another entities.
        Parameters:
        chatId - identification for database entity which will be removed
      • removeAttachmentFromMessage

        void removeAttachmentFromMessage​(java.lang.String messageId)
        This method removes relationship between database entities.
        Parameters:
        messageId - identification for database entity which will be removed
      • removeMessagesFromChat

        void removeMessagesFromChat​(java.lang.String chatId)
        This method removes relationship between database entities.
        Parameters:
        chatId - identification for database entity which will be removed
      • removeMessageFromChatById

        void removeMessageFromChatById​(java.lang.String messageId)
        This method removes database entity.
        Parameters:
        messageId - database entity which will be removed
      • removeMessageAndClean

        void removeMessageAndClean​(java.lang.String messageId)
        This method removes a database entity and clean all relationships from another entities.
        Parameters:
        messageId - identification for database entity which will be removed
      • isRightSidedMessageAdmin

        boolean isRightSidedMessageAdmin​(java.lang.String messageId)
        This method checks a database entity belongs to other database entity.
        Parameters:
        messageId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isContainsUnreadMessages

        boolean isContainsUnreadMessages​(java.lang.String chatId)
        This method does check a database entity contains to other database entity.
        Parameters:
        chatId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isContactOnline

        boolean isContactOnline​(java.lang.String dbName,
                                java.lang.String collection,
                                java.lang.String propertyName,
                                java.lang.String filter)
        This method does check a database entity is online.
        Parameters:
        dbName - name for database where will be checked
        collection - name for database collection where will be checked
        propertyName - field for database entity which will be added in JSON-Object for checked
        filter - field for database entity which will be filtered
        Returns:
        value as boolean
      • isNotContactOnline

        boolean isNotContactOnline​(java.lang.String dbName,
                                   java.lang.String collection,
                                   java.lang.String propertyName,
                                   java.lang.String filter)
        This method does check a database entity is not online.
        Parameters:
        dbName - name for database where will be checked
        collection - name for database collection where will be checked
        propertyName - field for database entity which will be added in JSON-Object for checked
        filter - field for database entity which will be filtered
        Returns:
        value as boolean
      • getUnreadMessagesCount

        java.util.Map<java.lang.String,​java.lang.String> getUnreadMessagesCount​(java.lang.String chatId)
        This method does return count a database entities.
        Parameters:
        chatId - identification for database which will be checked and calculated
        Returns:
        value as map
      • getUnreadMessagesCountForUser

        java.util.Map<java.lang.String,​java.lang.String> getUnreadMessagesCountForUser​(java.lang.String chatId,
                                                                                             java.lang.String profileId)
        This method does return count a database entities.
        Parameters:
        chatId - identification for database which will be checked and calculated
        profileId - identification for database for which will be checked and calculated other database entity
        Returns:
        value as map