Class FormRecordChat

    • Constructor Detail

      • FormRecordChat

        public FormRecordChat()
    • Method Detail

      • getId

        public Long getId()
        Specified by:
        getId in interface de.xima.cmn.dao.interfaces.IEntity<Long>
      • getUUID

        public String getUUID()
        Gets the UUID of this chat. The UUID must be globally unique among all form records and all clients.
        Specified by:
        getUUID in interface IUUIDEntity
        Returns:
        The UUID of this chat.
      • setUUID

        public void setUUID​(String uuid)
        Sets the UUID of this chat. The UUID must be globally unique among all form records and all clients.
        Specified by:
        setUUID in interface IUUIDEntity
        Parameters:
        uuid - The UUID of this chat.
      • getUUIDObject

        public UUID getUUIDObject()
        Gets the UUID of this chat. The UUID must be globally unique among all form records and all clients.
        Specified by:
        getUUIDObject in interface IUUIDEntity
        Returns:
        The UUID of this chat.
      • setUUIDObject

        public void setUUIDObject​(UUID uuid)
        Sets the UUID of this chat. The UUID must be globally unique among all form records and all clients.
        Parameters:
        uuid - The UUID of this chat.
      • getFormRecord

        public Vorgang getFormRecord()
      • setFormRecord

        public void setFormRecord​(Vorgang formRecord)
      • getCreatedInstant

        public Instant getCreatedInstant()
      • setCreatedInstant

        public void setCreatedInstant​(Instant createdInstant)
      • isOpen

        public boolean isOpen()
      • setOpen

        public void setOpen​(boolean open)
      • setMember

        public void setMember​(FormRecordAccess access)
        Sets the member to this chat
        Parameters:
        access - The access to set.
      • addMessage

        public void addMessage​(FormRecordMessage message)
        Adds a message to this chat, and set this chat on the message.
        Parameters:
        message - The message to add.
      • getSenderMessages

        public List<FormRecordMessage> getSenderMessages​(IUser sender)
        Returns all messages sent by the given user.
        Parameters:
        sender - the user that sent the messages.
        Returns:
        a list of all the messages sent by the given user ordered by their submit date.
      • getUnreadMessageCount

        public int getUnreadMessageCount​(IUser user)
        Returns the number of unread messages in the chat for the given user.
        Parameters:
        user - The user to get the unread message count for.
        Returns:
        The number of unread messages in the chat for the given user.
      • getUnreadMessageCount

        public int getUnreadMessageCount​(IUserRef userRef)
        Returns the number of unread messages in the chat for the given user.
        Parameters:
        userRef - The user reference to get the unread message count for.
        Returns:
        The number of unread messages in the chat for the given user.
      • getUnreadMessages

        @NotNull
        public @NotNull List<FormRecordMessage> getUnreadMessages​(IUser user)
        Returns all unread messages in the chat for the given user.
        Parameters:
        user - The user to get the unread messages for.
        Returns:
        The unread messages in the chat for the given user.
      • getUnreadMessages

        @NotNull
        public @NotNull List<FormRecordMessage> getUnreadMessages​(IUserRef userRef)
        Returns all unread messages in the chat for the given user.
        Parameters:
        userRef - The user reference to get the unread messages for.
        Returns:
        The unread messages in the chat for the given user.
      • isRead

        public boolean isRead​(IUser user)
        Returns whether all messages in the chat are read by the given user.
        Parameters:
        user - The user to check the read state for.
        Returns:
        true if all messages in the chat are read by the given user and false if there is at least one unread message.
      • isRead

        public boolean isRead​(IUserRef userRef)
        Returns whether all messages in the chat are read by the given user.
        Parameters:
        userRef - The user reference to check the read state for.
        Returns:
        true if all messages in the chat are read by the given user and false if there is at least one unread message.
      • getDisplayName

        public String getDisplayName​(Locale locale)
        Returns the display name of this chat in the context of the given user portal and locale.
        Parameters:
        locale - The locale to get the display name for.
        Returns:
        The display name of this chat in the context of the given user portal and locale.
      • isMember

        public boolean isMember​(IUser user)
        Returns whether a user is a member of this chat and can therefore receive its messages.
        Parameters:
        user - to check.
        Returns:
        true if the given user is a member of this chat and false otherwise.
      • isMember

        public boolean isMember​(IUserRef userRef)
        Returns whether a user reference is a member of this chat and can therefore receive its messages.
        Parameters:
        userRef - to check.
        Returns:
        true if the given user reference is a member of this chat and false otherwise.
      • markRead

        @Deprecated
        public void markRead​(UserProfile profile)
        Deprecated.
        Use markRead(IUser) instead.
        Marks all messages in this chat as read for the given user.
        Parameters:
        profile - The user profile to mark the messages as read for.
      • markRead

        public void markRead​(IUser user)
        Marks all messages in this chat as read for the given user.
        Parameters:
        user - The user to mark the messages as read for.
      • markAsReadByInboxUser

        public void markAsReadByInboxUser()
        Marks all messages in this chat as read by an inbox user.
      • setMemberRefs

        @Deprecated
        public void setMemberRefs​(Set<String> memberRefs)
        Deprecated.
        Does nothing. Use setMembers(Set) instead
        Parameters:
        memberRefs - the member references
      • setMemberProfiles

        @Deprecated
        public void setMemberProfiles​(Set<UserProfile> memberProfiles)
        Deprecated.
        Does nothing. Use setMembers(Set) instead
        Parameters:
        memberProfiles - the member profiles