Class AuditAnnotationAspect

java.lang.Object
org.trustdeck.security.audittrail.annotation.AuditAnnotationAspect

@Component public class AuditAnnotationAspect extends Object
Class that automatically intercepts the audit annotation and stores the collected information using the same transaction as the database method.
Author:
Armin Müller
  • Constructor Details

    • AuditAnnotationAspect

      public AuditAnnotationAspect()
  • Method Details

    • auditMethod

      @Transactional(propagation=REQUIRED) public Object auditMethod(org.aspectj.lang.ProceedingJoinPoint joinPoint, Audit auditAnnotation) throws AuditTrailException
      The method that intercepts the audit annotation, collects all necessary information and writes the audit trail to the database.
      Parameters:
      joinPoint - the point where the process execution should proceed from
      auditAnnotation - the audit annotation object that includes some audit information
      Returns:
      the result of proceeding
      Throws:
      AuditTrailException - if anything goes wrong while the audit trail is written, this exception is thrown in order to abort the current transaction and roll back to a consistent database state.