Package com.day.cq.audit
Interface AuditLog
-
public interface AuditLogTheAuditLogdefines an interface to retrieve audit event information from the respective audit log. The audit log is path based: the content path in the repository is used as a unique identifier to group all entries.The audit framework is still subject to change and will be improved. Adding entries to the audit log can be done by sending a job event with the job topic
AuditLogEvent.JOB_TOPICand theAuditLogEventstored in the propertyAuditLogEvent.AUDIT_EVENT_PROPERTYor by directly callingadd(AuditLogEntry)oradd(List).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidadd(AuditLogEntry entry)Add a new audit log entry.voidadd(java.util.List<AuditLogEntry> entries)Add new audit log entriesjava.lang.String[]getCategories()Return an array containing all audit log categories (that have entries)AuditLogEntrygetLatestEvent(java.lang.String category, java.lang.String path)Deprecated.since 6.3, usegetLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String)insteadAuditLogEntrygetLatestEvent(java.lang.String category, java.lang.String path, java.lang.String type)Deprecated.since 6.3, usegetLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String, String)insteadAuditLogEntrygetLatestEvent(ResourceResolver resolver, java.lang.String category, java.lang.String path)Returns the latest event for the path and category.AuditLogEntrygetLatestEvent(ResourceResolver resolver, java.lang.String category, java.lang.String path, java.lang.String type)Returns the latest event for the path, type and category.AuditLogEntry[]getLatestEvents(java.lang.String[] categories, java.lang.String path, int max)Deprecated.since 6.3, usegetLatestEvents(org.apache.sling.api.resource.ResourceResolver, String[], String, int)insteadAuditLogEntry[]getLatestEvents(java.lang.String category, java.lang.String path, int max)Deprecated.since 6.3, usegetLatestEvents(org.apache.sling.api.resource.ResourceResolver, String, String, int)insteadAuditLogEntry[]getLatestEvents(ResourceResolver resolver, java.lang.String[] categories, java.lang.String path, int max)Returns the latest events for the path and category.AuditLogEntry[]getLatestEvents(ResourceResolver resolver, java.lang.String category, java.lang.String path, int max)Returns the latest events for the path and category.AuditLogEntry[]getLatestEventsFromTree(java.lang.String[] categories, java.lang.String pathPrefix, int max)Deprecated.AuditLogEntry[]getLatestEventsFromTree(ResourceResolver resolver, java.lang.String[] categories, java.lang.String pathPrefix, int max)Returns the latest events for all paths which will start with theprefix.voidmove(java.lang.String srcPath, java.lang.String destPath)Move audit log entries from one place to another.
-
-
-
Method Detail
-
getLatestEvent
@Deprecated AuditLogEntry getLatestEvent(java.lang.String category, java.lang.String path)
Deprecated.since 6.3, usegetLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String)insteadReturns the latest event for the path and category.- Parameters:
category- the event categorypath- the path of the event- Returns:
- the latest event with the given path or
null. throwsIllegalArgumentExceptionIf category or path are null.
-
getLatestEvent
AuditLogEntry getLatestEvent(ResourceResolver resolver, java.lang.String category, java.lang.String path)
Returns the latest event for the path and category.- Parameters:
resolver- ResourceResolver instancecategory- the event categorypath- the path of the event- Returns:
- the latest event with the given path or
null. throwsIllegalArgumentExceptionIf category or path are null.
-
getLatestEvent
@Deprecated AuditLogEntry getLatestEvent(java.lang.String category, java.lang.String path, java.lang.String type)
Deprecated.since 6.3, usegetLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String, String)insteadReturns the latest event for the path, type and category.- Parameters:
category- the event categorypath- the path of the eventtype- the type of the event- Returns:
- the latest event with the given path or
null. throwsIllegalArgumentExceptionIf category, type or path are null.
-
getLatestEvent
AuditLogEntry getLatestEvent(ResourceResolver resolver, java.lang.String category, java.lang.String path, java.lang.String type)
Returns the latest event for the path, type and category.- Parameters:
resolver- ResourceResolver instancecategory- the event categorypath- the path of the eventtype- the type of the event- Returns:
- the latest event with the given path or
null. throwsIllegalArgumentExceptionIf category, type or path are null.
-
getLatestEvents
@Deprecated AuditLogEntry[] getLatestEvents(java.lang.String category, java.lang.String path, int max)
Deprecated.since 6.3, usegetLatestEvents(org.apache.sling.api.resource.ResourceResolver, String, String, int)insteadReturns the latest events for the path and category.- Parameters:
category- the event categorypath- the path of the eventsmax- the maximum number of events to return or -1 for all.- Returns:
- an array of AuditEvents
throws
IllegalArgumentExceptionIf category or path are null.
-
getLatestEvents
AuditLogEntry[] getLatestEvents(ResourceResolver resolver, java.lang.String category, java.lang.String path, int max)
Returns the latest events for the path and category.- Parameters:
resolver- ResourceResolver instancecategory- the event categorypath- the path of the eventsmax- the maximum number of events to return or -1 for all.- Returns:
- an array of AuditEvents
throws
IllegalArgumentExceptionIf category or path are null.
-
getLatestEvents
@Deprecated AuditLogEntry[] getLatestEvents(java.lang.String[] categories, java.lang.String path, int max)
Deprecated.since 6.3, usegetLatestEvents(org.apache.sling.api.resource.ResourceResolver, String[], String, int)insteadReturns the latest events for the path and category.- Parameters:
categories- the event categoriespath- the path of the eventsmax- the maximum number of events to return or -1 for all.- Returns:
- an array of AuditEvents
throws
IllegalArgumentExceptionIf category or path are null.
-
getLatestEvents
AuditLogEntry[] getLatestEvents(ResourceResolver resolver, java.lang.String[] categories, java.lang.String path, int max)
Returns the latest events for the path and category.- Parameters:
resolver- ResourceResolver instancecategories- the event categoriespath- the path of the eventsmax- the maximum number of events to return or -1 for all.- Returns:
- an array of AuditEvents
throws
IllegalArgumentExceptionIf category or path are null.
-
getCategories
java.lang.String[] getCategories()
Return an array containing all audit log categories (that have entries)- Returns:
- An array with the categories or
null
-
getLatestEventsFromTree
@Deprecated AuditLogEntry[] getLatestEventsFromTree(java.lang.String[] categories, java.lang.String pathPrefix, int max)
Deprecated.Returns the latest events for all paths which will start with theprefix.- Parameters:
categories- the event categoriespathPrefix- the pattern to matchmax- the maximum number of events per path to return or -1 for all.- Returns:
- an array of AuditEvents
throws
IllegalArgumentExceptionIf category or pathPrefix are null.
-
getLatestEventsFromTree
AuditLogEntry[] getLatestEventsFromTree(ResourceResolver resolver, java.lang.String[] categories, java.lang.String pathPrefix, int max)
Returns the latest events for all paths which will start with theprefix.- Parameters:
resolver- ResourceResolver instancecategories- the event categoriespathPrefix- the pattern to matchmax- the maximum number of events per path to return or -1 for all.- Returns:
- an array of AuditEvents
throws
IllegalArgumentExceptionIf category or pathPrefix are null.
-
add
void add(AuditLogEntry entry)
Add a new audit log entry.- Parameters:
entry- The audit log entry.
-
add
void add(java.util.List<AuditLogEntry> entries)
Add new audit log entries- Parameters:
entries- The audit log entries.
-
move
void move(java.lang.String srcPath, java.lang.String destPath)Move audit log entries from one place to another.
-
-