public interface AuditLog
AuditLog
defines 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_TOPIC
and the AuditLogEvent
stored
in the property AuditLogEvent.AUDIT_EVENT_PROPERTY
or by directly calling
add(AuditLogEntry)
or add(List)
.
Modifier and Type | Method and Description |
---|---|
void |
add(AuditLogEntry entry)
Add a new audit log entry.
|
void |
add(java.util.List<AuditLogEntry> entries)
Add new audit log entries
|
java.lang.String[] |
getCategories()
Return an array containing all audit log categories (that have entries)
|
AuditLogEntry |
getLatestEvent(ResourceResolver resolver,
java.lang.String category,
java.lang.String path)
Returns the latest event for the path and category.
|
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.
|
AuditLogEntry |
getLatestEvent(java.lang.String category,
java.lang.String path)
Deprecated.
since 6.3, use
getLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String) instead |
AuditLogEntry |
getLatestEvent(java.lang.String category,
java.lang.String path,
java.lang.String type)
Deprecated.
since 6.3, use
getLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String, String) instead |
AuditLogEntry[] |
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[] |
getLatestEvents(java.lang.String[] categories,
java.lang.String path,
int max)
Deprecated.
since 6.3, use
getLatestEvents(org.apache.sling.api.resource.ResourceResolver, String[], String, int) instead |
AuditLogEntry[] |
getLatestEvents(java.lang.String category,
java.lang.String path,
int max)
Deprecated.
since 6.3, use
getLatestEvents(org.apache.sling.api.resource.ResourceResolver, String, String, int) instead |
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 the
prefix . |
AuditLogEntry[] |
getLatestEventsFromTree(java.lang.String[] categories,
java.lang.String pathPrefix,
int max)
Deprecated.
|
void |
move(java.lang.String srcPath,
java.lang.String destPath)
Move audit log entries from one place to another.
|
@Deprecated AuditLogEntry getLatestEvent(java.lang.String category, java.lang.String path)
getLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String)
insteadcategory
- the event categorypath
- the path of the eventnull
.
throws IllegalArgumentException
If category or path are null.AuditLogEntry getLatestEvent(ResourceResolver resolver, java.lang.String category, java.lang.String path)
resolver
- ResourceResolver instancecategory
- the event categorypath
- the path of the eventnull
.
throws IllegalArgumentException
If category or path are null.@Deprecated AuditLogEntry getLatestEvent(java.lang.String category, java.lang.String path, java.lang.String type)
getLatestEvent(org.apache.sling.api.resource.ResourceResolver, String, String, String)
insteadcategory
- the event categorypath
- the path of the eventtype
- the type of the eventnull
.
throws IllegalArgumentException
If category, type or path are null.AuditLogEntry getLatestEvent(ResourceResolver resolver, java.lang.String category, java.lang.String path, java.lang.String type)
resolver
- ResourceResolver instancecategory
- the event categorypath
- the path of the eventtype
- the type of the eventnull
.
throws IllegalArgumentException
If category, type or path are null.@Deprecated AuditLogEntry[] getLatestEvents(java.lang.String category, java.lang.String path, int max)
getLatestEvents(org.apache.sling.api.resource.ResourceResolver, String, String, int)
insteadcategory
- the event categorypath
- the path of the eventsmax
- the maximum number of events to return or -1 for all.IllegalArgumentException
If category or path are null.AuditLogEntry[] getLatestEvents(ResourceResolver resolver, java.lang.String category, java.lang.String path, int max)
resolver
- ResourceResolver instancecategory
- the event categorypath
- the path of the eventsmax
- the maximum number of events to return or -1 for all.IllegalArgumentException
If category or path are null.@Deprecated AuditLogEntry[] getLatestEvents(java.lang.String[] categories, java.lang.String path, int max)
getLatestEvents(org.apache.sling.api.resource.ResourceResolver, String[], String, int)
insteadcategories
- the event categoriespath
- the path of the eventsmax
- the maximum number of events to return or -1 for all.IllegalArgumentException
If category or path are null.AuditLogEntry[] getLatestEvents(ResourceResolver resolver, java.lang.String[] categories, java.lang.String path, int max)
resolver
- ResourceResolver instancecategories
- the event categoriespath
- the path of the eventsmax
- the maximum number of events to return or -1 for all.IllegalArgumentException
If category or path are null.java.lang.String[] getCategories()
null
@Deprecated AuditLogEntry[] getLatestEventsFromTree(java.lang.String[] categories, java.lang.String pathPrefix, int max)
getLatestEventsFromTree(org.apache.sling.api.resource.ResourceResolver, String[], String, int)
insteadprefix
.categories
- the event categoriespathPrefix
- the pattern to matchmax
- the maximum number of events per path to return or -1 for all.IllegalArgumentException
If category or pathPrefix are null.AuditLogEntry[] getLatestEventsFromTree(ResourceResolver resolver, java.lang.String[] categories, java.lang.String pathPrefix, int max)
prefix
.resolver
- ResourceResolver instancecategories
- the event categoriespathPrefix
- the pattern to matchmax
- the maximum number of events per path to return or -1 for all.IllegalArgumentException
If category or pathPrefix are null.void add(AuditLogEntry entry)
entry
- The audit log entry.void add(java.util.List<AuditLogEntry> entries)
entries
- The audit log entries.void move(java.lang.String srcPath, java.lang.String destPath)
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"