Package org.alfresco.repo.domain.audit
Interface AuditDAO
- All Known Implementing Classes:
AbstractAuditDAOImpl,AuditDAOImpl
public interface AuditDAO
DAO services for alf_audit_XXX tables.
The older methods are supported by a different implementation and will eventually be deprecated and phased out.
- Since:
- 3.2
- Author:
- Derek Hulley
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classInformation about the audit application to be passed in an out of the interface. -
Method Summary
Modifier and TypeMethodDescriptioncreateAuditApplication(String application, Long modelId) Creates a new audit application.createAuditEntry(Long applicationId, long time, String username, Map<String, Serializable> values) Create a new audit entry with the given map of values.intdeleteAuditEntries(Long applicationId, Long fromTime, Long toTime) Delete audit entries for the application, possibly limiting the time range.intdeleteAuditEntries(List<Long> auditEntryIds) Delete a discrete list of audit entries.intdeleteAuditEntriesByIdRange(Long applicationId, Long fromId, Long toId) Delete audit entries for the application for given id range.voidfindAuditEntries(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults) Find audit entries using the given parameters, any of which may be nullgetAuditApplication(String applicationName) Get the audit application details.default intgetAuditEntriesCountByApp(long applicationId) Issue an audit query to retrieve count of records for a given application.default intgetAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters) Issue an audit query to retrieve count of records for a given application and propertiesgetAuditMinMaxByApp(long appId, List<String> extremes) Issue an audit query to retrieve min / max audit record id for a given application.getOrCreateAuditModel(URL url) Creates a new audit model entry or finds an existing onevoidupdateAuditApplicationDisabledPaths(Long id, Set<String> disabledPaths) Update the audit application to hold a new set of disabled paths.voidupdateAuditApplicationModel(Long id, Long modelId) Update the audit application to refer to a new model.
-
Method Details
-
getOrCreateAuditModel
Creates a new audit model entry or finds an existing one- Parameters:
url- the URL of the configuration- Returns:
- Returns the ID of the config matching the input stream and the content storage details
- Since:
- 3.2
-
getAuditApplication
Get the audit application details.- Parameters:
applicationName- the name of the application- Returns:
- Returns details of an existing application or null if it doesn't exist
- Since:
- 3.2
-
createAuditApplication
Creates a new audit application. The application name must be unique.- Parameters:
application- the name of the applicationmodelId- the ID of the model configuration- Since:
- 3.2
-
updateAuditApplicationModel
Update the audit application to refer to a new model. If the model did not change, then nothing will be done.- Parameters:
id- the ID of the audit applicationmodelId- the ID of the new model- Since:
- 3.2
-
updateAuditApplicationDisabledPaths
Update the audit application to hold a new set of disabled paths. If the value did not change, then nothing will be done.- Parameters:
id- the ID of the audit applicationdisabledPaths- the new disabled paths- Since:
- 3.2
-
deleteAuditEntries
Delete audit entries for the application, possibly limiting the time range.- Parameters:
applicationId- an existing audit application IDfromTime- the minimum entry time (inclusive, optional)toTime- the maximum entry time (exclusive, optional)- Returns:
- Returns the number of entries deleted
- Since:
- 3.2
-
deleteAuditEntriesByIdRange
Delete audit entries for the application for given id range.- Parameters:
applicationId- an existing audit application IDfromId- the minimum fromId (inclusive, optional)toId- the maximum toId (exclusive, optional)- Returns:
- Returns the number of entries deleted
- Since:
- 5.2.2
-
deleteAuditEntries
Delete a discrete list of audit entries. Duplicate entries are collapsed and the number of entries deleted will match the count of unique IDs in the list; otherwise a concurrency condition has occured and an exception will be generated.- Parameters:
auditEntryIds- the IDs of all audit entries to delete- Returns:
- Returns the number of entries deleted
-
createAuditEntry
Long createAuditEntry(Long applicationId, long time, String username, Map<String, Serializable> values) Create a new audit entry with the given map of values.- Parameters:
applicationId- an existing audit application IDtime- the time (ms since epoch) to log the entry againstusername- the authenticated user (null if not present)values- the values to record- Returns:
- Returns the unique entry ID
- Since:
- 3.2
-
findAuditEntries
void findAuditEntries(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults) Find audit entries using the given parameters, any of which may be null- Parameters:
callback- the data callback per entryparameters- the parameters for the query (may not be null)maxResults- the maximum number of results to retrieve (must be greater than 0)- Throws:
IllegalArgumentException- if maxResults less or equal to zero
-
getAuditMinMaxByApp
Issue an audit query to retrieve min / max audit record id for a given application.- Parameters:
appId- the database id of the applicationextremes- a list containing min/max or both- Returns:
- a map containing min/max and the associated value
-
getAuditEntriesCountByApp
default int getAuditEntriesCountByApp(long applicationId) Issue an audit query to retrieve count of records for a given application.- Parameters:
applicationId- the database id of the application- Returns:
- a map containing min/max and the associated value
-
getAuditEntriesCountByAppAndProperties
default int getAuditEntriesCountByAppAndProperties(String applicationName, AuditQueryParameters parameters) Issue an audit query to retrieve count of records for a given application and properties- Parameters:
applicationName- name of the application to be queriedparameters- audit parameters provided by thewhereclause on the ReST API- Returns:
- a map containing min/max and the associated value
-