Package org.alfresco.repo.audit
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 java.lang.Object implements org.aopalliance.intercept.MethodInterceptorA 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 Summary
Fields Modifier and Type Field Description static java.lang.StringAUDIT_PATH_API_POSTstatic java.lang.StringAUDIT_PATH_API_PREstatic java.lang.StringAUDIT_PATH_API_ROOTstatic java.lang.StringAUDIT_SNIPPET_ARGSstatic java.lang.StringAUDIT_SNIPPET_ERRORstatic java.lang.StringAUDIT_SNIPPET_NO_ERRORstatic java.lang.StringAUDIT_SNIPPET_PRE_CALL_DATAstatic java.lang.StringAUDIT_SNIPPET_RESULT
-
Constructor Summary
Constructors Constructor Description AuditMethodInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation mi)voidsetAuditComponent(AuditComponent auditComponent)voidsetBeanIdentifier(BeanIdentifier beanIdentifier)voidsetThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)voidsetTransactionService(TransactionService transactionService)voidsetUseNewConfig(boolean useNewConfig)Use the new audit configuration (default: false)
-
-
-
Field Detail
-
AUDIT_PATH_API_ROOT
public static final java.lang.String AUDIT_PATH_API_ROOT
- See Also:
- Constant Field Values
-
AUDIT_PATH_API_PRE
public static final java.lang.String AUDIT_PATH_API_PRE
- See Also:
- Constant Field Values
-
AUDIT_PATH_API_POST
public static final java.lang.String AUDIT_PATH_API_POST
- See Also:
- Constant Field Values
-
AUDIT_SNIPPET_ARGS
public static final java.lang.String AUDIT_SNIPPET_ARGS
- See Also:
- Constant Field Values
-
AUDIT_SNIPPET_PRE_CALL_DATA
public static final java.lang.String AUDIT_SNIPPET_PRE_CALL_DATA
- See Also:
- Constant Field Values
-
AUDIT_SNIPPET_RESULT
public static final java.lang.String AUDIT_SNIPPET_RESULT
- See Also:
- Constant Field Values
-
AUDIT_SNIPPET_ERROR
public static final java.lang.String AUDIT_SNIPPET_ERROR
- See Also:
- Constant Field Values
-
AUDIT_SNIPPET_NO_ERROR
public static final java.lang.String AUDIT_SNIPPET_NO_ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
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(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation mi) throws java.lang.Throwable- Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Throws:
java.lang.Throwable
-
-