Class SILVERMAILPersistence


  • public class SILVERMAILPersistence
    extends Object
    • Method Detail

      • countNotReadMessagesOfFolder

        public static long countNotReadMessagesOfFolder​(String userId,
                                                        String folderName)
      • getMessage

        public static SILVERMAILMessage getMessage​(String userId,
                                                   long msgId)
        Gets a message by its identifier.
        Parameters:
        userId - the identifier of the user owning the message.
        msgId - the message identifier.
        Throws:
        org.silverpeas.kernel.exception.NotFoundException - if message with given identifier does not exist.
        ForbiddenRuntimeException - if message with given identifier is not owned by the user with the given identifier.
      • getMessageAndMarkAsRead

        public static SILVERMAILMessage getMessageAndMarkAsRead​(String userId,
                                                                long msgId)
        Gets a message by its identifier and mark it as read.
        Parameters:
        userId - the identifier of the user owning the message.
        msgId - the message identifier.
        Throws:
        org.silverpeas.kernel.exception.NotFoundException - if message with given identifier does not exist.
        ForbiddenRuntimeException - if message with given identifier is not owned by the user with the given identifier.
      • deleteMessage

        public static void deleteMessage​(String userId,
                                         long msgId)
        Deletes a message by its identifier.
        Parameters:
        userId - the identifier of the user owning the message.
        msgId - the identifier of the message to delete.
        Throws:
        org.silverpeas.kernel.exception.NotFoundException - if message with given identifier does not exist.
        ForbiddenRuntimeException - if message with given identifier is not owned by the user with the given identifier.
      • deleteAllMessagesInFolder

        public static void deleteAllMessagesInFolder​(String currentUserId)
      • markAllMessagesAsRead

        public static void markAllMessagesAsRead​(String currentUserId)
      • markMessagesAsRead

        public static void markMessagesAsRead​(String currentUserId,
                                              Collection<String> ids)