Class InternalMessageService
java.lang.Object
com.eurodyn.qlack.fuse.mailing.service.InternalMessageService
Provide internal messages related services. For details regarding the
functionality offered see the respective interfaces.
- Author:
- European Dynamics SA.
-
Constructor Summary
ConstructorDescriptionInternalMessageService
(InternalMessagesRepository internalMessagesRepository, InternalAttachmentRepository internalAttachmentRepository, InternalMessageMapper internalMessageMapper, InternalAttachmentMapper internalAttachmentMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteMessage
(String messageId, String folderType) Delete a message.getInternalAttachment
(String attachmentId) Get an attachment based on its Id.getInternalInboxFolder
(String userId) Get the Inbox.getInternalMessage
(String messageId) View the details of a message.getInternalMessageAttachments
(String messageId) Get the attachments of a message based on its id.getInternalSentFolder
(String userId) Get the sent folder.long
getMailCount
(String userId, String status) Get the number of the messagesvoid
markMessageAsRead
(String messageId) Mark a message as Readvoid
markMessageAsReplied
(String messageId) Mark a message as Replied.void
markMessageAsUnread
(String messageId) Mark a message as Unread.Send a new internal message.
-
Constructor Details
-
InternalMessageService
public InternalMessageService(InternalMessagesRepository internalMessagesRepository, InternalAttachmentRepository internalAttachmentRepository, InternalMessageMapper internalMessageMapper, InternalAttachmentMapper internalAttachmentMapper)
-
-
Method Details
-
sendInternalMail
Send a new internal message.- Parameters:
dto
- - the internal message data- Returns:
- - an InternalMessageDTO object
-
getInternalInboxFolder
Get the Inbox.- Parameters:
userId
- - the person that the message was sent to- Returns:
- a list of InternalMessageDTO
-
getInternalSentFolder
Get the sent folder.- Parameters:
userId
- - the person that sent the message- Returns:
- a list of messages
-
getMailCount
Get the number of the messages- Parameters:
userId
- - the person that the message was sent tostatus
- - the status (read, unread, replied)- Returns:
- the No of messages.
-
markMessageAsRead
Mark a message as Read- Parameters:
messageId
- - the message Id
-
markMessageAsReplied
Mark a message as Replied.- Parameters:
messageId
- - the message Id
-
markMessageAsUnread
Mark a message as Unread.- Parameters:
messageId
- - the message Id
-
deleteMessage
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 IdfolderType
- - the folder type (inbox or sent)
-
getInternalMessage
View the details of a message.- Parameters:
messageId
- - the message Id- Returns:
- the message
-
getInternalMessageAttachments
Get the attachments of a message based on its id.- Parameters:
messageId
- the id of the message- Returns:
- a list containing the attachements
-
getInternalAttachment
Get an attachment based on its Id.- Parameters:
attachmentId
- - the attachment Id.- Returns:
- the attachment
-