Package org.silverpeas.core.web.session
Class UserSessionServerEvent
- java.lang.Object
-
- org.silverpeas.core.notification.sse.AbstractServerEvent
-
- org.silverpeas.core.notification.sse.CommonServerEvent
-
- org.silverpeas.core.web.session.UserSessionServerEvent
-
- All Implemented Interfaces:
AfterSentToAllContexts
,KeepAlwaysLastStored
,SendEveryAmountOfTime
,StoreLastOnly
,ServerEvent
public class UserSessionServerEvent extends CommonServerEvent implements KeepAlwaysLastStored, AfterSentToAllContexts, SendEveryAmountOfTime
This server event is sent on successful user session opening and on user session ending.- Author:
- Yohann Chastagnier.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.notification.sse.ServerEvent
ServerEvent.ServerEventName
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterAllContexts()
Called just after the sending to all context process.String
getData(String receiverSessionId, User receiver)
The data to send.ServerEvent.ServerEventName
getName()
Gets the name of the server event.boolean
hasWaitingFor()
Indicates of theServerEvent
has already been waiting for send.boolean
isConcerned(String receiverSessionId, User receiver)
Indicates if the given receiver (behind the session) is concerned by the event.void
markAsWaitingFor()
Indicates that theServerEvent
will be waiting for a while before to be sent.String
subType()
Gets the sub type the event if any.-
Methods inherited from class org.silverpeas.core.notification.sse.CommonServerEvent
getEventSourceURIs
-
Methods inherited from class org.silverpeas.core.notification.sse.AbstractServerEvent
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
getId, isValidId, send
-
Methods inherited from interface org.silverpeas.core.notification.sse.behavior.StoreLastOnly
getStoreDiscriminator
-
-
-
-
Method Detail
-
hasWaitingFor
public boolean hasWaitingFor()
Description copied from interface:SendEveryAmountOfTime
Indicates of theServerEvent
has already been waiting for send.- Specified by:
hasWaitingFor
in interfaceSendEveryAmountOfTime
- Returns:
- true if it has already, false otherwise.
-
markAsWaitingFor
public void markAsWaitingFor()
Description copied from interface:SendEveryAmountOfTime
Indicates that theServerEvent
will be waiting for a while before to be sent.- Specified by:
markAsWaitingFor
in interfaceSendEveryAmountOfTime
-
getName
public ServerEvent.ServerEventName getName()
Description copied from interface:ServerEvent
Gets the name of the server event.- Specified by:
getName
in interfaceServerEvent
- Returns:
- the name as unique
ServerEvent.ServerEventName
instance.
-
subType
public String subType()
Description copied from interface:ServerEvent
Gets the sub type the event if any.- Specified by:
subType
in interfaceServerEvent
- Returns:
- the sub type of the event if any, empty string otherwise.
-
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.- Specified by:
isConcerned
in interfaceServerEvent
- 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.
-
getData
public String getData(String receiverSessionId, User receiver)
Description copied from interface:ServerEvent
The data to send.- Specified by:
getData
in interfaceServerEvent
- Overrides:
getData
in classAbstractServerEvent
- Parameters:
receiverSessionId
- the identifier of the receiver session.receiver
- the user that will receive the event in its WEB client.- Returns:
- the data as string.
-
afterAllContexts
public void afterAllContexts()
Description copied from interface:AfterSentToAllContexts
Called just after the sending to all context process.- Specified by:
afterAllContexts
in interfaceAfterSentToAllContexts
-
-