]> source.dussan.org Git - archiva.git/commitdiff
split out audit facet and listener to match others
authorBrett Porter <brett@apache.org>
Thu, 31 Jul 2014 05:10:37 +0000 (15:10 +1000)
committerBrett Porter <brett@apache.org>
Thu, 31 Jul 2014 05:10:37 +0000 (15:10 +1000)
by placing these in the metadata model / API they can be used more broadly,
while the storage-dependant implementation can be in a plugin. This means the
plugins can be removed from the admin implementation, which can then be used
(as required) in the CLI

36 files changed:
archiva-cli/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/DefaultArchivaAdministration.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/networkproxy/DefaultNetworkProxyAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockAuditListener.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/networkproxy/NetworkProxyAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultMergeRepositoriesService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java
archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/api/DefaultFileUploadService.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/repository/audit/TestAuditListener.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/DavResourceTest.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/facets/AuditEvent.java [new file with mode: 0644]
archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/AuditListener.java [new file with mode: 0644]
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java [deleted file]
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEventFactory.java
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditListener.java [deleted file]
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditLog.java
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditManager.java
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/Auditable.java
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/DefaultAuditManager.java
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/MetadataAuditListener.java
archiva-modules/plugins/audit/src/test/java/org/apache/archiva/audit/AuditManagerTest.java

index f47154902703fee5039e75d7cc7f8b81873e2abe..6faddb5a6f8799b19a2a861033a4bfc895c94755 100644 (file)
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-admin-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-repository-admin-default</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-consumer-api</artifactId>
index e2a9d5caa343a7d5774e3bf5186b7f1b005eb977..1f2a9e3358273185cc9ec657e10bd851dd6abe3f 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.archiva.consumers.core.repository;
  * under the License.
  */
 
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
index b64ff906c61943d06f4caca487f32d6d1b4f5f9e..f0f8d770192fc2b88d6b44e53540929cf3084bda 100644 (file)
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
-      <artifactId>repository-statistics</artifactId>
+      <artifactId>archiva-plexus-bridge</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-plexus-bridge</artifactId>
+      <artifactId>metadata-repository-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
-      <artifactId>audit</artifactId>
+      <artifactId>metadata-model</artifactId>
     </dependency>
     <dependency>
       <groupId>javax.inject</groupId>
index 3baa4263288a094cd8bdb105dadff432137eccb1..183e15b75f976f1a772a20d1fb3de360bad40421 100644 (file)
@@ -21,17 +21,18 @@ package org.apache.archiva.admin.repository;
 import org.apache.archiva.admin.model.AuditInformation;
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.RepositoryCommonValidator;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
 import org.apache.archiva.configuration.ArchivaConfiguration;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.IndeterminateConfigurationException;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.components.registry.Registry;
+import org.apache.archiva.repository.events.AuditListener;
 import org.modelmapper.ModelMapper;
 import org.modelmapper.convention.MatchingStrategies;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -47,6 +48,7 @@ public abstract class AbstractRepositoryAdmin
     protected Logger log = LoggerFactory.getLogger( getClass() );
 
     @Inject
+    @Autowired(required = false)
     private List<AuditListener> auditListeners = new ArrayList<>();
 
     @Inject
index f357bc2db84944a277ac15a76be3dcf71b65ef7d..a75a88e112767d85d329310ba4670e68c66cd095 100644 (file)
@@ -27,10 +27,10 @@ import org.apache.archiva.admin.model.beans.NetworkConfiguration;
 import org.apache.archiva.admin.model.beans.OrganisationInformation;
 import org.apache.archiva.admin.model.beans.UiConfiguration;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.UserInterfaceOptions;
 import org.apache.archiva.configuration.WebappConfiguration;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.commons.lang.StringUtils;
 import org.apache.http.impl.conn.PoolingClientConnectionManager;
 import org.apache.maven.wagon.providers.http.HttpWagon;
index af4fea009c788ee29314db519b69b9d589640c5a..0f8e54f3d69b4cc7071693cd4fb54936806254c0 100644 (file)
@@ -25,9 +25,9 @@ import org.apache.archiva.admin.model.beans.RepositoryGroup;
 import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.scheduler.MergedRemoteIndexesScheduler;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
