Class UserNotificationServerEvent
- java.lang.Object
-
- org.silverpeas.core.notification.sse.AbstractServerEvent
-
- org.silverpeas.core.notification.sse.CommonServerEvent
-
- org.silverpeas.core.notification.user.UserNotificationServerEvent
-
- All Implemented Interfaces:
ServerEvent
public class UserNotificationServerEvent extends CommonServerEvent
This server event is sent on the reception of a user notification.- Author:
- Yohann Chastagnier.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.notification.sse.ServerEvent
ServerEvent.ServerEventName
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserNotificationServerEvent
clean(String emitterUserId)
static UserNotificationServerEvent
creationOf(String emitterUserId, String notificationId, String subject, String sender)
static UserNotificationServerEvent
deletionOf(String emitterUserId, String notificationId)
String
getEmitterUserId()
Gets the identifier of the emitter of the notification.ServerEvent.ServerEventName
getName()
Gets the name of the server event.static int
getNbUnreadFor(String userId)
Gets the number of unread message of user represented by the given identifier.boolean
isConcerned(String receiverSessionId, User receiver)
Indicates if the given receiver (behind the session) is concerned by the event.static UserNotificationServerEvent
readOf(String emitterUserId, String notificationId, String subject, String sender)
-
Methods inherited from class org.silverpeas.core.notification.sse.CommonServerEvent
getEventSourceURIs
-
Methods inherited from class org.silverpeas.core.notification.sse.AbstractServerEvent
getData, getId, send, toString, withData, withData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.notification.sse.ServerEvent
isValidId, subType
-
-
-
-
Method Detail
-
creationOf
public static UserNotificationServerEvent creationOf(String emitterUserId, String notificationId, String subject, String sender)
-
readOf
public static UserNotificationServerEvent readOf(String emitterUserId, String notificationId, String subject, String sender)
-
deletionOf
public static UserNotificationServerEvent deletionOf(String emitterUserId, String notificationId)
-
clean
public static UserNotificationServerEvent clean(String emitterUserId)
-
getNbUnreadFor
public static int getNbUnreadFor(String userId)
Gets the number of unread message of user represented by the given identifier.- Parameters:
userId
- the identifier of a user.- Returns:
- a number of unread message.
-
getName
public ServerEvent.ServerEventName getName()
Description copied from interface:ServerEvent
Gets the name of the server event.- Returns:
- the name as unique
ServerEvent.ServerEventName
instance.
-
getEmitterUserId
public String getEmitterUserId()
Gets the identifier of the emitter of the notification.Please verify the use of this method by mobile services before modifying or deleting it.
- Returns:
- an identifier as string.
-
isConcerned
public boolean isConcerned(String receiverSessionId, User receiver)
Description copied from interface:ServerEvent
Indicates if the given receiver (behind the session) is concerned by the event. If not, the event is not sent.- Parameters:
receiverSessionId
- the identifier of the receiver session.receiver
- the user that will receive the event in its WEB client.- Returns:
- true if given receiver is concerned, false otherwise.
-
-