gov.nih.nci.caarray.util
Class CaArrayAuditLogProcessor

java.lang.Object
  extended by com.fiveamsolutions.nci.commons.audit.DefaultProcessor
      extended by gov.nih.nci.caarray.util.CaArrayAuditLogProcessor

public class CaArrayAuditLogProcessor
extends com.fiveamsolutions.nci.commons.audit.DefaultProcessor

Author:
gax

Method Summary
 com.fiveamsolutions.nci.commons.audit.AuditLogDetail addDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record, java.lang.String attribute, java.lang.String message)
          Add audit log detail entry.
 com.fiveamsolutions.nci.commons.audit.AuditLogDetail addDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record, java.lang.String attribute, java.lang.String message, java.lang.Object oldVal, java.lang.Object newVal)
          Add audit log detail entry.
 void addExperimentDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record, java.lang.String attribute, gov.nih.nci.caarray.domain.project.Project project)
          Add audit log detail entry for an experiment header.
 void addProjectSecurity(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record, gov.nih.nci.caarray.domain.project.Project project, java.lang.Long privilegeId)
          Add project security access for an audit log record.
 java.util.Map<com.fiveamsolutions.nci.commons.audit.AuditLogRecord,java.util.Set<gov.nih.nci.caarray.domain.audit.AuditLogSecurity>> getSecurityEntries()
          Returns a mapping of audit records with their associated security entries.
 boolean isAuditableEntity(java.lang.Object o)
          
 void postProcessDetail(org.hibernate.Session session, java.util.Collection<com.fiveamsolutions.nci.commons.audit.AuditLogRecord> records)
          This method is called for any post processing required after the work from processDetail has been saved.
 void processDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record, java.lang.Object entity, java.io.Serializable key, java.lang.String property, java.lang.String columnName, java.lang.Object oldVal, java.lang.Object newVal)
          
 
Methods inherited from class com.fiveamsolutions.nci.commons.audit.DefaultProcessor
escape, getAutitableClasses, getHibernateHelper, getId, isAuditableClass, isPersistent, newAuditLogRecord, processDetail, processDetailCollection, processDetailMap, processDetailObject, processDetailString, setHibernateHelper, unescape
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isAuditableEntity

public boolean isAuditableEntity(java.lang.Object o)

Overrides:
isAuditableEntity in class com.fiveamsolutions.nci.commons.audit.DefaultProcessor

processDetail

public void processDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record,
                          java.lang.Object entity,
                          java.io.Serializable key,
                          java.lang.String property,
                          java.lang.String columnName,
                          java.lang.Object oldVal,
                          java.lang.Object newVal)

Overrides:
processDetail in class com.fiveamsolutions.nci.commons.audit.DefaultProcessor

postProcessDetail

public void postProcessDetail(org.hibernate.Session session,
                              java.util.Collection<com.fiveamsolutions.nci.commons.audit.AuditLogRecord> records)
This method is called for any post processing required after the work from processDetail has been saved. This method was added for ARRAY-1933, which required access to the session to save some security entries. However, this should be eventually incorporated into DefaultProcessor in nci-commons. See ARRAY-2496.

Parameters:
session - hibernate session
records - collection of audit records to process

getSecurityEntries

public java.util.Map<com.fiveamsolutions.nci.commons.audit.AuditLogRecord,java.util.Set<gov.nih.nci.caarray.domain.audit.AuditLogSecurity>> getSecurityEntries()
Returns a mapping of audit records with their associated security entries. The security entries are created in the processDetail method, but not persisted. This map allows us to store the security object created in processDetail and retrieve them later to persist them to the database.

Returns:
map of AuditLogRecord to AuditLogSecurity entries

addProjectSecurity

public void addProjectSecurity(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record,
                               gov.nih.nci.caarray.domain.project.Project project,
                               java.lang.Long privilegeId)
Add project security access for an audit log record.

Parameters:
record - audit log record
project - associated project
privilegeId - privilege

addExperimentDetail

public void addExperimentDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record,
                                java.lang.String attribute,
                                gov.nih.nci.caarray.domain.project.Project project)
Add audit log detail entry for an experiment header.

Parameters:
record - audit log record
attribute - attribute
project - project

addDetail

public com.fiveamsolutions.nci.commons.audit.AuditLogDetail addDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record,
                                                                      java.lang.String attribute,
                                                                      java.lang.String message)
Add audit log detail entry.

Parameters:
record - audit log record
attribute - attribute that changed
message - message
Returns:
audit log detail

addDetail

public com.fiveamsolutions.nci.commons.audit.AuditLogDetail addDetail(com.fiveamsolutions.nci.commons.audit.AuditLogRecord record,
                                                                      java.lang.String attribute,
                                                                      java.lang.String message,
                                                                      java.lang.Object oldVal,
                                                                      java.lang.Object newVal)
Add audit log detail entry.

Parameters:
record - audit log record
attribute - attribute that changed
message - message
oldVal - old value
newVal - new value
Returns:
audit log detail