index cfe4b624eeccd01457f8a2f7c9f5b725bcdef7aa..f398bca26b8a24c514336b66bc94634606a9a33d 100644 (file)
@@ -23,7 +23,6 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
@@ -31,6 +30,7 @@ import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.archiva.configuration.RepositoryGroupConfiguration;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.RepositorySession;
index 7b63551a3738048509d53bb712c67a045caa3ddf..7c3eb0c3e821ca1d2796e19d8454904162a20026 100644 (file)
@@ -23,10 +23,10 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.NetworkProxy;
 import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.NetworkProxyConfiguration;
 import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
 
index 73450cbd56587b516d9d6899f8d072119c3083ab..fbf20481c8efba00df52d95a511526382f25fe00 100644 (file)
@@ -26,10 +26,10 @@ import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorOrderComparator;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.archiva.configuration.functors.ProxyConnectorSelectionPredicate;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.stereotype.Service;
index 28482f7c3912790f33877902ecbb8b2c6fd9b51b..9f6a20b9d037c07d3e388528524768cf165d6b2a 100644 (file)
@@ -23,13 +23,13 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
 import org.apache.archiva.configuration.Configuration;
 import org.apache.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.index.NexusIndexer;
 import org.apache.maven.index.context.IndexCreator;
index 90cd99692ffc0f6e846507c63d03c92730072cb7..42abfcf5e65bd81d0dfcf4ec95e002ba46a9d780 100644 (file)
@@ -18,8 +18,8 @@ package org.apache.archiva.admin.mock;
  * under the License.
  */
 
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
+import org.apache.archiva.repository.events.AuditListener;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
index 5abd7a6fa42a220fc5bbcfdbff4cd6fc7912c2e5..2c46004ff4566f1749ba43bea64f3020f4433744 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.admin.model.beans.NetworkConfiguration;
 import org.apache.archiva.admin.model.beans.OrganisationInformation;
 import org.apache.archiva.admin.model.beans.UiConfiguration;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.junit.Test;
 
 import javax.inject.Inject;
index a79d724d08d3cdea386d45141b0baeb084d70701..9403ae19d3043e70de95ce5066de18b2ce55d525 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.beans.RepositoryGroup;
 import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.junit.Test;
 
 import javax.inject.Inject;
index 4f73fa96078d39751d44b6a1501755d5a66a15ca..f2678290eeb165078cb9731f472fc80a79a91cd0 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.admin.repository.managed;
 
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.security.common.ArchivaRoleConstants;
 import org.junit.Test;
 
index 0f6d3763406693f2c411caf093ab0ba9578bac4e..21020d1e83342b7c70da008660368d88f65a3c26 100644 (file)
@@ -22,7 +22,7 @@ import org.apache.archiva.admin.model.beans.NetworkProxy;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.model.networkproxy.NetworkProxyAdmin;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.junit.Test;
 
 import javax.inject.Inject;
index 0e4303d7246b7e074636818f90c7690f55cf66f9..7c301d122b3648b094eca0de8e31f8ee0d9d524b 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.admin.repository.proxyconnector;
 import org.apache.archiva.admin.model.beans.ProxyConnector;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.junit.Test;
 
 import java.util.Arrays;
index cf062996f1c4b46a7874c93799c959b5bd3a600f..68864460be6fb6d2562104273db027055b8b7993 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.admin.repository.remote;
 
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.junit.Test;
 
 import java.util.List;
index 104e0d2123349248941b5add49078e6148409fcd..89cd78be421c25a0cee8d3267d9d92454bcb5ae1 100644 (file)
@@ -25,8 +25,8 @@ import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.archiva.admin.model.beans.ProxyConnector;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
+import org.apache.archiva.repository.events.AuditListener;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.indexer.search.SearchResultHit;
 import org.apache.archiva.maven2.model.Artifact;
index a5c76b0b9645b66f8ca1ad3f46875f171310616b..cead4c0fa870787dbe70589391d427e317f43fb9 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.archiva.rest.services;
 
 import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.maven2.model.Artifact;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
