Class 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 Details

  • Constructor Details

    • WikiSecurityEvent

      public WikiSecurityEvent​(Object src, int type, Principal principal, Object target)
      Constructs a new instance of this event type, which signals a security event has occurred. The source parameter is required, and may not be null. When the WikiSecurityEvent is constructed, the security logger log 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 event
      principal - the subject of the event, which may be null
      target - the changed Object, which may be null
    • WikiSecurityEvent

      public WikiSecurityEvent​(Object src, int type, Object target)
      Constructs a new instance of this event type, which signals a security event has occurred. The source parameter is required, and may not be null. When the WikiSecurityEvent is constructed, the security logger log 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 event
      target - the changed Object, which may be null.
  • Method Details

    • getPrincipal

      public Object getPrincipal()
      Returns the principal to whom the opeation applied, if supplied. This method may return null — and calling methods should check for this condition.
      Returns:
      the changed object
    • getTarget

      public Object getTarget()
      Returns the object that was operated on, if supplied. This method may return null — and calling methods should check for this condition.
      Returns:
      the changed object
    • toString

      public String toString()
      Prints a String (human-readable) representation of this object.
      Overrides:
      toString in class WikiEvent
      Returns:
      the String representation
      See Also:
      Object.toString()
    • eventName

      public String eventName​(int type)
      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 class WikiEvent
      Returns:
      a String description of the type