Package com.avoka.fc.core.service
Class AuditLogService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.AuditLogService
-
- All Implemented Interfaces:
org.apache.cayenne.LifecycleListener
public class AuditLogService extends CayenneService implements org.apache.cayenne.LifecycleListener
Provides an audit log service.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
auditLogLogger
protected static String
LOG_NAME_AUDIT_LOG
-
Constructor Summary
Constructors Constructor Description AuditLogService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createDataExtractBulkViewAuditLog(String message)
Create an audit log record about a user viewing a set of data extract values for a number of submissions.void
createSubmissionViewAuditLog(Submission submission, String dataType)
Create a submission view audit log record.void
dumpAuditLogToFile(String path, String fileName)
Dump the entire audit log to the specified path (optional) and file name in CSV format.protected org.slf4j.Logger
getAuditLogLogger()
Return the specialized user audit log loggervoid
postAdd(Object entity)
Process the entity after add.void
postLoad(Object entity)
Process the entity after load.void
postPersist(Object entity)
Process the entity after persist.void
postRemove(Object entity)
Process the entity after remove.void
postUpdate(Object entity)
Process the entity after update.void
prePersist(Object entity)
Process the entity before persist.void
preRemove(Object entity)
Process the entity before remvoe.void
preUpdate(Object entity)
Process the entity before update.-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Field Detail
-
LOG_NAME_AUDIT_LOG
protected static final String LOG_NAME_AUDIT_LOG
- See Also:
- Constant Field Values
-
auditLogLogger
protected org.slf4j.Logger auditLogLogger
-
-
Method Detail
-
postAdd
public void postAdd(Object entity)
Process the entity after add.- Specified by:
postAdd
in interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.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 logdataType
- 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
-
-