index 462af21275e6a62d1b0c04970a566b4e4dc67ff1..6c3aaa7d4a0f45b58c21863126afce9e3aefe158 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.checksum.ChecksumAlgorithm;
 import org.apache.archiva.checksum.ChecksummedFile;
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
index 1719a7188690cc80787a5074b5ec28340307d682..6e6c9056538440aef73dbfffdf38db0e107f23eb 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.checksum.ChecksumAlgorithm;
 import org.apache.archiva.checksum.ChecksummedFile;
 import org.apache.archiva.common.utils.VersionComparator;
index 559f160d80f2251076f024d513ddc232369ea305..3f05f78820b3921f448da0baba1a038c4db6d4a7 100644 (file)
@@ -20,8 +20,8 @@ package org.apache.archiva.webdav;
  */
 
 import org.apache.archiva.admin.model.beans.ManagedRepository;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
+import org.apache.archiva.repository.events.AuditListener;
 import org.apache.archiva.common.filelock.FileLockException;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.filelock.FileLockTimeoutException;
index a239abaee08479875a5077d17491c459de50f548..782682ae5cc2c5ea033db3636cd518bc5b305d11 100644 (file)
@@ -24,8 +24,8 @@ import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.beans.RemoteRepository;
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
+import org.apache.archiva.repository.events.AuditListener;
 import org.apache.archiva.audit.Auditable;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
index b58cee62eb19084365400f60d4fd1f3218b024e8..8cab4dc2c4567b9e187b8f5712ddfcde3c548238 100644 (file)
@@ -19,8 +19,8 @@ package org.apache.archiva.repository.audit;
  * under the License.
  */
 
-import org.apache.archiva.audit.AuditEvent;
-import org.apache.archiva.audit.AuditListener;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
+import org.apache.archiva.repository.events.AuditListener;
 
 import java.util.ArrayList;
 import java.util.List;
index e8e8b63a879c727d93040729782dd1e54833f805..0d99709b6dda1529e251f66f124c0e2d815ae9ab 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.archiva.webdav;
 
 import junit.framework.TestCase;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
