public final class WikiSecurityEvent extends WikiEvent
Event class for security events: login/logout, wiki group adds/changes, and
authorization decisions. When a WikiSecurityEvent is constructed, the
security logger log
is notified.
These events are logged with priority ERROR
:
These events are logged with priority WARN
:
These events are logged with priority INFO
:
These events are logged with priority DEBUG
:
Modifier and Type | Field and Description |
---|---|
static int |
ACCESS_ALLOWED
When access to a resource is allowed.
|
static int |
ACCESS_DENIED
When access to a resource is allowed.
|
static int |
GROUP_ADD
When a new wiki group is added.
|
static int |
GROUP_CLEAR_GROUPS
When all wiki groups are removed from GroupDatabase.
|
static int |
GROUP_REMOVE
When a wiki group is deleted.
|
protected static org.apache.log4j.Logger |
log
The security logging service.
|
static int |
LOGIN_ACCOUNT_EXPIRED
When a login fails due to account expiration.
|
static int |
LOGIN_ANONYMOUS
When a user first accesses JSPWiki, but before logging in or setting a cookie.
|
static int |
LOGIN_ASSERTED
When a user sets a cookie to assert their identity.
|
static int |
LOGIN_AUTHENTICATED
When a user authenticates with a username and password, or via container auth.
|
static int |
LOGIN_CREDENTIAL_EXPIRED
When a login fails due to credential expiration.
|
static int |
LOGIN_FAILED
When a login fails due to wrong username or password.
|
static int |
LOGIN_INITIATED
When a user's attempts to log in as guest, via cookies, using a password or otherwise.
|
static int |
LOGOUT
When a user logs out.
|
static int |
PRINCIPAL_ADD
When a Principal should be added to the WikiSession
|
static int |
PROFILE_NAME_CHANGED
When a user profile name changes.
|
static int |
PROFILE_SAVE
When a user profile is saved.
|
static int |
SESSION_EXPIRED
When a session expires.
|
source
Constructor and Description |
---|
WikiSecurityEvent(Object src,
int type,
Object target)
Constructs a new instance of this event type, which signals a security
event has occurred.
|
WikiSecurityEvent(Object src,
int type,
Principal principal,
Object target)
Constructs a new instance of this event type, which signals a security
event has occurred.
|
Modifier and Type | Method and Description |
---|---|
String |
eventName(int type)
Returns a textual representation of an event type.
|
Object |
getPrincipal()
Returns the principal to whom the opeation applied, if supplied.
|
Object |
getTarget()
Returns the object that was operated on, if supplied.
|
String |
getTypeDescription()
Returns a human-readable description of the event type.
|
String |
toString()
Prints a String (human-readable) representation of this object.
|
eventName, getSrc, getType, getWhen, isValidType, setType
getSource
public static final int LOGIN_INITIATED
public static final int LOGIN_ANONYMOUS
public static final int LOGIN_ASSERTED
public static final int LOGIN_AUTHENTICATED
public static final int LOGIN_ACCOUNT_EXPIRED
public static final int LOGIN_CREDENTIAL_EXPIRED
public static final int LOGIN_FAILED
public static final int LOGOUT
public static final int PRINCIPAL_ADD
public static final int SESSION_EXPIRED
public static final int GROUP_ADD
public static final int GROUP_REMOVE
public static final int GROUP_CLEAR_GROUPS
public static final int ACCESS_ALLOWED
public static final int ACCESS_DENIED
public static final int PROFILE_SAVE
public static final int PROFILE_NAME_CHANGED
protected static final org.apache.log4j.Logger log
public WikiSecurityEvent(Object src, int type, Principal principal, Object target)
source
parameter is required, and
may not be null
. When the WikiSecurityEvent is
constructed, the security logger log
is notified.src
- the source of the event, which can be any object: a wiki
page, group or authentication/authentication/group manager.type
- the type of eventprincipal
- the subject of the event, which may be null
target
- the changed Object, which may be null
public WikiSecurityEvent(Object src, int type, Object target)
source
parameter is required, and
may not be null
. When the WikiSecurityEvent is
constructed, the security logger log
is notified.src
- the source of the event, which can be any object: a wiki
page, group or authentication/authentication/group manager.type
- the type of eventtarget
- the changed Object, which may be null
.public Object getPrincipal()
null
— and calling methods should check for this condition.public Object getTarget()
null
— and calling methods should check for this condition.public String toString()
toString
in class WikiEvent
Object.toString()
public String eventName(int type)
type
- the typepublic String getTypeDescription()
getTypeDescription
in class WikiEvent
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.