Package org.javlo.service
Class NotificationService
- java.lang.Object
-
- org.javlo.service.NotificationService
-
public class NotificationService extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NotificationService.Notification
static class
NotificationService.NotificationContainer
-
Constructor Summary
Constructors Constructor Description NotificationService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNotification(String message, int type, String userId, boolean admin)
void
addNotification(String message, String url, int type, String userId, boolean admin)
add a notification.void
addNotification(String message, String url, int type, String userId, String receiver, boolean admin)
void
addSystemNotification(ContentContext ctx, String message, int type, boolean admin)
void
clearList()
static NotificationService
getInstance(GlobalContext globalContext)
List<NotificationService.NotificationContainer>
getNotifications(int maxSize)
List<NotificationService.NotificationContainer>
getNotifications(String userId, boolean admin, int maxSize, boolean markRead)
int
getUnreadNotificationSize(String userId, boolean admin, int maxSize)
void
markAllAsRead(String userId)
static void
notifExternalService(ContentContext ctx, String message, int type, String inURL, String userId, boolean admin)
static void
notifExternalService(ContentContext ctx, String message, int type, String inURL, String userId, boolean admin, Collection<String> targetUsers)
int
size()
-
-
-
Method Detail
-
getInstance
public static final NotificationService getInstance(GlobalContext globalContext)
-
clearList
public void clearList()
-
markAllAsRead
public void markAllAsRead(String userId)
-
getNotifications
public List<NotificationService.NotificationContainer> getNotifications(String userId, boolean admin, int maxSize, boolean markRead)
-
getNotifications
public List<NotificationService.NotificationContainer> getNotifications(int maxSize)
-
size
public int size()
-
getUnreadNotificationSize
public int getUnreadNotificationSize(String userId, boolean admin, int maxSize)
-
addNotification
public void addNotification(String message, int type, String userId, boolean admin)
-
addSystemNotification
public void addSystemNotification(ContentContext ctx, String message, int type, boolean admin)
-
notifExternalService
public static void notifExternalService(ContentContext ctx, String message, int type, String inURL, String userId, boolean admin)
-
notifExternalService
public static void notifExternalService(ContentContext ctx, String message, int type, String inURL, String userId, boolean admin, Collection<String> targetUsers)
-
addNotification
public void addNotification(String message, String url, int type, String userId, boolean admin)
add a notification.- Parameters:
message
- the message of the notificationurl
- a url with more information (can be null)type
- the type of the message (same type than GenericMessage)userId
- a notification can be specific for a user or for everybody (userId null)
-
-