Class AuditMethodInterceptor

java.lang.Object
org.alfresco.repo.audit.AuditMethodInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class AuditMethodInterceptor extends Object implements org.aopalliance.intercept.MethodInterceptor
A method interceptor to wrap method invocations with auditing.

V3.2 Configuration: As of V3.2, the pre- and post-invocation values are passed to the audit component for processing. Individual applications have to extract the desired audit values. Values are audited before and after the invocation so that applications that desire to extract derived data before the invocation can have a chance to do so; generally, however, the post-invocation values will be the most useful.

The values passed to the audit component (assuming auditing is enabled and the new configuration is being used) are:

 /alfresco-api
    /pre
       /<service>
          /<method>
             /args
                /<arg-name>=<value>
                /<arg-name>=<value>
                ...
       /service
    /post
       /<service>
          /<method>
             /args
                /<arg-name>=<value>
                /<arg-name>=<value>
                ...
             /result=<value>
             /error=<value>
             /no-error=<null>
 
 
Applications can remap the paths onto their configurations as appropriate.

TODO: Audit configuration mapping needs to support conditionals

Author:
Andy Hind, Derek Hulley
  • Field Details

  • Constructor Details

    • AuditMethodInterceptor

      public AuditMethodInterceptor()
  • Method Details

    • setUseNewConfig

      public void setUseNewConfig(boolean useNewConfig)
      Use the new audit configuration (default: false)
      Parameters:
      useNewConfig - true to use the new audit configuration
    • setBeanIdentifier

      public void setBeanIdentifier(BeanIdentifier beanIdentifier)
    • setAuditComponent

      public void setAuditComponent(AuditComponent auditComponent)
    • setTransactionService

      public void setTransactionService(TransactionService transactionService)
    • setThreadPoolExecutor

      public void setThreadPoolExecutor(ThreadPoolExecutor threadPoolExecutor)
    • invoke

      public Object invoke(org.aopalliance.intercept.MethodInvocation mi) throws Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      Throwable