Class InternalMessageService

java.lang.Object
com.eurodyn.qlack.fuse.mailing.service.InternalMessageService

@Service @Validated @Transactional public class InternalMessageService extends Object
Provide internal messages related services. For details regarding the functionality offered see the respective interfaces.
Author:
European Dynamics SA.
  • Constructor Details

  • Method Details

    • sendInternalMail

      public String sendInternalMail(InternalMessageDTO dto)
      Send a new internal message.
      Parameters:
      dto - - the internal message data
      Returns:
      - an InternalMessageDTO object
    • getInternalInboxFolder

      public List<InternalMessageDTO> getInternalInboxFolder(String userId)
      Get the Inbox.
      Parameters:
      userId - - the person that the message was sent to
      Returns:
      a list of InternalMessageDTO
    • getInternalSentFolder

      public List<InternalMessageDTO> getInternalSentFolder(String userId)
      Get the sent folder.
      Parameters:
      userId - - the person that sent the message
      Returns:
      a list of messages
    • getMailCount

      public long getMailCount(String userId, String status)
      Get the number of the messages
      Parameters:
      userId - - the person that the message was sent to
      status - - the status (read, unread, replied)
      Returns:
      the No of messages.
    • markMessageAsRead

      public void markMessageAsRead(String messageId)
      Mark a message as Read
      Parameters:
      messageId - - the message Id
    • markMessageAsReplied

      public void markMessageAsReplied(String messageId)
      Mark a message as Replied.
      Parameters:
      messageId - - the message Id
    • markMessageAsUnread

      public void markMessageAsUnread(String messageId)
      Mark a message as Unread.
      Parameters:
      messageId - - the message Id
    • deleteMessage

      public void deleteMessage(String messageId, String folderType)
      Delete a message. Depending on the folder type (inbox or sent) this method perform the following:
      • if the folder that contains the message is the inbox and the sender has already deleted the message, then the message is permanently removed from the system.
      • if the folder that contains the message is the inbox and the sender has not deleted the message, then the message is marked as "deleted from the sender".
      • if the folder that contains the message is the sent folder and the receiver has already deleted the message, then the message is permanently removed from the system.
      • if the folder that contains the message is the sent folder and the receiver has not deleted the message, then the message is marked as "deleted from the receiver".
      Parameters:
      messageId - - the message Id
      folderType - - the folder type (inbox or sent)
    • getInternalMessage

      public InternalMessageDTO getInternalMessage(String messageId)
      View the details of a message.
      Parameters:
      messageId - - the message Id
      Returns:
      the message
    • getInternalMessageAttachments

      public List<InternalAttachmentDTO> getInternalMessageAttachments(String messageId)
      Get the attachments of a message based on its id.
      Parameters:
      messageId - the id of the message
      Returns:
      a list containing the attachements
    • getInternalAttachment

      public InternalAttachmentDTO getInternalAttachment(String attachmentId)
      Get an attachment based on its Id.
      Parameters:
      attachmentId - - the attachment Id.
      Returns:
      the attachment