Class AuditLogService

All Implemented Interfaces:
org.apache.cayenne.LifecycleListener

public class AuditLogService extends CayenneService implements org.apache.cayenne.LifecycleListener
Provides an audit log service.
  • Field Details

    • LOG_NAME_AUDIT_LOG

      protected static final String LOG_NAME_AUDIT_LOG
      See Also:
    • auditLogLogger

      protected org.slf4j.Logger auditLogLogger
  • Constructor Details

    • AuditLogService

      public AuditLogService()
  • Method Details

    • postAdd

      public void postAdd(Object entity)
      Process the entity after add.
      Specified by:
      postAdd in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.postAdd(java.lang.Object)
    • postLoad

      public void postLoad(Object entity)
      Process the entity after load.
      Specified by:
      postLoad in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.postLoad(java.lang.Object)
    • postPersist

      public void postPersist(Object entity)
      Process the entity after persist.
      Specified by:
      postPersist in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.postPersist(java.lang.Object)
    • postRemove

      public void postRemove(Object entity)
      Process the entity after remove.
      Specified by:
      postRemove in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.postRemove(java.lang.Object)
    • postUpdate

      public void postUpdate(Object entity)
      Process the entity after update.
      Specified by:
      postUpdate in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.postUpdate(java.lang.Object)
    • prePersist

      public void prePersist(Object entity)
      Process the entity before persist.
      Specified by:
      prePersist in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.prePersist(java.lang.Object)
    • preRemove

      public void preRemove(Object entity)
      Process the entity before remvoe.
      Specified by:
      preRemove in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.preRemove(java.lang.Object)
    • preUpdate

      public void preUpdate(Object entity)
      Process the entity before update.
      Specified by:
      preUpdate in interface org.apache.cayenne.LifecycleListener
      Parameters:
      entity - the entity
      See Also:
      • LifecycleListener.preUpdate(java.lang.Object)
    • createSubmissionViewAuditLog

      public void createSubmissionViewAuditLog(Submission submission, String dataType)
      Create a submission view audit log record.
      Parameters:
      submission - the submission to log
      dataType - the type of data [ 'XML' | 'PDF Receipt' | 'History XML' | 'Attachment' ]
    • createDataExtractBulkViewAuditLog

      public void createDataExtractBulkViewAuditLog(String message)
      Create an audit log record about a user viewing a set of data extract values for a number of submissions. Note: This method works only if the remote user resolves to a valid TM user account.
      Parameters:
      message - the message to log (this should detail which data extract values/submissions, e.g. all submissions for January 2017 for form 'FTX-CCA' version '1.0'
      Throws:
      ApplicationException - if the current user is not a valid TM user account
      Since:
      5.1.3
    • dumpAuditLogToFile

      public void dumpAuditLogToFile(String path, String fileName)
      Dump the entire audit log to the specified path (optional) and file name in CSV format. If the file exists, it will be overwritten.
      Parameters:
      path - the path (defaults to the TM server log directory if not set)
      fileName - (required)
      Since:
      4.0.0
    • getAuditLogLogger

      protected org.slf4j.Logger getAuditLogLogger()
      Return the specialized user audit log logger
      Returns:
      the user audit log logger