mirror of https://github.com/apache/archiva.git
use model mapper
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1553475 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec6548f9ff
commit
3c2817d545
|
@ -46,21 +46,6 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--
|
|
||||||
<dependency>
|
|
||||||
<groupId>xalan</groupId>
|
|
||||||
<artifactId>xalan</artifactId>
|
|
||||||
<version>2.7.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.maven.indexer</groupId>
|
|
||||||
<artifactId>indexer-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.inject</groupId>
|
|
||||||
<artifactId>javax.inject</artifactId>
|
|
||||||
</dependency>
|
|
||||||
-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.sisu</groupId>
|
<groupId>org.eclipse.sisu</groupId>
|
||||||
<artifactId>org.eclipse.sisu.plexus</artifactId>
|
<artifactId>org.eclipse.sisu.plexus</artifactId>
|
||||||
|
|
|
@ -66,22 +66,8 @@
|
||||||
<artifactId>spring-taskqueue</artifactId>
|
<artifactId>spring-taskqueue</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.beanlib</groupId>
|
<groupId>org.modelmapper</groupId>
|
||||||
<artifactId>beanlib</artifactId>
|
<artifactId>modelmapper</artifactId>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>cglib</groupId>
|
|
||||||
<artifactId>cglib</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>aopalliance</groupId>
|
|
||||||
<artifactId>aopalliance</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>log4j</groupId>
|
|
||||||
<artifactId>log4j</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.wagon</groupId>
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
|
@ -254,7 +240,7 @@
|
||||||
<Import-Package>
|
<Import-Package>
|
||||||
javax.annotation,
|
javax.annotation,
|
||||||
javax.inject,
|
javax.inject,
|
||||||
net.sf.beanlib.provider.replicator,
|
org.modelmapper,
|
||||||
org.apache.archiva.admin.model*;version=${project.version},
|
org.apache.archiva.admin.model*;version=${project.version},
|
||||||
org.apache.archiva.audit;version=${project.version},
|
org.apache.archiva.audit;version=${project.version},
|
||||||
org.apache.archiva.common.plexusbridge;version=${project.version},
|
org.apache.archiva.common.plexusbridge;version=${project.version},
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.apache.archiva.configuration.Configuration;
|
||||||
import org.apache.archiva.configuration.IndeterminateConfigurationException;
|
import org.apache.archiva.configuration.IndeterminateConfigurationException;
|
||||||
import org.apache.archiva.redback.users.User;
|
import org.apache.archiva.redback.users.User;
|
||||||
import org.apache.archiva.redback.components.registry.Registry;
|
import org.apache.archiva.redback.components.registry.Registry;
|
||||||
|
import org.modelmapper.ModelMapper;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -91,6 +92,16 @@ public abstract class AbstractRepositoryAdmin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class ModelMapperHolder
|
||||||
|
{
|
||||||
|
private static ModelMapper MODEL_MAPPER = new ModelMapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ModelMapper getModelMapper()
|
||||||
|
{
|
||||||
|
return ModelMapperHolder.MODEL_MAPPER;
|
||||||
|
}
|
||||||
|
|
||||||
public List<AuditListener> getAuditListeners()
|
public List<AuditListener> getAuditListeners()
|
||||||
{
|
{
|
||||||
return auditListeners;
|
return auditListeners;
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.apache.archiva.admin.repository.admin;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import net.sf.beanlib.provider.replicator.BeanReplicator;
|
|
||||||
import org.apache.archiva.admin.model.AuditInformation;
|
import org.apache.archiva.admin.model.AuditInformation;
|
||||||
import org.apache.archiva.admin.model.RepositoryAdminException;
|
import org.apache.archiva.admin.model.RepositoryAdminException;
|
||||||
import org.apache.archiva.admin.model.admin.ArchivaAdministration;
|
import org.apache.archiva.admin.model.admin.ArchivaAdministration;
|
||||||
|
@ -81,7 +80,7 @@ public class DefaultArchivaAdministration
|
||||||
for ( org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
|
for ( org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
|
||||||
{
|
{
|
||||||
legacyArtifactPaths.add(
|
legacyArtifactPaths.add(
|
||||||
new BeanReplicator().replicateBean( legacyArtifactPath, LegacyArtifactPath.class ) );
|
getModelMapper().map( legacyArtifactPath, LegacyArtifactPath.class ) );
|
||||||
}
|
}
|
||||||
return legacyArtifactPaths;
|
return legacyArtifactPaths;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +90,7 @@ public class DefaultArchivaAdministration
|
||||||
{
|
{
|
||||||
Configuration configuration = getArchivaConfiguration().getConfiguration();
|
Configuration configuration = getArchivaConfiguration().getConfiguration();
|
||||||
|
|
||||||
configuration.addLegacyArtifactPath( new BeanReplicator().replicateBean( legacyArtifactPath,
|
configuration.addLegacyArtifactPath( getModelMapper().map( legacyArtifactPath,
|
||||||
org.apache.archiva.configuration.LegacyArtifactPath.class ) );
|
org.apache.archiva.configuration.LegacyArtifactPath.class ) );
|
||||||
|
|
||||||
saveConfiguration( configuration );
|
saveConfiguration( configuration );
|
||||||
|
@ -160,7 +159,7 @@ public class DefaultArchivaAdministration
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new BeanReplicator().replicateBean( fileType, FileType.class );
|
return getModelMapper().map( fileType, FileType.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFileType( FileType fileType, AuditInformation auditInformation )
|
public void addFileType( FileType fileType, AuditInformation auditInformation )
|
||||||
|
@ -174,7 +173,7 @@ public class DefaultArchivaAdministration
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration.getRepositoryScanning().addFileType(
|
configuration.getRepositoryScanning().addFileType(
|
||||||
new BeanReplicator().replicateBean( fileType, org.apache.archiva.configuration.FileType.class ) );
|
getModelMapper().map( fileType, org.apache.archiva.configuration.FileType.class ) );
|
||||||
saveConfiguration( configuration );
|
saveConfiguration( configuration );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +271,7 @@ public class DefaultArchivaAdministration
|
||||||
List<FileType> fileTypes = new ArrayList<FileType>( configFileTypes.size() );
|
List<FileType> fileTypes = new ArrayList<FileType>( configFileTypes.size() );
|
||||||
for ( org.apache.archiva.configuration.FileType fileType : configFileTypes )
|
for ( org.apache.archiva.configuration.FileType fileType : configFileTypes )
|
||||||
{
|
{
|
||||||
fileTypes.add( new BeanReplicator().replicateBean( fileType, FileType.class ) );
|
fileTypes.add( getModelMapper().map( fileType, FileType.class ) );
|
||||||
}
|
}
|
||||||
return fileTypes;
|
return fileTypes;
|
||||||
}
|
}
|
||||||
|
@ -300,7 +299,7 @@ public class DefaultArchivaAdministration
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new BeanReplicator().replicateBean( organisationInformation, OrganisationInformation.class );
|
return getModelMapper().map( organisationInformation, OrganisationInformation.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrganisationInformation( OrganisationInformation organisationInformation )
|
public void setOrganisationInformation( OrganisationInformation organisationInformation )
|
||||||
|
@ -310,7 +309,7 @@ public class DefaultArchivaAdministration
|
||||||
if ( organisationInformation != null )
|
if ( organisationInformation != null )
|
||||||
{
|
{
|
||||||
org.apache.archiva.configuration.OrganisationInformation organisationInformationModel =
|
org.apache.archiva.configuration.OrganisationInformation organisationInformationModel =
|
||||||
new BeanReplicator().replicateBean( organisationInformation,
|
getModelMapper().map( organisationInformation,
|
||||||
org.apache.archiva.configuration.OrganisationInformation.class );
|
org.apache.archiva.configuration.OrganisationInformation.class );
|
||||||
configuration.setOrganisationInfo( organisationInformationModel );
|
configuration.setOrganisationInfo( organisationInformationModel );
|
||||||
}
|
}
|
||||||
|
@ -334,7 +333,7 @@ public class DefaultArchivaAdministration
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new BeanReplicator().replicateBean( userInterfaceOptions, UiConfiguration.class );
|
return getModelMapper().map( userInterfaceOptions, UiConfiguration.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateUiConfiguration( UiConfiguration uiConfiguration )
|
public void updateUiConfiguration( UiConfiguration uiConfiguration )
|
||||||
|
@ -345,7 +344,7 @@ public class DefaultArchivaAdministration
|
||||||
{
|
{
|
||||||
|
|
||||||
UserInterfaceOptions userInterfaceOptions =
|
UserInterfaceOptions userInterfaceOptions =
|
||||||
new BeanReplicator().replicateBean( uiConfiguration, UserInterfaceOptions.class );
|
getModelMapper().map( uiConfiguration, UserInterfaceOptions.class );
|
||||||
configuration.getWebapp().setUi( userInterfaceOptions );
|
configuration.getWebapp().setUi( userInterfaceOptions );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -366,7 +365,7 @@ public class DefaultArchivaAdministration
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new BeanReplicator().replicateBean( networkConfiguration, NetworkConfiguration.class );
|
return getModelMapper().map( networkConfiguration, NetworkConfiguration.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
|
public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
|
||||||
|
@ -379,7 +378,7 @@ public class DefaultArchivaAdministration
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
configuration.setNetworkConfiguration( new BeanReplicator().replicateBean( networkConfiguration,
|
configuration.setNetworkConfiguration( getModelMapper().map( networkConfiguration,
|
||||||
org.apache.archiva.configuration.NetworkConfiguration.class ) );
|
org.apache.archiva.configuration.NetworkConfiguration.class ) );
|
||||||
}
|
}
|
||||||
setupWagon( networkConfiguration );
|
setupWagon( networkConfiguration );
|
||||||
|
|
|
@ -27,10 +27,7 @@ import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
|
||||||
import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
|
import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
|
||||||
import org.apache.archiva.audit.AuditEvent;
|
import org.apache.archiva.audit.AuditEvent;
|
||||||
import org.apache.archiva.configuration.Configuration;
|
import org.apache.archiva.configuration.Configuration;
|
||||||
import org.apache.archiva.configuration.ConfigurationEvent;
|
|
||||||
import org.apache.archiva.configuration.ConfigurationListener;
|
|
||||||
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
|
import org.apache.archiva.configuration.RepositoryGroupConfiguration;
|
||||||
import org.apache.archiva.redback.components.registry.RegistryListener;
|
|
||||||
import org.apache.archiva.scheduler.MergedRemoteIndexesScheduler;
|
import org.apache.archiva.scheduler.MergedRemoteIndexesScheduler;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.apache.archiva.admin.repository.networkproxy;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import net.sf.beanlib.provider.replicator.BeanReplicator;
|
|
||||||
import org.apache.archiva.admin.model.AuditInformation;
|
import org.apache.archiva.admin.model.AuditInformation;
|
||||||
import org.apache.archiva.admin.model.RepositoryAdminException;
|
import org.apache.archiva.admin.model.RepositoryAdminException;
|
||||||
import org.apache.archiva.admin.model.beans.NetworkProxy;
|
import org.apache.archiva.admin.model.beans.NetworkProxy;
|
||||||
|
@ -143,13 +142,13 @@ public class DefaultNetworkProxyAdmin
|
||||||
{
|
{
|
||||||
return networkProxyConfiguration == null
|
return networkProxyConfiguration == null
|
||||||
? null
|
? null
|
||||||
: new BeanReplicator().replicateBean( networkProxyConfiguration, NetworkProxy.class );
|
: getModelMapper().map( networkProxyConfiguration, NetworkProxy.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected NetworkProxyConfiguration getNetworkProxyConfiguration( NetworkProxy networkProxy )
|
protected NetworkProxyConfiguration getNetworkProxyConfiguration( NetworkProxy networkProxy )
|
||||||
{
|
{
|
||||||
return networkProxy == null
|
return networkProxy == null
|
||||||
? null
|
? null
|
||||||
: new BeanReplicator().replicateBean( networkProxy, NetworkProxyConfiguration.class );
|
: getModelMapper().map( networkProxy, NetworkProxyConfiguration.class );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.apache.archiva.admin.repository.proxyconnector;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import net.sf.beanlib.provider.replicator.BeanReplicator;
|
|
||||||
import org.apache.archiva.admin.model.AuditInformation;
|
import org.apache.archiva.admin.model.AuditInformation;
|
||||||
import org.apache.archiva.admin.model.RepositoryAdminException;
|
import org.apache.archiva.admin.model.RepositoryAdminException;
|
||||||
import org.apache.archiva.admin.model.beans.ProxyConnector;
|
import org.apache.archiva.admin.model.beans.ProxyConnector;
|
||||||
|
@ -211,14 +210,14 @@ public class DefaultProxyConnectorAdmin
|
||||||
{
|
{
|
||||||
return proxyConnector == null
|
return proxyConnector == null
|
||||||
? null
|
? null
|
||||||
: new BeanReplicator().replicateBean( proxyConnector, ProxyConnectorConfiguration.class );
|
: getModelMapper().map( proxyConnector, ProxyConnectorConfiguration.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ProxyConnector getProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
|
protected ProxyConnector getProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
|
||||||
{
|
{
|
||||||
return proxyConnectorConfiguration == null
|
return proxyConnectorConfiguration == null
|
||||||
? null
|
? null
|
||||||
: new BeanReplicator().replicateBean( proxyConnectorConfiguration, ProxyConnector.class );
|
: getModelMapper().map( proxyConnectorConfiguration, ProxyConnector.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void validateProxyConnector( ProxyConnector proxyConnector )
|
protected void validateProxyConnector( ProxyConnector proxyConnector )
|
||||||
|
|
|
@ -18,12 +18,12 @@ package org.apache.archiva.admin.repository.runtime;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import net.sf.beanlib.provider.replicator.BeanReplicator;
|
|
||||||
import org.apache.archiva.admin.model.RepositoryAdminException;
|
import org.apache.archiva.admin.model.RepositoryAdminException;
|
||||||
import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration;
|
import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration;
|
||||||
import org.apache.archiva.admin.model.beans.CacheConfiguration;
|
import org.apache.archiva.admin.model.beans.CacheConfiguration;
|
||||||
import org.apache.archiva.admin.model.beans.FileLockConfiguration;
|
import org.apache.archiva.admin.model.beans.FileLockConfiguration;
|
||||||
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
|
import org.apache.archiva.admin.model.runtime.ArchivaRuntimeConfigurationAdmin;
|
||||||
|
import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
|
||||||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||||
import org.apache.archiva.configuration.Configuration;
|
import org.apache.archiva.configuration.Configuration;
|
||||||
import org.apache.archiva.configuration.IndeterminateConfigurationException;
|
import org.apache.archiva.configuration.IndeterminateConfigurationException;
|
||||||
|
@ -41,6 +41,7 @@ import javax.inject.Named;
|
||||||
*/
|
*/
|
||||||
@Service( "archivaRuntimeConfigurationAdmin#default" )
|
@Service( "archivaRuntimeConfigurationAdmin#default" )
|
||||||
public class DefaultArchivaRuntimeConfigurationAdmin
|
public class DefaultArchivaRuntimeConfigurationAdmin
|
||||||
|
extends AbstractRepositoryAdmin
|
||||||
implements ArchivaRuntimeConfigurationAdmin
|
implements ArchivaRuntimeConfigurationAdmin
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -151,13 +152,13 @@ public class DefaultArchivaRuntimeConfigurationAdmin
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchivaRuntimeConfiguration res =
|
ArchivaRuntimeConfiguration res =
|
||||||
new BeanReplicator().replicateBean( archivaRuntimeConfiguration, ArchivaRuntimeConfiguration.class );
|
getModelMapper().map( archivaRuntimeConfiguration, ArchivaRuntimeConfiguration.class );
|
||||||
|
|
||||||
if ( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration() != null )
|
if ( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration() != null )
|
||||||
{
|
{
|
||||||
|
|
||||||
res.setUrlFailureCacheConfiguration(
|
res.setUrlFailureCacheConfiguration(
|
||||||
new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
|
getModelMapper().map( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
|
||||||
CacheConfiguration.class ) );
|
CacheConfiguration.class ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -165,7 +166,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
|
||||||
if ( archivaRuntimeConfiguration.getFileLockConfiguration() != null )
|
if ( archivaRuntimeConfiguration.getFileLockConfiguration() != null )
|
||||||
{
|
{
|
||||||
res.setFileLockConfiguration(
|
res.setFileLockConfiguration(
|
||||||
new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getFileLockConfiguration(),
|
getModelMapper().map( archivaRuntimeConfiguration.getFileLockConfiguration(),
|
||||||
FileLockConfiguration.class ) );
|
FileLockConfiguration.class ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,14 +182,14 @@ public class DefaultArchivaRuntimeConfigurationAdmin
|
||||||
}
|
}
|
||||||
|
|
||||||
org.apache.archiva.configuration.ArchivaRuntimeConfiguration res =
|
org.apache.archiva.configuration.ArchivaRuntimeConfiguration res =
|
||||||
new BeanReplicator().replicateBean( archivaRuntimeConfiguration,
|
getModelMapper().map( archivaRuntimeConfiguration,
|
||||||
org.apache.archiva.configuration.ArchivaRuntimeConfiguration.class );
|
org.apache.archiva.configuration.ArchivaRuntimeConfiguration.class );
|
||||||
|
|
||||||
if ( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration() != null )
|
if ( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration() != null )
|
||||||
{
|
{
|
||||||
|
|
||||||
res.setUrlFailureCacheConfiguration(
|
res.setUrlFailureCacheConfiguration(
|
||||||
new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
|
getModelMapper().map( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
|
||||||
org.apache.archiva.configuration.CacheConfiguration.class ) );
|
org.apache.archiva.configuration.CacheConfiguration.class ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -196,7 +197,7 @@ public class DefaultArchivaRuntimeConfigurationAdmin
|
||||||
if ( archivaRuntimeConfiguration.getFileLockConfiguration() != null )
|
if ( archivaRuntimeConfiguration.getFileLockConfiguration() != null )
|
||||||
{
|
{
|
||||||
res.setFileLockConfiguration(
|
res.setFileLockConfiguration(
|
||||||
new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getFileLockConfiguration(),
|
getModelMapper().map( archivaRuntimeConfiguration.getFileLockConfiguration(),
|
||||||
org.apache.archiva.configuration.FileLockConfiguration.class ) );
|
org.apache.archiva.configuration.FileLockConfiguration.class ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,13 @@ package org.apache.archiva.admin.repository.runtime;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import net.sf.beanlib.provider.replicator.BeanReplicator;
|
|
||||||
import org.apache.archiva.admin.model.RepositoryAdminException;
|
import org.apache.archiva.admin.model.RepositoryAdminException;
|
||||||
import org.apache.archiva.admin.model.beans.CacheConfiguration;
|
import org.apache.archiva.admin.model.beans.CacheConfiguration;
|
||||||
import org.apache.archiva.admin.model.beans.LdapConfiguration;
|
import org.apache.archiva.admin.model.beans.LdapConfiguration;
|
||||||
import org.apache.archiva.admin.model.beans.LdapGroupMapping;
|
import org.apache.archiva.admin.model.beans.LdapGroupMapping;
|
||||||
import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
|
import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
|
||||||
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
|
import org.apache.archiva.admin.model.runtime.RedbackRuntimeConfigurationAdmin;
|
||||||
|
import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
|
||||||
import org.apache.archiva.configuration.ArchivaConfiguration;
|
import org.apache.archiva.configuration.ArchivaConfiguration;
|
||||||
import org.apache.archiva.configuration.Configuration;
|
import org.apache.archiva.configuration.Configuration;
|
||||||
import org.apache.archiva.configuration.IndeterminateConfigurationException;
|
import org.apache.archiva.configuration.IndeterminateConfigurationException;
|
||||||
|
@ -43,7 +43,6 @@ import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -55,6 +54,7 @@ import java.util.Set;
|
||||||
*/
|
*/
|
||||||
@Service( "redbackRuntimeConfigurationAdmin#default" )
|
@Service( "redbackRuntimeConfigurationAdmin#default" )
|
||||||
public class DefaultRedbackRuntimeConfigurationAdmin
|
public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
|
extends AbstractRepositoryAdmin
|
||||||
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
|
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -298,20 +298,18 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration )
|
org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration )
|
||||||
{
|
{
|
||||||
RedbackRuntimeConfiguration redbackRuntimeConfiguration =
|
RedbackRuntimeConfiguration redbackRuntimeConfiguration =
|
||||||
new BeanReplicator().replicateBean( runtimeConfiguration, RedbackRuntimeConfiguration.class );
|
getModelMapper().map( runtimeConfiguration, RedbackRuntimeConfiguration.class );
|
||||||
|
|
||||||
if ( runtimeConfiguration.getLdapConfiguration() != null )
|
if ( runtimeConfiguration.getLdapConfiguration() != null )
|
||||||
{
|
{
|
||||||
redbackRuntimeConfiguration.setLdapConfiguration(
|
redbackRuntimeConfiguration.setLdapConfiguration(
|
||||||
new BeanReplicator().replicateBean( runtimeConfiguration.getLdapConfiguration(),
|
getModelMapper().map( runtimeConfiguration.getLdapConfiguration(), LdapConfiguration.class ) );
|
||||||
LdapConfiguration.class ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( runtimeConfiguration.getUsersCacheConfiguration() != null )
|
if ( runtimeConfiguration.getUsersCacheConfiguration() != null )
|
||||||
{
|
{
|
||||||
redbackRuntimeConfiguration.setUsersCacheConfiguration(
|
redbackRuntimeConfiguration.setUsersCacheConfiguration(
|
||||||
new BeanReplicator().replicateBean( runtimeConfiguration.getUsersCacheConfiguration(),
|
getModelMapper().map( runtimeConfiguration.getUsersCacheConfiguration(), CacheConfiguration.class ) );
|
||||||
CacheConfiguration.class ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
|
if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
|
||||||
|
@ -378,7 +376,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
RedbackRuntimeConfiguration redbackRuntimeConfiguration )
|
RedbackRuntimeConfiguration redbackRuntimeConfiguration )
|
||||||
{
|
{
|
||||||
org.apache.archiva.configuration.RedbackRuntimeConfiguration res =
|
org.apache.archiva.configuration.RedbackRuntimeConfiguration res =
|
||||||
new BeanReplicator().replicateBean( redbackRuntimeConfiguration,
|
getModelMapper().map( redbackRuntimeConfiguration,
|
||||||
org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );
|
org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );
|
||||||
|
|
||||||
if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
|
if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
|
||||||
|
@ -386,7 +384,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
redbackRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
|
redbackRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
|
||||||
}
|
}
|
||||||
res.setLdapConfiguration(
|
res.setLdapConfiguration(
|
||||||
new BeanReplicator().replicateBean( redbackRuntimeConfiguration.getLdapConfiguration(),
|
getModelMapper().map( redbackRuntimeConfiguration.getLdapConfiguration(),
|
||||||
org.apache.archiva.configuration.LdapConfiguration.class ) );
|
org.apache.archiva.configuration.LdapConfiguration.class ) );
|
||||||
|
|
||||||
if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
|
if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
|
||||||
|
@ -396,7 +394,7 @@ public class DefaultRedbackRuntimeConfigurationAdmin
|
||||||
|
|
||||||
|
|
||||||
res.setUsersCacheConfiguration(
|
res.setUsersCacheConfiguration(
|
||||||
new BeanReplicator().replicateBean( redbackRuntimeConfiguration.getUsersCacheConfiguration(),
|
getModelMapper().map( redbackRuntimeConfiguration.getUsersCacheConfiguration(),
|
||||||
org.apache.archiva.configuration.CacheConfiguration.class ) );
|
org.apache.archiva.configuration.CacheConfiguration.class ) );
|
||||||
|
|
||||||
List<LdapGroupMapping> ldapGroupMappings = redbackRuntimeConfiguration.getLdapGroupMappings();
|
List<LdapGroupMapping> ldapGroupMappings = redbackRuntimeConfiguration.getLdapGroupMappings();
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -574,6 +574,12 @@
|
||||||
<version>1.0-2</version>
|
<version>1.0-2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.modelmapper</groupId>
|
||||||
|
<artifactId>modelmapper</artifactId>
|
||||||
|
<version>0.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.beanlib</groupId>
|
<groupId>net.sf.beanlib</groupId>
|
||||||
<artifactId>beanlib</artifactId>
|
<artifactId>beanlib</artifactId>
|
||||||
|
|
Loading…
Reference in New Issue