Class DefaultSecurityAuditProvider
- java.lang.Object
-
- org.jivesoftware.openfire.security.DefaultSecurityAuditProvider
-
- All Implemented Interfaces:
SecurityAuditProvider
public class DefaultSecurityAuditProvider extends Object implements SecurityAuditProvider
The default security audit provider stores the logs in a ofSecurityAuditLog table.- Author:
- Daniel Henninger
-
-
Constructor Summary
Constructors Constructor Description DefaultSecurityAuditProvider()
Constructs a new DefaultSecurityAuditProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
blockGroupEvents()
The default provider logs group events.boolean
blockUserEvents()
The default provider logs user events.String
getAuditURL()
The default provider uses Openfire's own audit log viewer.SecurityAuditEvent
getEvent(Integer msgID)
The default provider retrieves events from a ofSecurityAuditLog table in the database.Integer
getEventCount()
The default provider counts the number of entries in the ofSecurityAuditLog table.List<SecurityAuditEvent>
getEvents(String username, Integer skipEvents, Integer numEvents, Date startTime, Date endTime)
The default provider retrieves events from a ofSecurityAuditLog table in the database.boolean
isWriteOnly()
The default provider writes logs into a local Openfire database.void
logEvent(String username, String summary, String details)
The default provider logs events into a ofSecurityAuditLog table in the database.
-
-
-
Method Detail
-
logEvent
public void logEvent(String username, String summary, String details)
The default provider logs events into a ofSecurityAuditLog table in the database.- Specified by:
logEvent
in interfaceSecurityAuditProvider
- Parameters:
username
- Username of user who performed the security event.summary
- Short description of the event, similar to a subject.details
- Detailed description of the event, can be null if not desired.- See Also:
SecurityAuditProvider.logEvent(String, String, String)
-
getEvents
public List<SecurityAuditEvent> getEvents(String username, Integer skipEvents, Integer numEvents, Date startTime, Date endTime)
The default provider retrieves events from a ofSecurityAuditLog table in the database.- Specified by:
getEvents
in interfaceSecurityAuditProvider
- Parameters:
username
- Username of user to look up. Can be null for no username filtering.skipEvents
- Number of events to skip past (typically for paging). Can be null for first page.numEvents
- Number of events to retrieve. Can be null for "all" events.startTime
- Oldest date of range of events to retrieve. Can be null for forever.endTime
- Most recent date of range of events to retrieve. Can be null for "now".- Returns:
- Array of security events.
- See Also:
SecurityAuditProvider.getEvents(String, Integer, Integer, java.util.Date, java.util.Date)
-
getEvent
public SecurityAuditEvent getEvent(Integer msgID) throws EventNotFoundException
The default provider retrieves events from a ofSecurityAuditLog table in the database.- Specified by:
getEvent
in interfaceSecurityAuditProvider
- Parameters:
msgID
- ID number of event to retrieve.- Returns:
- SecurityAuditEvent object with information from retrieved event.
- Throws:
EventNotFoundException
- if event was not found.- See Also:
SecurityAuditProvider.getEvent(Integer)
-
getEventCount
public Integer getEventCount()
The default provider counts the number of entries in the ofSecurityAuditLog table.- Specified by:
getEventCount
in interfaceSecurityAuditProvider
- Returns:
- Number of events that have been recorded.
- See Also:
SecurityAuditProvider.getEventCount()
-
isWriteOnly
public boolean isWriteOnly()
The default provider writes logs into a local Openfire database.- Specified by:
isWriteOnly
in interfaceSecurityAuditProvider
- Returns:
- True or false if the logs can be read remotely.
- See Also:
SecurityAuditProvider.isWriteOnly()
-
getAuditURL
public String getAuditURL()
The default provider uses Openfire's own audit log viewer.- Specified by:
getAuditURL
in interfaceSecurityAuditProvider
- Returns:
- String represented URL that can be visited to view the audit logs.
- See Also:
SecurityAuditProvider.getAuditURL()
-
blockUserEvents
public boolean blockUserEvents()
The default provider logs user events.- Specified by:
blockUserEvents
in interfaceSecurityAuditProvider
- Returns:
- True if we should block user related security audit events from being handled.
- See Also:
SecurityAuditProvider.blockUserEvents()
-
blockGroupEvents
public boolean blockGroupEvents()
The default provider logs group events.- Specified by:
blockGroupEvents
in interfaceSecurityAuditProvider
- Returns:
- True if we should block group related security audit events from being handled.
- See Also:
SecurityAuditProvider.blockGroupEvents()
-
-