Package org.alfresco.repo.audit
Class AuditServiceImpl
java.lang.Object
org.alfresco.repo.audit.AuditServiceImpl
- All Implemented Interfaces:
AuditService
The implementation of the AuditService for application auditing.
- Since:
- 3.2
- Author:
- Derek Hulley
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.audit.AuditService
AuditService.AuditApplication, AuditService.AuditQueryCallback -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauditQuery(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults) Issue an audit query using the given parameters and consuming results in the callback.intclearAudit(String applicationName) Remove all audit entries for the given applicationintclearAudit(String applicationName, Long fromTime, Long toTime) Remove audit entries for the given application between the time ranges.intclearAudit(List<Long> auditEntryIds) Delete a discrete list of audit entries.intclearAuditByIdRange(String applicationName, Long fromId, Long toId) Remove audit entries for the given application between the audit entry ids.voiddisableAudit(String applicationName, String path) Disable auditing for an application pathvoidenableAudit(String applicationName, String path) Enable auditing for an application pathGet all registered audit applicationsintgetAuditEntriesCountByApp(String applicationName) Issue an audit query to retrieve min / max audit record id for a given application.intgetAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters) Issue an audit query to retrieve min / max audit record id for a given application and propertiesgetAuditMinMaxByApp(String applicationName, List<String> extremes) Issue an audit query to retrieve min / max audit record id for a given application.booleanbooleanisAuditEnabled(String applicationName, String path) voidsetAuditComponent(AuditComponent auditComponent) voidsetAuditEnabled(boolean enable) Enable or disable the global auditing state
-
Constructor Details
-
AuditServiceImpl
public AuditServiceImpl()
-
-
Method Details
-
setAuditComponent
-
isAuditEnabled
public boolean isAuditEnabled()- Specified by:
isAuditEnabledin interfaceAuditService- Returns:
- Returns true if auditing is globally enabled
- Since:
- 3.4
-
setAuditEnabled
public void setAuditEnabled(boolean enable) Enable or disable the global auditing state- Specified by:
setAuditEnabledin interfaceAuditService- Parameters:
enable- true to enable auditing globally or false to disable- Since:
- 3.4
-
getAuditApplications
Get all registered audit applications- Specified by:
getAuditApplicationsin interfaceAuditService- Returns:
- Returns a map of audit applications keyed by their name
- Since:
- 3.4
-
isAuditEnabled
- Specified by:
isAuditEnabledin interfaceAuditService- 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
Enable auditing for an application path- Specified by:
enableAuditin interfaceAuditService- Parameters:
applicationName- the name of the application to checkpath- the path to enable- Since:
- 3.2
-
disableAudit
Disable auditing for an application path- Specified by:
disableAuditin interfaceAuditService- Parameters:
applicationName- the name of the application to checkpath- the path to disable- Since:
- 3.2
-
clearAudit
Remove all audit entries for the given application- Specified by:
clearAuditin interfaceAuditService- Parameters:
applicationName- the name of the application for which to remove entries- Returns:
- Returns the number of audit entries deleted
- Since:
- 3.2
-
clearAudit
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.- Specified by:
clearAuditin interfaceAuditService- 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
Remove audit entries for the given application between the audit entry ids.- Specified by:
clearAuditByIdRangein interfaceAuditService- 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
Delete a discrete list of audit entries. This method should not be called while processingquery results.- Specified by:
clearAuditin interfaceAuditService- Parameters:
auditEntryIds- the IDs of all audit entries to delete- Returns:
- Returns the number of audit entries deleted
- Since:
- 3.4
-
auditQuery
public 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.- Specified by:
auditQueryin interfaceAuditService- 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)- Since:
- 3.3
-
getAuditMinMaxByApp
Issue an audit query to retrieve min / max audit record id for a given application.- Specified by:
getAuditMinMaxByAppin interfaceAuditService- Parameters:
applicationName- the name of the applicationextremes- a list containing min/max or both- Returns:
- a map containing min/max and the associated value
-
getAuditEntriesCountByApp
Issue an audit query to retrieve min / max audit record id for a given application.- Specified by:
getAuditEntriesCountByAppin interfaceAuditService- Parameters:
applicationName- the name of the application- Returns:
- a map containing min/max and the associated value
-
getAuditEntriesCountByAppAndProperties
public int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters) Issue an audit query to retrieve min / max audit record id for a given application and properties- Specified by:
getAuditEntriesCountByAppAndPropertiesin interfaceAuditService- Parameters:
applicationName- the name of the applicationparameters- audit parameters provided by thewhereclause on the ReST API- Returns:
- a map containing min/max and the associated value
-