com.jgcomptech.tools.events.SessionEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-ultimate-tools Show documentation
Show all versions of java-ultimate-tools Show documentation
A large repository of scripts for use in any Java program.
package com.jgcomptech.tools.events;
import com.jgcomptech.tools.authc.Session;
import com.jgcomptech.tools.authc.UserAccount;
import java.util.List;
/**
* A {@link Event} for use with user {@link Session} objects.
* @since 1.4.0
*/
public class SessionEvent extends Event {
private Session session;
public Session getSession() { return session; }
private UserAccount user;
public UserAccount getUser() { return user; }
/** Common supertype for all permission event types. */
public static final EventType ANY = new EventType<>(Event.ANY, "SESSION");
public static final EventType SESSION_LOGIN_SUCCESS = ANY.createSubType("SESSION_LOGIN_SUCCESS");
public static final EventType SESSION_LOGIN_FAILURE = ANY.createSubType("SESSION_LOGIN_FAILURE");
public static final EventType SESSION_OPENED = ANY.createSubType("SESSION_OPENED");
public static final EventType SESSION_CLOSED = ANY.createSubType("SESSION_CLOSED");
public static final EventType MULTI_SESSION_OPENED = ANY.createSubType("MULTI_SESSION_OPENED");
public static final EventType MULTI_SESSION_CLOSED = ANY.createSubType("MULTI_SESSION_CLOSED");
public static final EventType SESSION_ADMIN_OVERRIDE_STARTED
= ANY.createSubType("SESSION_ADMIN_OVERRIDE_STARTED");
public static final EventType SESSION_ADMIN_OVERRIDE_SUCCESS
= ANY.createSubType("SESSION_ADMIN_OVERRIDE_SUCCESS");
public static final EventType SESSION_ADMIN_OVERRIDE_FAILURE
= ANY.createSubType("SESSION_ADMIN_OVERRIDE_FAILURE");
public static final EventType SESSION_USER_VERIFY_STARTED
= ANY.createSubType("SESSION_USER_VERIFY_STARTED");
public static final EventType SESSION_USER_VERIFY_SUCCESS
= ANY.createSubType("SESSION_USER_VERIFY_SUCCESS");
public static final EventType SESSION_USER_VERIFY_FAILURE
= ANY.createSubType("SESSION_USER_VERIFY_FAILURE");
/**
* Construct a new {@code Event} with the specified event target and type.
* @param target the event target to associate with the event
* @param eventType the event type
*/
public SessionEvent(final EventTarget extends Event> target,
final EventType extends Event> eventType) {
super(target, eventType);
}
/**
* Construct a new {@code Event} with the specified event target, type and args.
* @param target the event target to associate with the event
* @param eventType the event type
* @param args arguments to make available to the EventHandler
*/
public SessionEvent(final EventTarget extends Event> target,
final EventType extends Event> eventType,
final List