-import org.apache.archiva.audit.AuditListener;
+import org.apache.archiva.repository.events.AuditListener;
 import org.apache.archiva.common.filelock.FileLockManager;
 import org.apache.commons.io.FileUtils;
 import org.apache.jackrabbit.webdav.DavException;
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/facets/AuditEvent.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/facets/AuditEvent.java
new file mode 100644 (file)
index 0000000..ba47519
--- /dev/null
@@ -0,0 +1,361 @@
+package org.apache.archiva.metadata.model.facets;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.metadata.model.MetadataFacet;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TimeZone;
+
+/**
+ * AuditEvent
+ *
+ *
+ */
+public class AuditEvent
+    implements MetadataFacet
+{
+    public static final String TIMESTAMP_FORMAT = "yyyy/MM/dd/HHmmss.SSS";
+
+    public static final String CREATE_DIR = "Created Directory";
+
+    public static final String CREATE_FILE = "Created File";
+
+    public static final String REMOVE_DIR = "Removed Directory";
+
+    public static final String REMOVE_FILE = "Removed File";
+
+    public static final String MODIFY_FILE = "Modified File";
+
+    public static final String MOVE_FILE = "Moved File";
+
+    public static final String MOVE_DIRECTORY = "Moved Directory";
+
+    public static final String COPY_DIRECTORY = "Copied Directory";
+
+    public static final String COPY_FILE = "Copied File";
+
+    public static final String UPLOAD_FILE = "Uploaded File";
+
+    public static final String ADD_LEGACY_PATH = "Added Legacy Artifact Path";
+
+    public static final String REMOVE_LEGACY_PATH = "Removed Legacy Artifact Path";
+
+    public static final String PURGE_ARTIFACT = "Purged Artifact";
+
+    public static final String PURGE_FILE = "Purged Support File";
+
+    public static final String REMOVE_SCANNED = "Removed in Filesystem";
+
+    public static final String MERGING_REPOSITORIES = "Merged Artifact";
+
+    // configuration events
+
+    public static final String ADD_MANAGED_REPO = "Added Managed Repository";
+
+    public static final String MODIFY_MANAGED_REPO = "Updated Managed Repository";
+
+    public static final String DELETE_MANAGED_REPO = "Deleted Managed Repository";
+
+    public static final String ADD_REMOTE_REPO = "Added Remote Repository";
+
+    public static final String MODIFY_REMOTE_REPO = "Updated Remote Repository";
+
+    public static final String DELETE_REMOTE_REPO = "Deleted Remote Repository";
+
+    public static final String ADD_REPO_GROUP = "Added Repository Group";
+
+    public static final String DELETE_REPO_GROUP = "Deleted Repository Group";
+
+    public static final String MODIFY_REPO_GROUP = "Modify Repository Group";
+
+    public static final String ADD_REPO_TO_GROUP = "Added Repository to Group";
+
+    public static final String DELETE_REPO_FROM_GROUP = "Deleted Repository from Group";
+
+    public static final String ENABLE_REPO_CONSUMER = "Enabled Content Consumer";
+
+    public static final String DISABLE_REPO_CONSUMER = "Disabled Content Consumer";
+
+    public static final String ADD_PATTERN = "Added File Type Pattern";
+
+    public static final String REMOVE_PATTERN = "Removed File Type Pattern";
+
+    public static final String MERGE_REPO_REMOTE = "Merged Staging Repository Triggered Remotely";
+
+    public static final String ADD_PROXY_CONNECTOR = "Added Proxy Connector";
+
+    public static final String DELETE_PROXY_CONNECTOR = "Deleted Proxy Connector";
+
+    public static final String MODIFY_PROXY_CONNECTOR = "Updated Proxy Connector";
+
+    public static final String ADD_NETWORK_PROXY = "Added Network Proxy";
+
+    public static final String DELETE_NETWORK_PROXY = "Deleted Network Proxy";
+
+    public static final String MODIFY_NETWORK_PROXY = "Updated Network Proxy";
+    
+    private String repositoryId;
+
+    private String userId;
+
+    private String remoteIP;
+
+    // TODO: change to artifact reference? does it ever refer to just a path?
+
+    private String resource;
+
+    private String action;
+
+    private Date timestamp;
+
+    public static final String FACET_ID = "org.apache.archiva.audit";
+
+    private static final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone( "UTC" );
+
+    private static final int TS_LENGTH = TIMESTAMP_FORMAT.length();
+
+    public AuditEvent()
+    {
+        /* do nothing */
+    }
+
+    public AuditEvent( String name, String repositoryId )
+    {
+        String ts = name.substring( 0, TS_LENGTH );
+        try
+        {
+            timestamp = createNameFormat().parse( ts );
+        }
+        catch ( ParseException e )
+        {
+            throw new IllegalArgumentException( "Improperly formatted timestamp for audit log event: " + ts, e);
+        }
+
+        if ( name.length() > TS_LENGTH )
+        {
+            if ( name.charAt( TS_LENGTH ) != '/' )
+            {
+                throw new IllegalArgumentException(
+                    "Improperly formatted name for audit log event, no / separator between timestamp and resource: " +
+                        name );
+            }
+        }
+
+        this.repositoryId = repositoryId;
+    }
+
+    public AuditEvent( String repoId, String user, String resource, String action )
+    {
+        this.repositoryId = repoId;
+        this.userId = user;
+        this.resource = resource;
+        this.action = action;
+        this.timestamp = Calendar.getInstance().getTime();
+    }
+
+    public String getRepositoryId()
+    {
+        return repositoryId;
+    }
+
+    public void setRepositoryId( String repositoryId )
+    {
+        this.repositoryId = repositoryId;
+    }
+
+    public String getUserId()
+    {
+        return userId;
+    }
+
+    public void setUserId( String userId )
+    {
+        this.userId = userId;
+    }
+
+    public String getResource()
+    {
+        return resource;
+    }
+
+    public void setResource( String resource )
+    {
+        this.resource = resource;
+    }
+
+    public String getAction()
+    {
+        return action;
+    }
+
+    public void setAction( String action )
+    {
+        this.action = action;
+    }
+
+    public String getRemoteIP()
+    {
+        return remoteIP;
+    }
+
+    public void setRemoteIP( String remoteIP )
+    {
+        this.remoteIP = remoteIP;
+    }
+
+    public Date getTimestamp()
+    {
+        return timestamp;
+    }
+
+    public void setTimestamp( Date timestamp )
+    {
+        this.timestamp = timestamp;
+    }
+
+    @Override
+    public String getFacetId()
+    {
+        return FACET_ID;
+    }
+
+    @Override
+    public String getName()
+    {
+        // use the hashCode here to make it unique if multiple events occur at a certain timestamp. None of the other
+        // fields is unique on its own
+        return createNameFormat().format( timestamp ) + "/" + Integer.toHexString( hashCode() );
+        // TODO: a simple incremental counter might be better since it will retain ordering, but then we need to do a
+        //  bit of locking...
+    }
+
+    private static SimpleDateFormat createNameFormat()
+    {
+        SimpleDateFormat fmt = new SimpleDateFormat( TIMESTAMP_FORMAT );
+        fmt.setTimeZone( UTC_TIME_ZONE );
+        return fmt;
+    }
+
+    @Override
+    public Map<String, String> toProperties()
+    {
+        Map<String, String> properties = new HashMap<>();
+        properties.put( "action", this.action );
+        if ( this.userId != null )
+        {
+            properties.put( "user", this.userId );
+        }
+        if ( this.remoteIP != null )
+        {
+            properties.put( "remoteIP", this.remoteIP );
+        }
+        if ( this.resource != null )
+        {
+            properties.put( "resource", this.resource );
+        }
+        return properties;
+    }
+
+    @Override
+    public void fromProperties( Map<String, String> properties )
+    {
+        this.action = properties.get( "action" );
+        this.remoteIP = properties.get( "remoteIP" );
+        this.userId = properties.get( "user" );
+        this.resource = properties.get( "resource" );
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        AuditEvent that = (AuditEvent) o;
+
+        if ( !action.equals( that.action ) )
+        {
+            return false;
+        }
+        if ( remoteIP != null ? !remoteIP.equals( that.remoteIP ) : that.remoteIP != null )
+        {
+            return false;
+        }
+        if ( repositoryId != null ? !repositoryId.equals( that.repositoryId ) : that.repositoryId != null )
+        {
+            return false;
+        }
+        if ( resource != null ? !resource.equals( that.resource ) : that.resource != null )
+        {
+            return false;
+        }
+        if ( !timestamp.equals( that.timestamp ) )
+        {
+            return false;
+        }
+        if ( userId != null ? !userId.equals( that.userId ) : that.userId != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        int result = repositoryId != null ? repositoryId.hashCode() : 0;
+        result = 31 * result + ( userId != null ? userId.hashCode() : 0 );
+        result = 31 * result + ( remoteIP != null ? remoteIP.hashCode() : 0 );
+        result = 31 * result + ( resource != null ? resource.hashCode() : 0 );
+        result = 31 * result + action.hashCode();
+        result = 31 * result + timestamp.hashCode();
+        return result;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "AuditEvent" );
+        sb.append( "{repositoryId='" ).append( repositoryId ).append( '\'' );
+        sb.append( ", userId='" ).append( userId ).append( '\'' );
+        sb.append( ", remoteIP='" ).append( remoteIP ).append( '\'' );
+        sb.append( ", resource='" ).append( resource ).append( '\'' );
+        sb.append( ", action='" ).append( action ).append( '\'' );
+        sb.append( ", timestamp=" ).append( timestamp );
+        sb.append( '}' );
+        return sb.toString();
+    }
+
+
+}
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/AuditListener.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/AuditListener.java
new file mode 100644 (file)
index 0000000..ade9f79
--- /dev/null
@@ -0,0 +1,37 @@
+package org.apache.archiva.repository.events;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.metadata.model.facets.AuditEvent;
+
+/**
+ * AuditListener 
+ *
+ *
+ */
+public interface AuditListener
+{
+    /**
+     * Notification that an audit event occured. 
+     * 
+     * @param event the event details.
+     */
+    void auditEvent( AuditEvent event );
+}
diff --git a/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java b/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java
deleted file mode 100644 (file)
index b0da64d..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-package org.apache.archiva.audit;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.archiva.metadata.model.MetadataFacet;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TimeZone;
-
-/**
- * AuditEvent
- *
- *
- */
-public class AuditEvent
-    implements MetadataFacet
-{
-    public static final String TIMESTAMP_FORMAT = "yyyy/MM/dd/HHmmss.SSS";
-
-    public static final String CREATE_DIR = "Created Directory";
-
-    public static final String CREATE_FILE = "Created File";
-
-    public static final String REMOVE_DIR = "Removed Directory";
-
-    public static final String REMOVE_FILE = "Removed File";
-
-    public static final String MODIFY_FILE = "Modified File";
-
-    public static final String MOVE_FILE = "Moved File";
-
-    public static final String MOVE_DIRECTORY = "Moved Directory";
-
-    public static final String COPY_DIRECTORY = "Copied Directory";
-
-    public static final String COPY_FILE = "Copied File";
-
-    public static final String UPLOAD_FILE = "Uploaded File";
-
-    public static final String ADD_LEGACY_PATH = "Added Legacy Artifact Path";
-
-    public static final String REMOVE_LEGACY_PATH = "Removed Legacy Artifact Path";
-
-    public static final String PURGE_ARTIFACT = "Purged Artifact";
-
-    public static final String PURGE_FILE = "Purged Support File";
-
-    public static final String REMOVE_SCANNED = "Removed in Filesystem";
-
-    public static final String MERGING_REPOSITORIES = "Merged Artifact";
-
-    // configuration events
-
-    public static final String ADD_MANAGED_REPO = "Added Managed Repository";
-
-    public static final String MODIFY_MANAGED_REPO = "Updated Managed Repository";
-
-    public static final String DELETE_MANAGED_REPO = "Deleted Managed Repository";
-
-    public static final String ADD_REMOTE_REPO = "Added Remote Repository";
-
-    public static final String MODIFY_REMOTE_REPO = "Updated Remote Repository";
-
-    public static final String DELETE_REMOTE_REPO = "Deleted Remote Repository";
-
-    public static final String ADD_REPO_GROUP = "Added Repository Group";
-
-    public static final String DELETE_REPO_GROUP = "Deleted Repository Group";
-
-    public static final String MODIFY_REPO_GROUP = "Modify Repository Group";
-
-    public static final String ADD_REPO_TO_GROUP = "Added Repository to Group";
-
-    public static final String DELETE_REPO_FROM_GROUP = "Deleted Repository from Group";
-
-    public static final String ENABLE_REPO_CONSUMER = "Enabled Content Consumer";
-
-    public static final String DISABLE_REPO_CONSUMER = "Disabled Content Consumer";
-
-    public static final String ADD_PATTERN = "Added File Type Pattern";
-
-    public static final String REMOVE_PATTERN = "Removed File Type Pattern";
-
-    public static final String MERGE_REPO_REMOTE = "Merged Staging Repository Triggered Remotely";
-
-    public static final String ADD_PROXY_CONNECTOR = "Added Proxy Connector";
-
-    public static final String DELETE_PROXY_CONNECTOR = "Deleted Proxy Connector";
-
-    public static final String MODIFY_PROXY_CONNECTOR = "Updated Proxy Connector";
-
-    public static final String ADD_NETWORK_PROXY = "Added Network Proxy";
-
-    public static final String DELETE_NETWORK_PROXY = "Deleted Network Proxy";
-
-    public static final String MODIFY_NETWORK_PROXY = "Updated Network Proxy";
-    
-    private String repositoryId;
-
-    private String userId;
-
-    private String remoteIP;
-
-    // TODO: change to artifact reference? does it ever refer to just a path?
-
-    private String resource;
-
-    private String action;
-
-    private Date timestamp;
-
-    public static final String FACET_ID = "org.apache.archiva.audit";
-
-    private static final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone( "UTC" );
-
-    private static final int TS_LENGTH = TIMESTAMP_FORMAT.length();
-
-    public AuditEvent()
-    {
-        /* do nothing */
-    }
-
-    public AuditEvent( String name, String repositoryId )
-    {
-        String ts = name.substring( 0, TS_LENGTH );
-        try
-        {
-            timestamp = createNameFormat().parse( ts );
-        }
-        catch ( ParseException e )
-        {
-            throw new IllegalArgumentException( "Improperly formatted timestamp for audit log event: " + ts, e);
-        }
-
-        if ( name.length() > TS_LENGTH )
-        {
-            if ( name.charAt( TS_LENGTH ) != '/' )
-            {
-                throw new IllegalArgumentException(
-                    "Improperly formatted name for audit log event, no / separator between timestamp and resource: " +
-                        name );
-            }
-        }
-
-        this.repositoryId = repositoryId;
-    }
-
-    public AuditEvent( String repoId, String user, String resource, String action )
-    {
-        this.repositoryId = repoId;
-        this.userId = user;
-        this.resource = resource;
-        this.action = action;
-        this.timestamp = Calendar.getInstance().getTime();
-    }
-
-    public String getRepositoryId()
-    {
-        return repositoryId;
-    }
-
-    public void setRepositoryId( String repositoryId )
-    {
-        this.repositoryId = repositoryId;
-    }
-
-    public String getUserId()
-    {
-        return userId;
-    }
-
-    public void setUserId( String userId )
-    {
-        this.userId = userId;
-    }
-
-    public String getResource()
-    {
-        return resource;
-    }
-
-    public void setResource( String resource )
-    {
-        this.resource = resource;
-    }
-
-    public String getAction()
-    {
-        return action;
-    }
-
-    public void setAction( String action )
-    {
-        this.action = action;
-    }
-
-    public String getRemoteIP()
-    {
-        return remoteIP;
-    }
-
-    public void setRemoteIP( String remoteIP )
-    {
-        this.remoteIP = remoteIP;
-    }
-
-    public Date getTimestamp()
-    {
-        return timestamp;
-    }
-
-    public void setTimestamp( Date timestamp )
-    {
-        this.timestamp = timestamp;
-    }
-
-    @Override
-    public String getFacetId()
-    {
-        return FACET_ID;
-    }
-
-    @Override
-    public String getName()
-    {
-        // use the hashCode here to make it unique if multiple events occur at a certain timestamp. None of the other
-        // fields is unique on its own
-        return createNameFormat().format( timestamp ) + "/" + Integer.toHexString( hashCode() );
-        // TODO: a simple incremental counter might be better since it will retain ordering, but then we need to do a
-        //  bit of locking...
-    }
-
-    private static SimpleDateFormat createNameFormat()
-    {
-        SimpleDateFormat fmt = new SimpleDateFormat( TIMESTAMP_FORMAT );
-        fmt.setTimeZone( UTC_TIME_ZONE );
-        return fmt;
-    }
-
-    @Override
-    public Map<String, String> toProperties()
-    {
-        Map<String, String> properties = new HashMap<>();
-        properties.put( "action", this.action );
-        if ( this.userId != null )
-        {
-            properties.put( "user", this.userId );
-        }
-        if ( this.remoteIP != null )
-        {
-            properties.put( "remoteIP", this.remoteIP );
-        }
-        if ( this.resource != null )
-        {
-            properties.put( "resource", this.resource );
-        }
-        return properties;
-    }
-
-    @Override
-    public void fromProperties( Map<String, String> properties )
-    {
-        this.action = properties.get( "action" );
-        this.remoteIP = properties.get( "remoteIP" );
-        this.userId = properties.get( "user" );
-        this.resource = properties.get( "resource" );
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        AuditEvent that = (AuditEvent) o;
-
-        if ( !action.equals( that.action ) )
-        {
-            return false;
-        }
-        if ( remoteIP != null ? !remoteIP.equals( that.remoteIP ) : that.remoteIP != null )
-        {
-            return false;
-        }
-        if ( repositoryId != null ? !repositoryId.equals( that.repositoryId ) : that.repositoryId != null )
-        {
-            return false;
-        }
-        if ( resource != null ? !resource.equals( that.resource ) : that.resource != null )
-        {
-            return false;
-        }
-        if ( !timestamp.equals( that.timestamp ) )
-        {
-            return false;
-        }
-        if ( userId != null ? !userId.equals( that.userId ) : that.userId != null )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        int result = repositoryId != null ? repositoryId.hashCode() : 0;
-        result = 31 * result + ( userId != null ? userId.hashCode() : 0 );
-        result = 31 * result + ( remoteIP != null ? remoteIP.hashCode() : 0 );
-        result = 31 * result + ( resource != null ? resource.hashCode() : 0 );
-        result = 31 * result + action.hashCode();
-        result = 31 * result + timestamp.hashCode();
-        return result;
-    }
-
-    @Override
-    public String toString()
-    {
-        final StringBuilder sb = new StringBuilder();
-        sb.append( "AuditEvent" );
-        sb.append( "{repositoryId='" ).append( repositoryId ).append( '\'' );
-        sb.append( ", userId='" ).append( userId ).append( '\'' );
-        sb.append( ", remoteIP='" ).append( remoteIP ).append( '\'' );
-        sb.append( ", resource='" ).append( resource ).append( '\'' );
-        sb.append( ", action='" ).append( action ).append( '\'' );
-        sb.append( ", timestamp=" ).append( timestamp );
-        sb.append( '}' );
-        return sb.toString();
-    }
-
-
-}
index f25ef8ec95e1abda3b4cbb078526918909ea9cdb..620100fcfc3bcc0b9ae967dcddfa90d95819421f 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.audit;
 
 import org.apache.archiva.metadata.model.MetadataFacet;
 import org.apache.archiva.metadata.model.MetadataFacetFactory;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.springframework.stereotype.Service;
 
 /**
diff --git a/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditListener.java b/archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditListener.java
deleted file mode 100644 (file)
index 6e64d6e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.archiva.audit;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * AuditListener 
- *
- *
- */
-public interface AuditListener
-{
-    /**
-     * Notification that an audit event occured. 
-     * 
-     * @param event the event details.
-     */
-    void auditEvent( AuditEvent event );
-}
index eeb99b5d7a663f9f92c81473953a3a111d3050f8..37b5a521157fd694808f1fd060fcc1af42739fa1 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.archiva.audit;
  * under the License.
  */
 
