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
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:
- 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:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description static intACCESS_ALLOWEDWhen access to a resource is allowed.static intACCESS_DENIEDWhen access to a resource is allowed.static intGROUP_ADDWhen a new wiki group is added.static intGROUP_CLEAR_GROUPSWhen all wiki groups are removed from GroupDatabase.static intGROUP_REMOVEWhen a wiki group is deleted.protected static org.apache.log4j.LoggerlogThe security logging service.static intLOGIN_ACCOUNT_EXPIREDWhen a login fails due to account expiration.static intLOGIN_ANONYMOUSWhen a user first accesses JSPWiki, but before logging in or setting a cookie.static intLOGIN_ASSERTEDWhen a user sets a cookie to assert their identity.static intLOGIN_AUTHENTICATEDWhen a user authenticates with a username and password, or via container auth.static intLOGIN_CREDENTIAL_EXPIREDWhen a login fails due to credential expiration.static intLOGIN_FAILEDWhen a login fails due to wrong username or password.static intLOGIN_INITIATEDWhen a user's attempts to log in as guest, via cookies, using a password or otherwise.static intLOGOUTWhen a user logs out.static intPRINCIPAL_ADDWhen a Principal should be added to the Sessionstatic intPROFILE_NAME_CHANGEDWhen a user profile name changes.static intPROFILE_SAVEWhen a user profile is saved.static intSESSION_EXPIREDWhen a session expires.Fields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructors Constructor 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.
- 
Method SummaryModifier and Type Method Description StringeventName(int type)Returns a textual representation of an event type.ObjectgetPrincipal()Returns the principal to whom the opeation applied, if supplied.ObjectgetTarget()Returns the object that was operated on, if supplied.StringgetTypeDescription()Returns a human-readable description of the event type.StringtoString()Prints a String (human-readable) representation of this object.Methods inherited from class org.apache.wiki.event.WikiEventeventName, getSrc, getType, getWhen, isValidType, setTypeMethods inherited from class java.util.EventObjectgetSource
- 
Field Details- 
LOGIN_INITIATEDWhen a user's attempts to log in as guest, via cookies, using a password or otherwise.- See Also:
- Constant Field Values
 
- 
LOGIN_ANONYMOUSWhen a user first accesses JSPWiki, but before logging in or setting a cookie.- See Also:
- Constant Field Values
 
- 
LOGIN_ASSERTEDWhen a user sets a cookie to assert their identity.- See Also:
- Constant Field Values
 
- 
LOGIN_AUTHENTICATEDWhen a user authenticates with a username and password, or via container auth.- See Also:
- Constant Field Values
 
- 
LOGIN_ACCOUNT_EXPIREDWhen a login fails due to account expiration.- See Also:
- Constant Field Values
 
- 
LOGIN_CREDENTIAL_EXPIREDWhen a login fails due to credential expiration.- See Also:
- Constant Field Values
 
- 
LOGIN_FAILEDWhen a login fails due to wrong username or password.- See Also:
- Constant Field Values
 
- 
LOGOUTWhen a user logs out.- See Also:
- Constant Field Values
 
- 
PRINCIPAL_ADDWhen a Principal should be added to the Session- See Also:
- Constant Field Values
 
- 
SESSION_EXPIREDWhen a session expires.- See Also:
- Constant Field Values
 
- 
GROUP_ADDWhen a new wiki group is added.- See Also:
- Constant Field Values
 
- 
GROUP_REMOVEWhen a wiki group is deleted.- See Also:
- Constant Field Values
 
- 
GROUP_CLEAR_GROUPSWhen all wiki groups are removed from GroupDatabase.- See Also:
- Constant Field Values
 
- 
ACCESS_ALLOWEDWhen access to a resource is allowed.- See Also:
- Constant Field Values
 
- 
ACCESS_DENIEDWhen access to a resource is allowed.- See Also:
- Constant Field Values
 
- 
PROFILE_SAVEWhen a user profile is saved.- See Also:
- Constant Field Values
 
- 
PROFILE_NAME_CHANGEDWhen a user profile name changes.- See Also:
- Constant Field Values
 
- 
logThe security logging service.
 
- 
- 
Constructor Details- 
WikiSecurityEventConstructs a new instance of this event type, which signals a security event has occurred. Thesourceparameter is required, and may not benull. When the WikiSecurityEvent is constructed, the security loggerlogis 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 event
- principal- the subject of the event, which may be- null
- target- the changed Object, which may be- null
 
- 
WikiSecurityEventConstructs a new instance of this event type, which signals a security event has occurred. Thesourceparameter is required, and may not benull. When the WikiSecurityEvent is constructed, the security loggerlogis 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 event
- target- the changed Object, which may be- null.
 
 
- 
- 
Method Details- 
getPrincipalReturns the principal to whom the opeation applied, if supplied. This method may returnnull— and calling methods should check for this condition.- Returns:
- the changed object
 
- 
getTargetReturns the object that was operated on, if supplied. This method may returnnull— and calling methods should check for this condition.- Returns:
- the changed object
 
- 
toStringPrints a String (human-readable) representation of this object.- Overrides:
- toStringin class- WikiEvent
- Returns:
- the String representation
- See Also:
- Object.toString()
 
- 
eventNameReturns a textual representation of an event type.- Parameters:
- type- the type
- Returns:
- the string representation
 
- 
getTypeDescriptionReturns a human-readable description of the event type.- Overrides:
- getTypeDescriptionin class- WikiEvent
- Returns:
- a String description of the type
 
 
-