Package org.alfresco.repo.domain.audit
Interface AuditDAO
-
- All Known Implementing Classes:
AbstractAuditDAOImpl,AuditDAOImpl
public interface AuditDAODAO 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 Classes Modifier and Type Interface Description static classAuditDAO.AuditApplicationInfoInformation about the audit application to be passed in an out of the interface.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AuditDAO.AuditApplicationInfocreateAuditApplication(java.lang.String application, java.lang.Long modelId)Creates a new audit application.java.lang.LongcreateAuditEntry(java.lang.Long applicationId, long time, java.lang.String username, java.util.Map<java.lang.String,java.io.Serializable> values)Create a new audit entry with the given map of values.intdeleteAuditEntries(java.lang.Long applicationId, java.lang.Long fromTime, java.lang.Long toTime)Delete audit entries for the application, possibly limiting the time range.intdeleteAuditEntries(java.util.List<java.lang.Long> auditEntryIds)Delete a discrete list of audit entries.intdeleteAuditEntriesByIdRange(java.lang.Long applicationId, java.lang.Long fromId, java.lang.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 nullAuditDAO.AuditApplicationInfogetAuditApplication(java.lang.String applicationName)Get the audit application details.org.alfresco.util.Pair<java.lang.Long,org.alfresco.service.cmr.repository.ContentData>getOrCreateAuditModel(java.net.URL url)Creates a new audit model entry or finds an existing onevoidupdateAuditApplicationDisabledPaths(java.lang.Long id, java.util.Set<java.lang.String> disabledPaths)Update the audit application to hold a new set of disabled paths.voidupdateAuditApplicationModel(java.lang.Long id, java.lang.Long modelId)Update the audit application to refer to a new model.
-
-
-
Method Detail
-
getOrCreateAuditModel
org.alfresco.util.Pair<java.lang.Long,org.alfresco.service.cmr.repository.ContentData> getOrCreateAuditModel(java.net.URL url)
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
AuditDAO.AuditApplicationInfo getAuditApplication(java.lang.String applicationName)
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
AuditDAO.AuditApplicationInfo createAuditApplication(java.lang.String application, java.lang.Long modelId)
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
void updateAuditApplicationModel(java.lang.Long id, java.lang.Long modelId)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
void updateAuditApplicationDisabledPaths(java.lang.Long id, java.util.Set<java.lang.String> disabledPaths)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
int deleteAuditEntries(java.lang.Long applicationId, java.lang.Long fromTime, java.lang.Long toTime)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
int deleteAuditEntriesByIdRange(java.lang.Long applicationId, java.lang.Long fromId, java.lang.Long toId)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
int deleteAuditEntries(java.util.List<java.lang.Long> auditEntryIds)
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
java.lang.Long createAuditEntry(java.lang.Long applicationId, long time, java.lang.String username, java.util.Map<java.lang.String,java.io.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:
java.lang.IllegalArgumentException- if maxResults less or equal to zero
-
-