+import org.apache.archiva.metadata.model.facets.AuditEvent;
+import org.apache.archiva.repository.events.AuditListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
index 09d6b765bdf918066664fafa9f770b7ccc71be26..73b0a16e6a69f67de7c9671fcaa856573ded4c5e 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.archiva.audit;
  * under the License.
  */
 
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 
index 5e396b11636048f9debff8a7d7133ba362770a62..d43cff32036eddd9c69c7e4f5e82d11bf2baed26 100644 (file)
@@ -19,6 +19,8 @@ package org.apache.archiva.audit;
  * under the License.
  */
 
+import org.apache.archiva.repository.events.AuditListener;
+
 /**
  * Auditable 
  *
index ca93bbe43803e3b9bb99c0cf0831455e79f81040..44086185cb6c28e3a045ae8af635f083196e2d0a 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.archiva.audit;
  * under the License.
  */
 
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.slf4j.Logger;
index 3ad104fe5c4ccbf7d6f936983afb6da1e2e31c0e..8406bbb7aa863c6730c9f022b8ca89db9f13b7c8 100644 (file)
@@ -19,9 +19,11 @@ package org.apache.archiva.audit;
  * under the License.
  */
 
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.RepositorySessionFactory;
+import org.apache.archiva.repository.events.AuditListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
index 0505562a04465d685974a5538d1300666697a215..8119ba4e91c9dcb383d49ec52b0193ee6e34800b 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.archiva.audit;
 
 import junit.framework.TestCase;
 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
 import org.easymock.EasyMock;