Package org.cyclos.services.messaging
Interface MessageService
-
- All Superinterfaces:
Service
- All Known Subinterfaces:
MessageServiceLocal
- All Known Implementing Classes:
MessageServiceImpl,MessageServiceSecurity
public interface MessageService extends Service
Service used to manage messages between users
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcountNewMessages()Return messages count since the last time seenintcountUnreadMessages()Return unread messages countMessageDatagetData(@NotNull Long id)Returns details data for the given messageMessagesStatusVOgetMessagesStatus()Returns the messages status containing the unread/new messages and the last view date.
The last view date is updated through theUserValidationService.updateUserActivity(org.cyclos.model.users.users.UserActivityType)method with the parameterUserActivityType.MESSAGE.MessageSearchDatagetSearchData()Returns data used to search messagesSendMessageDatagetSendData(Long replyId, UserLocatorVO toUser)Returns data for sending a message.voidmarkAsRead(@NotNull Set<Long> ids, boolean isRead)Marks all the given message as either read or as unreadvoidmoveToTrash(@NotNull Set<Long> ids)Moves all the given messages to the trash binvoidremoveAll(@NotNull Set<Long> ids)Permanently removes all the given messagesvoidrestoreAll(@NotNull Set<Long> ids)Restores the given messages, that is, move them from the trash bin to the original message box (either inbox or sent items)Page<MessageVO>search(@NotNull MessageQuery query)Searches for messages according to the given criterialongsend(@NotNull SendMessageDTO sendMessage)Sends a message and returns the id of the outgoing message
-
-
-
Method Detail
-
countNewMessages
int countNewMessages() throws FrameworkExceptionReturn messages count since the last time seen- Throws:
FrameworkException
-
countUnreadMessages
int countUnreadMessages() throws FrameworkExceptionReturn unread messages count- Throws:
FrameworkException
-
getData
MessageData getData(@NotNull @NotNull Long id) throws FrameworkException
Returns details data for the given message- Throws:
FrameworkException
-
getMessagesStatus
MessagesStatusVO getMessagesStatus() throws FrameworkException
Returns the messages status containing the unread/new messages and the last view date.
The last view date is updated through theUserValidationService.updateUserActivity(org.cyclos.model.users.users.UserActivityType)method with the parameterUserActivityType.MESSAGE.- Throws:
FrameworkException
-
getSearchData
MessageSearchData getSearchData() throws FrameworkException
Returns data used to search messages- Throws:
FrameworkException
-
getSendData
SendMessageData getSendData(Long replyId, UserLocatorVO toUser) throws FrameworkException
Returns data for sending a message. If replyId is given, the new message will be a reply for that one. If toUser is given, the message will be to that specific user.- Throws:
FrameworkException
-
markAsRead
void markAsRead(@NotNull @NotNull Set<Long> ids, boolean isRead) throws FrameworkExceptionMarks all the given message as either read or as unread- Throws:
FrameworkException
-
moveToTrash
void moveToTrash(@NotNull @NotNull Set<Long> ids) throws FrameworkExceptionMoves all the given messages to the trash bin- Throws:
FrameworkException
-
removeAll
void removeAll(@NotNull @NotNull Set<Long> ids) throws FrameworkExceptionPermanently removes all the given messages- Throws:
FrameworkException
-
restoreAll
void restoreAll(@NotNull @NotNull Set<Long> ids) throws FrameworkExceptionRestores the given messages, that is, move them from the trash bin to the original message box (either inbox or sent items)- Throws:
FrameworkException
-
search
Page<MessageVO> search(@NotNull @NotNull MessageQuery query) throws FrameworkException
Searches for messages according to the given criteria- Throws:
FrameworkException
-
send
long send(@NotNull @NotNull SendMessageDTO sendMessage) throws FrameworkExceptionSends a message and returns the id of the outgoing message- Throws:
FrameworkException
-
-