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
public abstract class AbstractAuditDAOImpl extends Object implements AuditDAO
Abstract helper DAO for alf_audit_XXX tables.- Since:
- 3.2
- Author:
- Derek Hulley
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractAuditDAOImpl.AuditQueryRowHandlerClass that passes results from a result entity into the client callback-
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.audit.AuditDAO
AuditDAO.AuditApplicationInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Logloggerprotected PropertyValueDAOpropertyValueDAO
-
Constructor Summary
Constructors Constructor Description AbstractAuditDAOImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AuditApplicationEntitycreateAuditApplication(Long appNameId, Long modelId, Long disabledPathsId)AuditDAO.AuditApplicationInfocreateAuditApplication(String application, Long modelId)Creates a new audit application.protected abstract AuditEntryEntitycreateAuditEntry(Long applicationId, long time, Long usernameId, Long valuesId)LongcreateAuditEntry(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, boolean forward, String applicationName, String user, Long fromId, Long toId, Long fromTime, Long toTime, int maxResults, String searchKey, Serializable searchValue)voidfindAuditEntries(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)Find audit entries using the given parameters, any of which may be nullAuditDAO.AuditApplicationInfogetAuditApplication(String application)Get the audit application details.protected abstract AuditApplicationEntitygetAuditApplicationById(Long id)protected abstract AuditApplicationEntitygetAuditApplicationByName(String appName)protected abstract AuditModelEntitygetAuditModelByCrc(long crc)org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ContentData>getOrCreateAuditModel(URL url)Creates a new audit model entry or finds an existing oneprotected PropertyValueDAOgetPropertyValueDAO()voidsetContentDataDAO(ContentDataDAO contentDataDAO)voidsetContentService(ContentService contentService)voidsetPropertyValueDAO(PropertyValueDAO propertyValueDAO)protected abstract AuditApplicationEntityupdateAuditApplication(AuditApplicationEntity entity)voidupdateAuditApplicationDisabledPaths(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, wait
-
Methods inherited from interface org.alfresco.repo.domain.audit.AuditDAO
deleteAuditEntries, deleteAuditEntriesByIdRange
-
-
-
-
Field Detail
-
logger
protected final org.apache.commons.logging.Log logger
-
propertyValueDAO
protected PropertyValueDAO propertyValueDAO
-
-
Method Detail
-
setContentService
public void setContentService(ContentService contentService)
-
setContentDataDAO
public void setContentDataDAO(ContentDataDAO contentDataDAO)
-
setPropertyValueDAO
public void setPropertyValueDAO(PropertyValueDAO propertyValueDAO)
-
getPropertyValueDAO
protected PropertyValueDAO getPropertyValueDAO()
-
getOrCreateAuditModel
public org.alfresco.util.Pair<Long,org.alfresco.service.cmr.repository.ContentData> getOrCreateAuditModel(URL url)
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
protected abstract AuditModelEntity getAuditModelByCrc(long crc)
-
createAuditModel
protected abstract AuditModelEntity createAuditModel(Long contentDataId, long crc)
-
getAuditApplication
public AuditDAO.AuditApplicationInfo getAuditApplication(String application)
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
public AuditDAO.AuditApplicationInfo createAuditApplication(String application, Long modelId)
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
public void updateAuditApplicationModel(Long id, Long modelId)
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
public void updateAuditApplicationDisabledPaths(Long id, Set<String> disabledPaths)
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
protected abstract AuditApplicationEntity getAuditApplicationById(Long id)
-
getAuditApplicationByName
protected abstract AuditApplicationEntity getAuditApplicationByName(String appName)
-
createAuditApplication
protected abstract AuditApplicationEntity createAuditApplication(Long appNameId, Long modelId, Long disabledPathsId)
-
updateAuditApplication
protected abstract AuditApplicationEntity updateAuditApplication(AuditApplicationEntity entity)
-
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
public int deleteAuditEntries(List<Long> auditEntryIds)
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)
-
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, boolean forward, String applicationName, String user, Long fromId, Long toId, Long fromTime, Long toTime, int maxResults, String searchKey, Serializable searchValue)
-
-