Package org.alfresco.service.cmr.audit
Interface AuditService
-
- All Known Implementing Classes:
AuditServiceImpl
public interface AuditServiceThe public API by which applications can query the audit logs and enable or disable auditing.- Author:
- Derek Hulley
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAuditService.AuditApplicationHelper bean to carry information about an audit application.static interfaceAuditService.AuditQueryCallbackThe interface that will be used to give query results to the calling code.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidauditQuery(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)Issue an audit query using the given parameters and consuming results in the callback.intclearAudit(java.lang.String applicationName)Deprecated.intclearAudit(java.lang.String applicationName, java.lang.Long fromTime, java.lang.Long toTime)Remove audit entries for the given application between the time ranges.intclearAudit(java.util.List<java.lang.Long> auditEntryIds)Delete a discrete list of audit entries.intclearAuditByIdRange(java.lang.String applicationName, java.lang.Long fromId, java.lang.Long toId)Remove audit entries for the given application between the audit entry ids.voiddisableAudit(java.lang.String applicationName, java.lang.String path)Disable auditing for an application pathvoidenableAudit(java.lang.String applicationName, java.lang.String path)Enable auditing for an application pathjava.util.Map<java.lang.String,AuditService.AuditApplication>getAuditApplications()Get all registered audit applicationsbooleanisAuditEnabled()booleanisAuditEnabled(java.lang.String applicationName, java.lang.String path)voidsetAuditEnabled(boolean enable)Enable or disable the global auditing state
-
-
-
Method Detail
-
isAuditEnabled
boolean isAuditEnabled()
- Returns:
- Returns true if auditing is globally enabled
- Since:
- 3.4
-
setAuditEnabled
void setAuditEnabled(boolean enable)
Enable or disable the global auditing state- Parameters:
enable- true to enable auditing globally or false to disable- Since:
- 3.4
-
getAuditApplications
java.util.Map<java.lang.String,AuditService.AuditApplication> getAuditApplications()
Get all registered audit applications- Returns:
- Returns a map of audit applications keyed by their name
- Since:
- 3.4
-
isAuditEnabled
boolean isAuditEnabled(java.lang.String applicationName, java.lang.String path)- Parameters:
applicationName- the name of the application to checkpath- the path to check- Returns:
- Returns true if auditing is enabled for the given path
- Since:
- 3.2
-
enableAudit
void enableAudit(java.lang.String applicationName, java.lang.String path)Enable auditing for an application path- Parameters:
applicationName- the name of the application to checkpath- the path to enable- Since:
- 3.2
-
disableAudit
void disableAudit(java.lang.String applicationName, java.lang.String path)Disable auditing for an application path- Parameters:
applicationName- the name of the application to checkpath- the path to disable- Since:
- 3.2
-
clearAudit
int clearAudit(java.lang.String applicationName)
Deprecated.Remove all audit entries for the given application- Parameters:
applicationName- the name of the application for which to remove entries- Returns:
- Returns the number of audit entries deleted
- Since:
- 3.2
-
clearAudit
int clearAudit(java.lang.String applicationName, java.lang.Long fromTime, java.lang.Long toTime)Remove audit entries for the given application between the time ranges. If no start time is given then entries are deleted as far back as they exist. If no end time is given then entries are deleted up until the current time.- Parameters:
applicationName- the name of the application for which to remove entriesfromTime- the start time of entries to remove (inclusive and optional)toTime- the end time of entries to remove (exclusive and optional)- Returns:
- Returns the number of audit entries deleted
- Since:
- 3.4
-
clearAuditByIdRange
int clearAuditByIdRange(java.lang.String applicationName, java.lang.Long fromId, java.lang.Long toId)Remove audit entries for the given application between the audit entry ids.- Parameters:
applicationName- the name of the application for which to remove entriesfromId- the start time of entries to remove (inclusive and optional)toId- the end time of entries to remove (exclusive and optional)- Returns:
- Returns the number of audit entries deleted
- Since:
- 5.2.2
-
clearAudit
int clearAudit(java.util.List<java.lang.Long> auditEntryIds)
Delete a discrete list of audit entries. This method should not be called while processingquery results.- Parameters:
auditEntryIds- the IDs of all audit entries to delete- Returns:
- Returns the number of audit entries deleted
- Since:
- 3.4
-
auditQuery
void auditQuery(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)
Issue an audit query using the given parameters and consuming results in the callback. Results are returned in entry order, corresponding to time order.- Parameters:
callback- the callback that will handle resultsparameters- the parameters for the query (may not be null)maxResults- the maximum number of results to retrieve (must be greater than 0)- Throws:
java.lang.IllegalArgumentException- if maxResults less or equal to zero- Since:
- 3.3
-
-