Package org.alfresco.repo.domain.audit
Class AbstractAuditDAOImpl
java.lang.Object
org.alfresco.repo.domain.audit.AbstractAuditDAOImpl
- All Implemented Interfaces:
AuditDAO
- Direct Known Subclasses:
AuditDAOImpl
Abstract helper DAO for alf_audit_XXX tables.
- Since:
- 3.2
- Author:
- Derek Hulley
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classClass that passes results from a result entity into the client callbackNested classes/interfaces inherited from interface org.alfresco.repo.domain.audit.AuditDAO
AuditDAO.AuditApplicationInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.logging.Logprotected PropertyValueDAO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AuditQueryParametersconvertFromRestAuditQueryParameters(AuditQueryParameters restParameters) protected abstract AuditApplicationEntitycreateAuditApplication(Long appNameId, Long modelId, Long disabledPathsId) createAuditApplication(String application, Long modelId) Creates a new audit application.protected abstract AuditEntryEntitycreateAuditEntry(Long applicationId, long time, Long usernameId, Long valuesId) createAuditEntry(Long applicationId, long time, String username, Map<String, Serializable> values) Create a new audit entry with the given map of values.protected abstract AuditModelEntitycreateAuditModel(Long contentDataId, long crc) intdeleteAuditEntries(List<Long> auditEntryIds) Delete a discrete list of audit entries.protected abstract intdeleteAuditEntriesImpl(List<Long> auditEntryIds) protected abstract voidfindAuditEntries(AbstractAuditDAOImpl.AuditQueryRowHandler rowHandler, int maxResults, AuditQueryParameters restParameters) voidfindAuditEntries(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults) Find audit entries using the given parameters, any of which may be nullgetAuditApplication(String application) Get the audit application details.protected abstract AuditApplicationEntityprotected abstract AuditApplicationEntitygetAuditApplicationByName(String appName) protected abstract AuditModelEntitygetAuditModelByCrc(long crc) getOrCreateAuditModel(URL url) Creates a new audit model entry or finds an existing oneprotected PropertyValueDAOvoidsetContentDataDAO(ContentDataDAO contentDataDAO) voidsetContentService(ContentService contentService) voidsetPropertyValueDAO(PropertyValueDAO propertyValueDAO) protected abstract AuditApplicationEntityvoidupdateAuditApplicationDisabledPaths(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.repo.domain.audit.AuditDAO
deleteAuditEntries, deleteAuditEntriesByIdRange, getAuditEntriesCountByApp, getAuditEntriesCountByAppAndProperties, getAuditMinMaxByApp
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger -
propertyValueDAO
-
-
Constructor Details
-
AbstractAuditDAOImpl
public AbstractAuditDAOImpl()
-
-
Method Details
-
setContentService
-
setContentDataDAO
-
setPropertyValueDAO
-
getPropertyValueDAO
-
getOrCreateAuditModel
Creates a new audit model entry or finds an existing one- Specified by:
getOrCreateAuditModelin interfaceAuditDAO- Parameters:
url- the URL of the configuration- Returns:
- Returns the ID of the config matching the input stream and the content storage details
-
getAuditModelByCrc
-
createAuditModel
-
getAuditApplication
Description copied from interface:AuditDAOGet the audit application details.- Specified by:
getAuditApplicationin interfaceAuditDAO- Parameters:
application- the name of the application- Returns:
- Returns details of an existing application or null if it doesn't exist
-
createAuditApplication
Description copied from interface:AuditDAOCreates a new audit application. The application name must be unique.- Specified by:
createAuditApplicationin interfaceAuditDAO- Parameters:
application- the name of the applicationmodelId- the ID of the model configuration
-
updateAuditApplicationModel
Description copied from interface:AuditDAOUpdate the audit application to refer to a new model. If the model did not change, then nothing will be done.- Specified by:
updateAuditApplicationModelin interfaceAuditDAO- Parameters:
id- the ID of the audit applicationmodelId- the ID of the new model
-
updateAuditApplicationDisabledPaths
Description copied from interface:AuditDAOUpdate the audit application to hold a new set of disabled paths. If the value did not change, then nothing will be done.- Specified by:
updateAuditApplicationDisabledPathsin interfaceAuditDAO- Parameters:
id- the ID of the audit applicationdisabledPaths- the new disabled paths
-
getAuditApplicationById
-
getAuditApplicationByName
-
createAuditApplication
protected abstract AuditApplicationEntity createAuditApplication(Long appNameId, Long modelId, Long disabledPathsId) -
updateAuditApplication
-
createAuditEntry
public Long createAuditEntry(Long applicationId, long time, String username, Map<String, Serializable> values) Description copied from interface:AuditDAOCreate a new audit entry with the given map of values.- Specified by:
createAuditEntryin interfaceAuditDAO- 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
-
deleteAuditEntries
Description copied from interface:AuditDAODelete 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.- Specified by:
deleteAuditEntriesin interfaceAuditDAO- Parameters:
auditEntryIds- the IDs of all audit entries to delete- Returns:
- Returns the number of entries deleted
-
createAuditEntry
protected abstract AuditEntryEntity createAuditEntry(Long applicationId, long time, Long usernameId, Long valuesId) -
deleteAuditEntriesImpl
-
findAuditEntries
public void findAuditEntries(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults) Description copied from interface:AuditDAOFind audit entries using the given parameters, any of which may be null- Specified by:
findAuditEntriesin interfaceAuditDAO- 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)
-
findAuditEntries
protected abstract void findAuditEntries(AbstractAuditDAOImpl.AuditQueryRowHandler rowHandler, int maxResults, AuditQueryParameters restParameters) -
convertFromRestAuditQueryParameters
protected AuditQueryParameters convertFromRestAuditQueryParameters(AuditQueryParameters restParameters)
-