diff --git a/config/alfresco/audit-services-context.xml b/config/alfresco/audit-services-context.xml
index 7246062665..19d8e28e00 100644
--- a/config/alfresco/audit-services-context.xml
+++ b/config/alfresco/audit-services-context.xml
@@ -11,70 +11,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
-
-
-
- classpath:alfresco/auditConfig.xml
-
-
-
-
-
-
-
- ${dir.auditcontentstore}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/config/alfresco/auditConfig.xml b/config/alfresco/auditConfig.xml
deleted file mode 100644
index 3209dcc291..0000000000
--- a/config/alfresco/auditConfig.xml
+++ /dev/null
@@ -1,233 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- false
- false
- false
- false
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/config/alfresco/auditSchema.xsd b/config/alfresco/auditSchema.xsd
deleted file mode 100644
index 3c5c74ae82..0000000000
--- a/config/alfresco/auditSchema.xsd
+++ /dev/null
@@ -1,207 +0,0 @@
-
-
-
-
- Schema to define audit configuration.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/alfresco/dao/dao-context.xml b/config/alfresco/dao/dao-context.xml
index eb413b708b..0079d94e0d 100644
--- a/config/alfresco/dao/dao-context.xml
+++ b/config/alfresco/dao/dao-context.xml
@@ -123,7 +123,6 @@
-
diff --git a/config/alfresco/hibernate-context.xml b/config/alfresco/hibernate-context.xml
index e1cb5a42ec..05e34e55e7 100644
--- a/config/alfresco/hibernate-context.xml
+++ b/config/alfresco/hibernate-context.xml
@@ -52,16 +52,10 @@
-
-
+
-
-
-
-
-
-
org/jbpm/graph/action/Script.hbm.xml
org/jbpm/db/hibernate.queries.hbm.xml
org/jbpm/graph/def/ProcessDefinition.hbm.xml
@@ -153,9 +147,11 @@
+
@@ -164,7 +160,16 @@
-
+
SYNCHRONIZATION_ALWAYS
@@ -174,6 +179,7 @@
+
+
-
+ -->
+
\ No newline at end of file
diff --git a/config/alfresco/public-services-context.xml b/config/alfresco/public-services-context.xml
index 14a6c099bc..3c61f923ac 100644
--- a/config/alfresco/public-services-context.xml
+++ b/config/alfresco/public-services-context.xml
@@ -40,9 +40,6 @@
-
- ${audit.useNewConfig}
-
diff --git a/config/alfresco/repository.properties b/config/alfresco/repository.properties
index 5ac66c6cc2..961cf581dc 100644
--- a/config/alfresco/repository.properties
+++ b/config/alfresco/repository.properties
@@ -258,10 +258,6 @@ db.pool.abandoned.time=300
audit.enabled=false
audit.repository.enabled=true
audit.cmischangelog.enabled=true
-# Setting this flag to true will cause alfresco/auditConfig.xml to be ignored
-# when audit is enabled. When false both alfresco/auditConfig.xml and
-# alfresco/audit/*.xml will be used.
-audit.useNewConfig=false
# System Configuration
system.store=system://system
diff --git a/config/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication-context.xml b/config/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication-context.xml
index d7daf21b62..f2daf71aed 100644
--- a/config/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication-context.xml
+++ b/config/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication-context.xml
@@ -21,38 +21,38 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfresco_user_store.adminusername}
- administrator
-
-
-
-
-
-
-
-
-
-
-
-
- ${alfresco_user_store.guestusername}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${alfresco_user_store.adminusername}
+ administrator
+
+
+
+
+
+
+
+
+
+
+
+
+ ${alfresco_user_store.guestusername}
+
+
@@ -117,9 +117,6 @@
-
-
-
diff --git a/config/alfresco/subsystems/Authentication/common-ldap-context.xml b/config/alfresco/subsystems/Authentication/common-ldap-context.xml
index b639f7e6a5..6cffa575ee 100644
--- a/config/alfresco/subsystems/Authentication/common-ldap-context.xml
+++ b/config/alfresco/subsystems/Authentication/common-ldap-context.xml
@@ -80,9 +80,6 @@
-
-
-
diff --git a/config/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.xml b/config/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.xml
index cdfe3700dc..4835346417 100644
--- a/config/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.xml
+++ b/config/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.xml
@@ -95,9 +95,6 @@
-
-
-
diff --git a/source/java/org/alfresco/repo/audit/ApplicationAuditModel.java b/source/java/org/alfresco/repo/audit/ApplicationAuditModel.java
deleted file mode 100644
index 35bdd23c47..0000000000
--- a/source/java/org/alfresco/repo/audit/ApplicationAuditModel.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2005-2010 Alfresco Software Limited.
- *
- * This file is part of Alfresco
- *
- * Alfresco is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Alfresco is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with Alfresco. If not, see .
- */
-package org.alfresco.repo.audit;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-
-/**
- * The audit model used for application level auditing.
- *
- * @author andyh
- */
-public interface ApplicationAuditModel
-{
- /**
- * Report if audit behaviour can be determined before the method call
- *
- * @param auditMode
- * @param application
- * @param description
- * @param key
- * @param args
- * @return - the audit mode
- */
- public AuditMode beforeExecution(AuditMode auditMode, String application, String description, NodeRef key,
- Object... args);
-
- /**
- * Report if audit behaviour can be determined after the method call
- *
- * @param auditMode
- * @param application
- * @param description
- * @param key
- * @param args
- * @return - the audit mode
- */
- public AuditMode afterExecution(AuditMode auditMode, String application, String description, NodeRef key,
- Object... args);
-
- /**
- * Report if audit behaviour should be invoked on error. It could be we look at the error and filter - this is not
- * supported at the moment.
- *
- * @param auditMode
- * @param application
- * @param description
- * @param key
- * @param args
- * @return - the audit mode
- */
- public AuditMode onError(AuditMode auditMode, String application, String description, NodeRef key, Object... args);
-
- /**
- * Get the optional parameters that are to be recorded
- *
- * @param application
- * @return - the audit mode
- */
- public RecordOptions getAuditRecordOptions(String application);
-}
diff --git a/source/java/org/alfresco/repo/audit/AuditComponent.java b/source/java/org/alfresco/repo/audit/AuditComponent.java
index f82ed0c616..631dc07249 100644
--- a/source/java/org/alfresco/repo/audit/AuditComponent.java
+++ b/source/java/org/alfresco/repo/audit/AuditComponent.java
@@ -19,17 +19,13 @@
package org.alfresco.repo.audit;
import java.io.Serializable;
-import java.util.List;
import java.util.Map;
import org.alfresco.repo.audit.model.AuditApplication;
import org.alfresco.repo.audit.model.AuditModelRegistry;
import org.alfresco.repo.audit.model._3.AuditPath;
-import org.alfresco.service.cmr.audit.AuditInfo;
import org.alfresco.service.cmr.audit.AuditQueryParameters;
import org.alfresco.service.cmr.audit.AuditService.AuditQueryCallback;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.aopalliance.intercept.MethodInvocation;
/**
* The audit component. Used by the AuditService and AuditMethodInterceptor to insert audit entries.
@@ -42,52 +38,6 @@ import org.aopalliance.intercept.MethodInvocation;
*/
public interface AuditComponent
{
- /**
- * Audit entry point for method interceptors.
- *
- * @return - the return onbject from the normal invocation of the audited method.
- *
- * @since 2.1
- */
- public Object audit(MethodInvocation methodInvocation) throws Throwable;
-
- /**
- * @param source -
- * a string that represents the application
- * @param description -
- * the audit entry *
- * @param key -
- * a node ref to use as the key for filtering etc
- * @param args -
- * an arbitrary list of parameters
- *
- * @since 2.1
- */
- public void audit(String source, String description, NodeRef key, Object... args);
-
- /**
- * Add an audit entry - without invoking the method invocation.
- * Only the method arguments can be audited.
- *
- * @since 3.2
- */
- void beforeMethodCallManualAudit(Class> clazz, Object target, String method, Object ... args);
-
- /**
- * Get the audit trail for a node.
- *
- * @param nodeRef -
- * the node ref for which we want the audit trail
- * @return - a list of AuditInfo objects that represent the audit trail for the given node reference.
- *
- * @since 2.1
- */
- public List getAuditTrail(NodeRef nodeRef);
-
- /*
- * V3.2 from here on. Put all fixes to the older audit code before this point, please.
- */
-
/**
* Determines whether audit is globally enabled or disabled.
*
diff --git a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
index 0a99c7757e..ee4155a724 100644
--- a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
+++ b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
@@ -19,15 +19,10 @@
package org.alfresco.repo.audit;
import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
import java.util.Collections;
-import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -35,9 +30,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.audit.extractor.DataExtractor;
import org.alfresco.repo.audit.generator.DataGenerator;
import org.alfresco.repo.audit.model.AuditApplication;
-import org.alfresco.repo.audit.model.AuditEntry;
import org.alfresco.repo.audit.model.AuditModelRegistry;
-import org.alfresco.repo.audit.model.TrueFalseUnset;
import org.alfresco.repo.domain.audit.AuditDAO;
import org.alfresco.repo.domain.propval.PropertyValueDAO;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -45,25 +38,12 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
-import org.alfresco.service.Auditable;
-import org.alfresco.service.NotAuditable;
-import org.alfresco.service.PublicService;
-import org.alfresco.service.cmr.audit.AuditInfo;
import org.alfresco.service.cmr.audit.AuditQueryParameters;
import org.alfresco.service.cmr.audit.AuditService.AuditQueryCallback;
-import org.alfresco.service.cmr.repository.ChildAssociationRef;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.repository.Path;
-import org.alfresco.service.cmr.repository.StoreRef;
-import org.alfresco.service.cmr.search.SearchParameters;
-import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.PathMapper;
-import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.aop.framework.ReflectiveMethodInvocation;
import org.springframework.extensions.surf.util.ParameterCheck;
/**
@@ -78,809 +58,20 @@ import org.springframework.extensions.surf.util.ParameterCheck;
*/
public class AuditComponentImpl implements AuditComponent
{
- /**
- * The application name to use for audit entries generated by method interception around public services.
- */
- private static final String SYSTEM_APPLICATION = "SystemMethodInterceptor";
-
- /**
- * Logging
- */
private static Log logger = LogFactory.getLog(AuditComponentImpl.class);
- /**
- * Suspend resume auditing
- */
- private static ThreadLocal auditFlag = new ThreadLocal();
-
- /**
- * IOC
- */
- private PublicServiceIdentifier publicServiceIdentifier;
-
- private AuditConfiguration auditConfiguration;
-
+ private AuditModelRegistry auditModelRegistry;
+ private PropertyValueDAO propertyValueDAO;
private AuditDAO auditDAO;
-
private TransactionService transactionService;
- private NodeService nodeService;
-
- private NamespacePrefixResolver namespacePrefixResolver;
-
- private AuditModel auditModel;
-
- /**
- * Keep hold of the host where the audit occurs. TODO: Check that we get the correct address ...
- */
-
- private InetAddress auditHost;
-
-
-
/**
* Default constructor
*/
public AuditComponentImpl()
{
- super();
- // Initialise the host address
- try
- {
- auditHost = InetAddress.getLocalHost();
- }
- catch (UnknownHostException e)
- {
- logger.error("Failed to get local host address", e);
- }
- }
-
- /*
- * IOC property setters
- */
-
- /**
- * Set the DAO for recording auditable information when no exception occurs.
- */
- public void setAuditDAO(AuditDAO auditDAO)
- {
- this.auditDAO = auditDAO;
- }
-
- /**
- * Set the DAO for recording failed actions - this is done in another transaction.
- */
- public void setTransactionService(TransactionService transactionService)
- {
- this.transactionService = transactionService;
}
- /**
- * Set the NodeService for path extracting.
- */
- public void setNodeService(NodeService nodeService)
- {
- this.nodeService = nodeService;
- }
-
- /**
- * Set the audit configuration.
- */
- public void setAuditConfiguration(AuditConfiguration auditConfiguration)
- {
- this.auditConfiguration = auditConfiguration;
- }
-
- /**
- * Set the helper used to identify public services
- */
- public void setPublicServiceIdentifier(PublicServiceIdentifier publicServiceIdentifier)
- {
- this.publicServiceIdentifier = publicServiceIdentifier;
- }
-
- /**
- * Set the audit model.
- */
- public void setAuditModel(AuditModel auditModel)
- {
- this.auditModel = auditModel;
- }
-
-
- /**
- * Set the namespacePrefixResolver.
- */
- public void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
- {
- this.namespacePrefixResolver = namespacePrefixResolver;
- }
-
- public Object audit(MethodInvocation mi) throws Throwable
- {
- if ((auditFlag.get() == null) || (!auditFlag.get().booleanValue()))
- {
- if (auditModel instanceof AuditEntry && ((AuditEntry) auditModel).getEnabled() == TrueFalseUnset.TRUE)
- {
- boolean auditInternal = (auditModel.getAuditInternalServiceMethods(mi) == TrueFalseUnset.TRUE);
- try
- {
- Method method = mi.getMethod();
- String methodName = method.getName();
- String serviceName = publicServiceIdentifier.getPublicServiceName(mi);
-
- if (!auditInternal)
- {
- auditFlag.set(Boolean.TRUE);
- }
- else
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("Auditing internal service use for - " + serviceName + "." + methodName);
- }
- }
-
- if (method.isAnnotationPresent(Auditable.class))
- {
-
- if (serviceName != null)
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("Auditing - " + serviceName + "." + methodName);
- }
- return auditImpl(mi, true);
- }
- else
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("UnknownService." + methodName);
- }
- return auditImpl(mi, true);
- }
-
- }
- else if (method.isAnnotationPresent(NotAuditable.class))
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("Not Audited. " + serviceName + "." + methodName);
- }
- return mi.proceed();
- }
- else
- {
- if (logger.isDebugEnabled())
- {
- logger.debug("Unannotated service method " + serviceName + "." + methodName);
- }
- if (method.getDeclaringClass().isInterface() && method.getDeclaringClass().isAnnotationPresent(PublicService.class))
- {
- throw new RuntimeException("Unannotated service method " + serviceName + "." + methodName);
- }
- else
- {
- return mi.proceed();
- }
- }
- }
- finally
- {
- if (!auditInternal)
- {
- auditFlag.set(Boolean.FALSE);
- }
- }
- }
- else
- {
- return mi.proceed();
- }
- }
- else
- {
- return mi.proceed();
- }
- }
-
- /**
- * Internal audit of a method invocation
- *
- * @param mi -
- * the method to audit
- * @return - the return object from the audited method
- * @throws Throwable -
- * any Throwable that can be thrown by th audtied method.
- */
- public Object auditImpl(MethodInvocation mi, boolean execute) throws Throwable
- {
- final AuditState auditInfo = new AuditState(auditConfiguration);
- // RecordOptions recordOptions = auditModel.getAuditRecordOptions(mi);
- AuditMode auditMode = AuditMode.UNSET;
- try
- {
- Object o = null;
- auditMode = beforeInvocation(auditMode, auditInfo, mi);
- if (execute)
- {
- o = mi.proceed();
- auditMode = postInvocation(auditMode, auditInfo, mi, o);
- }
- if ((auditMode == AuditMode.ALL) || (auditMode == AuditMode.SUCCESS))
- {
- RetryingTransactionCallback