Class SessionEvent

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class SessionEvent
    extends Event
    A Event for use with user Session objects.
    Since:
    1.4.0
    See Also:
    Serialized Form
    • Constructor Detail

      • SessionEvent

        public SessionEvent​(EventTarget<? extends Event> target,
                            EventType<? extends Event> eventType)
        Construct a new Event with the specified event target and type.
        Parameters:
        target - the event target to associate with the event
        eventType - the event type
      • SessionEvent

        public SessionEvent​(EventTarget<? extends Event> target,
                            EventType<? extends Event> eventType,
                            java.util.List<java.lang.Object> args)
        Construct a new Event with the specified event target, type and args.
        Parameters:
        target - the event target to associate with the event
        eventType - the event type
        args - arguments to make available to the EventHandler
    • Method Detail

      • getSession

        public Session getSession()
      • getEventType

        public EventType<? extends SessionEvent> getEventType()
        Gets the event type of this event. Objects of the same Event class can have different event types. These event types further specify what kind of event occurred.
        Overrides:
        getEventType in class Event
        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.
        Overrides:
        copyFor in class Event
        Parameters:
        newSource - the new source of the copied event
        newTarget - the new target of the copied event
        Returns:
        the event copy with the new 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 event
        user - 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 event
        user - the user object to pass to the EventHandler
        session - the session object to pass to the EventHandler