Package org.apache.wiki.event
Class WikiSecurityEvent
java.lang.Object
java.util.EventObject
org.apache.wiki.event.WikiEvent
org.apache.wiki.event.WikiSecurityEvent
- All Implemented Interfaces:
Serializable
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
:
- login failed - bad credential or password
These events are logged with priority WARN
:
- access denied
- login failed - credential expired
- login failed - account expired
These events are logged with priority INFO
:
- login succeeded
- logout
- user profile name changed
These events are logged with priority DEBUG
:
- access allowed
- add group
- remove group
- clear all groups
- add group member
- remove group member
- clear all members from group
- Since:
- 2.3.79
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
When access to a resource is allowed.static final int
When access to a resource is allowed.static final int
When a new wiki group is added.static final int
When all wiki groups are removed from GroupDatabase.static final int
When a wiki group is deleted.static final int
When a login fails due to account expiration.static final int
When a user first accesses JSPWiki, but before logging in or setting a cookie.static final int
When a user sets a cookie to assert their identity.static final int
When a user authenticates with a username and password, or via container auth.static final int
When a login fails due to credential expiration.static final int
When a login fails due to wrong username or password.static final int
When a user's attempts to log in as guest, via cookies, using a password or otherwise.static final int
When a user logs out.static final int
When a Principal should be added to the Sessionstatic final int
When a user profile name changes.static final int
When a user profile is saved.static final int
When a session expires.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionWikiSecurityEvent
(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. -
Method Summary
Modifier and TypeMethodDescriptioneventName
(int type) Returns a textual representation of an event type.Returns the principal to whom the operation applied, if supplied.Returns the object that was operated on, if supplied.Returns a human-readable description of the event type.toString()
Prints a String (human-readable) representation of this object.Methods inherited from class org.apache.wiki.event.WikiEvent
eventName, getArg, getArgs, getSrc, getType, getWhen, isValidType, setType
Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
LOGIN_INITIATED
When a user's attempts to log in as guest, via cookies, using a password or otherwise.- See Also:
-
LOGIN_ANONYMOUS
When a user first accesses JSPWiki, but before logging in or setting a cookie.- See Also:
-
LOGIN_ASSERTED
When a user sets a cookie to assert their identity.- See Also:
-
LOGIN_AUTHENTICATED
When a user authenticates with a username and password, or via container auth.- See Also:
-
LOGIN_ACCOUNT_EXPIRED
When a login fails due to account expiration.- See Also:
-
LOGIN_CREDENTIAL_EXPIRED
When a login fails due to credential expiration.- See Also:
-
LOGIN_FAILED
When a login fails due to wrong username or password.- See Also:
-
LOGOUT
When a user logs out.- See Also:
-
PRINCIPAL_ADD
When a Principal should be added to the Session- See Also:
-
SESSION_EXPIRED
When a session expires.- See Also:
-
GROUP_ADD
When a new wiki group is added.- See Also:
-
GROUP_REMOVE
When a wiki group is deleted.- See Also:
-
GROUP_CLEAR_GROUPS
When all wiki groups are removed from GroupDatabase.- See Also:
-
ACCESS_ALLOWED
When access to a resource is allowed.- See Also:
-
ACCESS_DENIED
When access to a resource is allowed.- See Also:
-
PROFILE_SAVE
When a user profile is saved.- See Also:
-
PROFILE_NAME_CHANGED
When a user profile name changes.- See Also:
-
-
Constructor Details
-
WikiSecurityEvent
Constructs a new instance of this event type, which signals a security event has occurred. Thesource
parameter is required, and may not benull
. When the WikiSecurityEvent is constructed, the security loggerLOG
is notified.- Parameters:
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 benull
target
- the changed Object, which may benull
-
WikiSecurityEvent
Constructs a new instance of this event type, which signals a security event has occurred. Thesource
parameter is required, and may not benull
. When the WikiSecurityEvent is constructed, the security loggerLOG
is notified.- Parameters:
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 benull
.
-
-
Method Details
-
getPrincipal
Returns the principal to whom the operation applied, if supplied. This method may returnnull
— and calling methods should check for this condition.- Returns:
- the changed object
-
getTarget
Returns the object that was operated on, if supplied. This method may returnnull
— and calling methods should check for this condition.- Returns:
- the changed object
-
toString
Prints a String (human-readable) representation of this object. -
eventName
Returns a textual representation of an event type.- Parameters:
type
- the type- Returns:
- the string representation
-
getTypeDescription
Returns a human-readable description of the event type.- Overrides:
getTypeDescription
in classWikiEvent
- Returns:
- a String description of the type
-