]> source.dussan.org Git - archiva.git/commitdiff
trigger audit event for file pattern actions
authorOlivier Lamy <olamy@apache.org>
Fri, 9 Sep 2011 08:33:15 +0000 (08:33 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 9 Sep 2011 08:33:15 +0000 (08:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1167035 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java
archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java

index 57289303b817ed9dd4479eac4d66f5124140cafd..a6b37308f7e799671319c28b7d7d51a6d718812c 100644 (file)
@@ -63,13 +63,20 @@ public interface ArchivaAdministration
     void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
         throws RepositoryAdminException;
 
+    void setKnownContentConsumers( List<String> knownContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+
     void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
         throws RepositoryAdminException;
 
-    void addInvalidContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+    void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
+        throws RepositoryAdminException;
+
+    void setInvalidContentConsumers( List<String> invalidContentConsumers, AuditInformation auditInformation )
         throws RepositoryAdminException;
 
-    void removeInvalidContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
+    void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
         throws RepositoryAdminException;
 
 }
index 2d50de92f94933a1761f46ac560557a81de8c2a0..6f3ae76521cda9e26f11f7b7284c3b01977cd404 100644 (file)
@@ -109,6 +109,7 @@ public class DefaultArchivaAdministration
         fileType.addPattern( pattern );
 
         saveConfiguration( configuration );
+        triggerAuditEvent( "", "", AuditEvent.ADD_PATTERN, auditInformation );
     }
 
     public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
@@ -124,6 +125,7 @@ public class DefaultArchivaAdministration
         fileType.removePattern( pattern );
 
         saveConfiguration( configuration );
+                triggerAuditEvent( "", "", AuditEvent.REMOVE_PATTERN, auditInformation );
     }
 
     public FileType getFileType( String fileTypeId )
@@ -200,7 +202,33 @@ public class DefaultArchivaAdministration
         triggerAuditEvent( "", "", AuditEvent.DISABLE_REPO_CONSUMER, auditInformation );
     }
 
-//-------------------------
+    public void setKnownContentConsumers( List<String> knownContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        if ( knownContentConsumers == null )
+        {
+            return;
+        }
+        for ( String knowContentConsumer : knownContentConsumers )
+        {
+            addKnownContentConsumer( knowContentConsumer, auditInformation );
+        }
+    }
+
+    public void setInvalidContentConsumers( List<String> invalidContentConsumers, AuditInformation auditInformation )
+        throws RepositoryAdminException
+    {
+        if ( invalidContentConsumers == null )
+        {
+            return;
+        }
+        for ( String invalidContentConsumer : invalidContentConsumers )
+        {
+            addKnownContentConsumer( invalidContentConsumer, auditInformation );
+        }
+    }
+
+    //-------------------------
     //
     //-------------------------