diff --git a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml
index dce92afeb9..5084416677 100644
--- a/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml
+++ b/config/alfresco/ibatis/org.hibernate.dialect.Dialect/audit-common-SqlMap.xml
@@ -135,14 +135,20 @@
delete
from
alf_audit_entry
- where
- audit_app_id = #auditApplicationId#
-
- = #auditFromTime#]]>
-
-
-
-
+
+
+ audit_app_id = #auditApplicationId#
+
+
+ = #auditFromTime#]]>
+
+
+
+
+
+ id in #auditEntryIds[]#
+
+
diff --git a/source/java/org/alfresco/repo/audit/AuditComponent.java b/source/java/org/alfresco/repo/audit/AuditComponent.java
index 3c742ac2d9..7f5deaf88b 100644
--- a/source/java/org/alfresco/repo/audit/AuditComponent.java
+++ b/source/java/org/alfresco/repo/audit/AuditComponent.java
@@ -19,6 +19,7 @@
package org.alfresco.repo.audit;
import java.io.Serializable;
+import java.util.List;
import java.util.Map;
import org.alfresco.repo.audit.model.AuditApplication;
@@ -89,6 +90,14 @@ public interface AuditComponent
*/
int deleteAuditEntries(String applicationName, Long fromTime, Long toTime);
+ /**
+ * Delete a discrete list of audit entries based on ID
+ *
+ * @param auditEntryIds the audit entry IDs to delete
+ * @return Returns the number of entries deleted
+ */
+ int deleteAuditEntries(List auditEntryIds);
+
/**
* Check if an audit path is enabled. The path will be disabled if it or any higher
* path has been explicitly disabled. Any disabled path will not be processed when
diff --git a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
index 9a230125f0..22ded77f3a 100644
--- a/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
+++ b/source/java/org/alfresco/repo/audit/AuditComponentImpl.java
@@ -146,6 +146,21 @@ public class AuditComponentImpl implements AuditComponent
return deleted;
}
+ /**
+ * {@inheritDoc}
+ * @since 3.2
+ */
+ @Override
+ public int deleteAuditEntries(List auditEntryIds)
+ {
+ // Shortcut, if necessary
+ if (auditEntryIds.size() == 0)
+ {
+ return 0;
+ }
+ return auditDAO.deleteAuditEntries(auditEntryIds);
+ }
+
/**
* @param application the audit application object
* @return Returns a copy of the set of disabled paths associated with the application
diff --git a/source/java/org/alfresco/repo/audit/AuditComponentTest.java b/source/java/org/alfresco/repo/audit/AuditComponentTest.java
index 18239918f7..4c25407657 100644
--- a/source/java/org/alfresco/repo/audit/AuditComponentTest.java
+++ b/source/java/org/alfresco/repo/audit/AuditComponentTest.java
@@ -523,7 +523,7 @@ public class AuditComponentTest extends TestCase
auditModelRegistry.registerModel(testModelUrl);
auditModelRegistry.loadAuditModels();
- final List