Class SILVERMAILPersistence
- java.lang.Object
-
- org.silverpeas.core.notification.user.server.channel.silvermail.SILVERMAILPersistence
-
public class SILVERMAILPersistence extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
countNotReadMessagesOfFolder(String userId, String folderName)
static void
deleteAllMessagesInFolder(String currentUserId)
static void
deleteMessage(String userId, long msgId)
Deletes a message by its identifier.static void
deleteMessages(String currentUserId, Collection<String> ids)
static SILVERMAILMessage
getMessage(String userId, long msgId)
Gets a message by its identifier.static SILVERMAILMessage
getMessageAndMarkAsRead(String userId, long msgId)
Gets a message by its identifier and mark it as read.static SilverpeasList<SILVERMAILMessage>
getMessageOfFolder(String userId, String folderName, PaginationPage pagination, SilvermailCriteria.QUERY_ORDER_BY orderBy)
static void
markAllMessagesAsRead(String currentUserId)
static void
markMessagesAsRead(String currentUserId, Collection<String> ids)
-
-
-
Method Detail
-
countNotReadMessagesOfFolder
public static long countNotReadMessagesOfFolder(String userId, String folderName)
-
getMessageOfFolder
public static SilverpeasList<SILVERMAILMessage> getMessageOfFolder(String userId, String folderName, PaginationPage pagination, SilvermailCriteria.QUERY_ORDER_BY orderBy)
-
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)
-
deleteMessages
public static void deleteMessages(String currentUserId, Collection<String> ids)
-
markMessagesAsRead
public static void markMessagesAsRead(String currentUserId, Collection<String> ids)
-
-