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>
ANY
Common supertype for all permission event types.static EventType<SessionEvent>
MULTI_SESSION_CLOSED
static EventType<SessionEvent>
MULTI_SESSION_OPENED
static EventType<SessionEvent>
SESSION_ADMIN_OVERRIDE_FAILURE
static EventType<SessionEvent>
SESSION_ADMIN_OVERRIDE_STARTED
static EventType<SessionEvent>
SESSION_ADMIN_OVERRIDE_SUCCESS
static EventType<SessionEvent>
SESSION_CLOSED
static EventType<SessionEvent>
SESSION_LOGIN_FAILURE
static EventType<SessionEvent>
SESSION_LOGIN_SUCCESS
static EventType<SessionEvent>
SESSION_OPENED
static EventType<SessionEvent>
SESSION_USER_VERIFY_FAILURE
static EventType<SessionEvent>
SESSION_USER_VERIFY_STARTED
static EventType<SessionEvent>
SESSION_USER_VERIFY_SUCCESS
-
Constructor Summary
Constructors Constructor Description SessionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType)
Construct a newEvent
with the specified event target and type.SessionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType, java.util.List<java.lang.Object> args)
Construct a newEvent
with the specified event target, type and args.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
fireEvent(java.lang.Object source, UserAccount user)
Fires the event with the specified source and user.void
fireEvent(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.Session
getSession()
UserAccount
getUser()
-
-
-
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 newEvent
with 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 newEvent
with 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 sameEvent
class can have different event types. These event types further specify what kind of event occurred.- Overrides:
getEventType
in 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
-
-