mirror of https://github.com/apache/archiva.git
split out audit facet and listener to match others
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
This commit is contained in:
parent
be20d16cfd
commit
fafb8d284f
|
@ -36,6 +36,10 @@
|
|||
<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>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -45,17 +45,17 @@
|
|||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-repository-admin-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>repository-statistics</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>archiva-plexus-bridge</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>audit</artifactId>
|
||||
<artifactId>metadata-repository-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.archiva</groupId>
|
||||
<artifactId>metadata-model</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.inject</groupId>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.audit;
|
||||
package org.apache.archiva.metadata.model.facets;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.archiva.audit;
|
||||
package org.apache.archiva.repository.events;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
@ -19,6 +19,8 @@ package org.apache.archiva.audit;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.metadata.model.facets.AuditEvent;
|
||||
|
||||
/**
|
||||
* AuditListener
|
||||
*
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ package org.apache.archiva.audit;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.archiva.repository.events.AuditListener;
|
||||
|
||||
/**
|
||||
* Auditable
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue