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
  • Field Details

    • logger

      protected final org.apache.commons.logging.Log logger
    • propertyValueDAO

      protected PropertyValueDAO propertyValueDAO
  • Constructor Details

    • AbstractAuditDAOImpl

      public AbstractAuditDAOImpl()
  • Method Details

    • setContentService

      public void setContentService(ContentService contentService)
    • setContentDataDAO

      public void setContentDataDAO(ContentDataDAO contentDataDAO)
    • setPropertyValueDAO

      public void setPropertyValueDAO(PropertyValueDAO propertyValueDAO)
    • getPropertyValueDAO

      protected PropertyValueDAO getPropertyValueDAO()
    • getOrCreateAuditModel

      public Pair<Long,ContentData> getOrCreateAuditModel(URL url)
      Creates a new audit model entry or finds an existing one
      Specified by:
      getOrCreateAuditModel in interface AuditDAO
      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: AuditDAO
      Get the audit application details.
      Specified by:
      getAuditApplication in interface AuditDAO
      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: AuditDAO
      Creates a new audit application. The application name must be unique.
      Specified by:
      createAuditApplication in interface AuditDAO
      Parameters:
      application - the name of the application
      modelId - the ID of the model configuration
    • updateAuditApplicationModel

      public void updateAuditApplicationModel(Long id, Long modelId)
      Description copied from interface: AuditDAO
      Update the audit application to refer to a new model. If the model did not change, then nothing will be done.
      Specified by:
      updateAuditApplicationModel in interface AuditDAO
      Parameters:
      id - the ID of the audit application
      modelId - the ID of the new model
    • updateAuditApplicationDisabledPaths

      public void updateAuditApplicationDisabledPaths(Long id, Set<String> disabledPaths)
      Description copied from interface: AuditDAO
      Update the audit application to hold a new set of disabled paths. If the value did not change, then nothing will be done.
      Specified by:
      updateAuditApplicationDisabledPaths in interface AuditDAO
      Parameters:
      id - the ID of the audit application
      disabledPaths - 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: AuditDAO
      Create a new audit entry with the given map of values.
      Specified by:
      createAuditEntry in interface AuditDAO
      Parameters:
      applicationId - an existing audit application ID
      time - the time (ms since epoch) to log the entry against
      username - 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: AuditDAO
      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.
      Specified by:
      deleteAuditEntries in interface AuditDAO
      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

      protected abstract int deleteAuditEntriesImpl(List<Long> auditEntryIds)
    • findAuditEntries

      public void findAuditEntries(AuditService.AuditQueryCallback callback, AuditQueryParameters parameters, int maxResults)
      Description copied from interface: AuditDAO
      Find audit entries using the given parameters, any of which may be null
      Specified by:
      findAuditEntries in interface AuditDAO
      Parameters:
      callback - the data callback per entry
      parameters - 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)