From ff43de7a653a7f671b8ae7ade16734aa5c8495ee Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 9 Sep 2011 08:33:15 +0000 Subject: [PATCH] trigger audit event for file pattern actions git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1167035 13f79535-47bb-0310-9956-ffa450edef68 --- .../admin/ArchivaAdministration.java | 11 +++++-- .../admin/DefaultArchivaAdministration.java | 30 ++++++++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java index 57289303b..a6b37308f 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/ArchivaAdministration.java @@ -63,13 +63,20 @@ public interface ArchivaAdministration void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation ) throws RepositoryAdminException; + void setKnownContentConsumers( List 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 invalidContentConsumers, AuditInformation auditInformation ) throws RepositoryAdminException; - void removeInvalidContentConsumer( String knownContentConsumer, AuditInformation auditInformation ) + void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation ) throws RepositoryAdminException; } diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java index 2d50de92f..6f3ae7652 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java @@ -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 knownContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + if ( knownContentConsumers == null ) + { + return; + } + for ( String knowContentConsumer : knownContentConsumers ) + { + addKnownContentConsumer( knowContentConsumer, auditInformation ); + } + } + + public void setInvalidContentConsumers( List invalidContentConsumers, AuditInformation auditInformation ) + throws RepositoryAdminException + { + if ( invalidContentConsumers == null ) + { + return; + } + for ( String invalidContentConsumer : invalidContentConsumers ) + { + addKnownContentConsumer( invalidContentConsumer, auditInformation ); + } + } + + //------------------------- // //------------------------- -- 2.39.5