Package com.jgcomptech.tools.events
Class SessionEvent
- java.lang.Object
-
- com.jgcomptech.tools.events.Event
-
- com.jgcomptech.tools.events.SessionEvent
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class SessionEvent extends Event
- Since:
- 1.4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static EventType<SessionEvent>ANYCommon supertype for all permission event types.static EventType<SessionEvent>MULTI_SESSION_CLOSEDstatic EventType<SessionEvent>MULTI_SESSION_OPENEDstatic EventType<SessionEvent>SESSION_ADMIN_OVERRIDE_FAILUREstatic EventType<SessionEvent>SESSION_ADMIN_OVERRIDE_STARTEDstatic EventType<SessionEvent>SESSION_ADMIN_OVERRIDE_SUCCESSstatic EventType<SessionEvent>SESSION_CLOSEDstatic EventType<SessionEvent>SESSION_LOGIN_FAILUREstatic EventType<SessionEvent>SESSION_LOGIN_SUCCESSstatic EventType<SessionEvent>SESSION_OPENEDstatic EventType<SessionEvent>SESSION_USER_VERIFY_FAILUREstatic EventType<SessionEvent>SESSION_USER_VERIFY_STARTEDstatic EventType<SessionEvent>SESSION_USER_VERIFY_SUCCESS
-
Constructor Summary
Constructors Constructor Description SessionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType)Construct a newEventwith the specified event target and type.SessionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType, java.util.List<java.lang.Object> args)Construct a newEventwith the specified event target, type and args.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionEventcopyFor(java.lang.Object newSource, EventTarget<? extends Event> newTarget)Creates and returns a copy of this event with the specified event source and target.voidfireEvent(java.lang.Object source, UserAccount user)Fires the event with the specified source and user.voidfireEvent(java.lang.Object source, UserAccount user, Session session)Fires the event with the specified source, user and session.EventType<? extends SessionEvent>getEventType()Gets the event type of this event.SessiongetSession()UserAccountgetUser()
-
-
-
Field Detail
-
ANY
public static final EventType<SessionEvent> ANY
Common supertype for all permission event types.
-
SESSION_LOGIN_SUCCESS
public static final EventType<SessionEvent> SESSION_LOGIN_SUCCESS
-
SESSION_LOGIN_FAILURE
public static final EventType<SessionEvent> SESSION_LOGIN_FAILURE
-
SESSION_OPENED
public static final EventType<SessionEvent> SESSION_OPENED
-
SESSION_CLOSED
public static final EventType<SessionEvent> SESSION_CLOSED
-
MULTI_SESSION_OPENED
public static final EventType<SessionEvent> MULTI_SESSION_OPENED
-
MULTI_SESSION_CLOSED
public static final EventType<SessionEvent> MULTI_SESSION_CLOSED
-
SESSION_ADMIN_OVERRIDE_STARTED
public static final EventType<SessionEvent> SESSION_ADMIN_OVERRIDE_STARTED
-
SESSION_ADMIN_OVERRIDE_SUCCESS
public static final EventType<SessionEvent> SESSION_ADMIN_OVERRIDE_SUCCESS
-
SESSION_ADMIN_OVERRIDE_FAILURE
public static final EventType<SessionEvent> SESSION_ADMIN_OVERRIDE_FAILURE
-
SESSION_USER_VERIFY_STARTED
public static final EventType<SessionEvent> SESSION_USER_VERIFY_STARTED
-
SESSION_USER_VERIFY_SUCCESS
public static final EventType<SessionEvent> SESSION_USER_VERIFY_SUCCESS
-
SESSION_USER_VERIFY_FAILURE
public static final EventType<SessionEvent> SESSION_USER_VERIFY_FAILURE
-
-
Constructor Detail
-
SessionEvent
public SessionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType)
Construct a newEventwith the specified event target and type.- Parameters:
target- the event target to associate with the eventeventType- the event type
-
SessionEvent
public SessionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType, java.util.List<java.lang.Object> args)
Construct a newEventwith the specified event target, type and args.- Parameters:
target- the event target to associate with the eventeventType- the event typeargs- arguments to make available to the EventHandler
-
-
Method Detail
-
getSession
public Session getSession()
-
getUser
public UserAccount getUser()
-
getEventType
public EventType<? extends SessionEvent> getEventType()
Gets the event type of this event. Objects of the sameEventclass can have different event types. These event types further specify what kind of event occurred.- Overrides:
getEventTypein classEvent- Returns:
- the event type
-
copyFor
public SessionEvent copyFor(java.lang.Object newSource, EventTarget<? extends Event> newTarget)
Creates and returns a copy of this event with the specified event source and target.
-
fireEvent
public void fireEvent(java.lang.Object source, UserAccount user)Fires the event with the specified source and user.- Parameters:
source- the event source which sent the eventuser- the user account object to pass to the EventHandler
-
fireEvent
public void fireEvent(java.lang.Object source, UserAccount user, Session session)Fires the event with the specified source, user and session.- Parameters:
source- the event source which sent the eventuser- the user object to pass to the EventHandlersession- the session object to pass to the EventHandler
-
-