Package org.cyclos.security.messaging
Class MessageServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.messaging.MessageServiceSecurity
-
- All Implemented Interfaces:
MessageService,Service
@Security public class MessageServiceSecurity extends BaseServiceSecurity implements MessageService
Security layer forMessageService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description MessageServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountNewMessages()Return messages count since the last time seenintcountUnreadMessages()Return unread messages countMessageDatagetData(Long id)Returns details data for the given messageMessageSearchDatagetSearchData()Returns data used to search messagesSendMessageDatagetSendData(Long replyId, UserLocatorVO toUserVO)Returns data for sending a message.SendInviteMessageDatagetSendInviteMessageData()Returns data for sending an invite messagevoidmarkAsRead(Set<Long> ids, boolean isRead)Marks all the given message as either read or as unreadvoidmoveToTrash(Set<Long> ids)Moves all the given messages to the trash binvoidremoveAll(Set<Long> ids)Permanently removes all the given messagesprotected EntityCheck<?>resolveEntityCheck()Must be implemented in order to return theEntityCheckmanaged by this security component, or null if nonevoidrestoreAll(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(MessageQuery query)Searches for messages according to the given criteriavoidsend(SendMessageDTO params)Sends a messagevoidsendInviteMessage(SendInviteMessageDTO inviteMessageDTO)Sends an invitation message to the destination addresses-
Methods inherited from class org.cyclos.security.BaseServiceSecurity
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initialize
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
countNewMessages
public int countNewMessages() throws FrameworkExceptionDescription copied from interface:MessageServiceReturn messages count since the last time seen- Specified by:
countNewMessagesin interfaceMessageService- Throws:
FrameworkException
-
countUnreadMessages
public int countUnreadMessages()
Description copied from interface:MessageServiceReturn unread messages count- Specified by:
countUnreadMessagesin interfaceMessageService
-
getData
public MessageData getData(Long id) throws FrameworkException
Description copied from interface:MessageServiceReturns details data for the given message- Specified by:
getDatain interfaceMessageService- Throws:
FrameworkException
-
getSearchData
public MessageSearchData getSearchData()
Description copied from interface:MessageServiceReturns data used to search messages- Specified by:
getSearchDatain interfaceMessageService
-
getSendData
public SendMessageData getSendData(Long replyId, UserLocatorVO toUserVO)
Description copied from interface:MessageServiceReturns 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.- Specified by:
getSendDatain interfaceMessageService
-
getSendInviteMessageData
public SendInviteMessageData getSendInviteMessageData()
Description copied from interface:MessageServiceReturns data for sending an invite message- Specified by:
getSendInviteMessageDatain interfaceMessageService
-
markAsRead
public void markAsRead(Set<Long> ids, boolean isRead)
Description copied from interface:MessageServiceMarks all the given message as either read or as unread- Specified by:
markAsReadin interfaceMessageService
-
moveToTrash
public void moveToTrash(Set<Long> ids)
Description copied from interface:MessageServiceMoves all the given messages to the trash bin- Specified by:
moveToTrashin interfaceMessageService
-
removeAll
public void removeAll(Set<Long> ids)
Description copied from interface:MessageServicePermanently removes all the given messages- Specified by:
removeAllin interfaceMessageService
-
restoreAll
public void restoreAll(Set<Long> ids)
Description copied from interface:MessageServiceRestores the given messages, that is, move them from the trash bin to the original message box (either inbox or sent items)- Specified by:
restoreAllin interfaceMessageService
-
search
public Page<MessageVO> search(MessageQuery query)
Description copied from interface:MessageServiceSearches for messages according to the given criteria- Specified by:
searchin interfaceMessageService
-
send
public void send(SendMessageDTO params)
Description copied from interface:MessageServiceSends a message- Specified by:
sendin interfaceMessageService
-
sendInviteMessage
public void sendInviteMessage(SendInviteMessageDTO inviteMessageDTO)
Description copied from interface:MessageServiceSends an invitation message to the destination addresses- Specified by:
sendInviteMessagein interfaceMessageService
-
resolveEntityCheck
protected EntityCheck<?> resolveEntityCheck()
Description copied from class:BaseServiceSecurityMust be implemented in order to return theEntityCheckmanaged by this security component, or null if none- Specified by:
resolveEntityCheckin classBaseServiceSecurity
-
-