<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</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>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<artifactId>spring-taskqueue</artifactId>
</dependency>
<dependency>
- <groupId>net.sf.beanlib</groupId>
- <artifactId>beanlib</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>
+ <groupId>org.modelmapper</groupId>
+ <artifactId>modelmapper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<Import-Package>
javax.annotation,
javax.inject,
- net.sf.beanlib.provider.replicator,
+ org.modelmapper,
org.apache.archiva.admin.model*;version=${project.version},
org.apache.archiva.audit;version=${project.version},
org.apache.archiva.common.plexusbridge;version=${project.version},
import org.apache.archiva.configuration.IndeterminateConfigurationException;
import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.components.registry.Registry;
+import org.modelmapper.ModelMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
}
+ private static class ModelMapperHolder
+ {
+ private static ModelMapper MODEL_MAPPER = new ModelMapper();
+ }
+
+ protected ModelMapper getModelMapper()
+ {
+ return ModelMapperHolder.MODEL_MAPPER;
+ }
+
public List<AuditListener> getAuditListeners()
{
return auditListeners;
* under the License.
*/
-import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.AuditInformation;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.admin.ArchivaAdministration;
for ( org.apache.archiva.configuration.LegacyArtifactPath legacyArtifactPath : getArchivaConfiguration().getConfiguration().getLegacyArtifactPaths() )
{
legacyArtifactPaths.add(
- new BeanReplicator().replicateBean( legacyArtifactPath, LegacyArtifactPath.class ) );
+ getModelMapper().map( legacyArtifactPath, LegacyArtifactPath.class ) );
}
return legacyArtifactPaths;
}
{
Configuration configuration = getArchivaConfiguration().getConfiguration();
- configuration.addLegacyArtifactPath( new BeanReplicator().replicateBean( legacyArtifactPath,
- org.apache.archiva.configuration.LegacyArtifactPath.class ) );
+ configuration.addLegacyArtifactPath( getModelMapper().map( legacyArtifactPath,
+ org.apache.archiva.configuration.LegacyArtifactPath.class ) );
saveConfiguration( configuration );
triggerAuditEvent( "", "", AuditEvent.ADD_LEGACY_PATH, auditInformation );
{
return null;
}
- return new BeanReplicator().replicateBean( fileType, FileType.class );
+ return getModelMapper().map( fileType, FileType.class );
}
public void addFileType( FileType fileType, AuditInformation auditInformation )
}
configuration.getRepositoryScanning().addFileType(
- new BeanReplicator().replicateBean( fileType, org.apache.archiva.configuration.FileType.class ) );
+ getModelMapper().map( fileType, org.apache.archiva.configuration.FileType.class ) );
saveConfiguration( configuration );
}
List<FileType> fileTypes = new ArrayList<FileType>( configFileTypes.size() );
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 null;
}
- return new BeanReplicator().replicateBean( organisationInformation, OrganisationInformation.class );
+ return getModelMapper().map( organisationInformation, OrganisationInformation.class );
}
public void setOrganisationInformation( OrganisationInformation organisationInformation )
if ( organisationInformation != null )
{
org.apache.archiva.configuration.OrganisationInformation organisationInformationModel =
- new BeanReplicator().replicateBean( organisationInformation,
- org.apache.archiva.configuration.OrganisationInformation.class );
+ getModelMapper().map( organisationInformation,
+ org.apache.archiva.configuration.OrganisationInformation.class );
configuration.setOrganisationInfo( organisationInformationModel );
}
else
{
return null;
}
- return new BeanReplicator().replicateBean( userInterfaceOptions, UiConfiguration.class );
+ return getModelMapper().map( userInterfaceOptions, UiConfiguration.class );
}
public void updateUiConfiguration( UiConfiguration uiConfiguration )
{
UserInterfaceOptions userInterfaceOptions =
- new BeanReplicator().replicateBean( uiConfiguration, UserInterfaceOptions.class );
+ getModelMapper().map( uiConfiguration, UserInterfaceOptions.class );
configuration.getWebapp().setUi( userInterfaceOptions );
}
else
{
return null;
}
- return new BeanReplicator().replicateBean( networkConfiguration, NetworkConfiguration.class );
+ return getModelMapper().map( networkConfiguration, NetworkConfiguration.class );
}
public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
}
else
{
- configuration.setNetworkConfiguration( new BeanReplicator().replicateBean( networkConfiguration,
- org.apache.archiva.configuration.NetworkConfiguration.class ) );
+ configuration.setNetworkConfiguration( getModelMapper().map( networkConfiguration,
+ org.apache.archiva.configuration.NetworkConfiguration.class ) );
}
setupWagon( networkConfiguration );
saveConfiguration( configuration );
import org.apache.archiva.admin.repository.AbstractRepositoryAdmin;
import org.apache.archiva.audit.AuditEvent;
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.redback.components.registry.RegistryListener;
import org.apache.archiva.scheduler.MergedRemoteIndexesScheduler;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
* under the License.
*/
-import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.AuditInformation;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.NetworkProxy;
{
return networkProxyConfiguration == null
? null
- : new BeanReplicator().replicateBean( networkProxyConfiguration, NetworkProxy.class );
+ : getModelMapper().map( networkProxyConfiguration, NetworkProxy.class );
}
protected NetworkProxyConfiguration getNetworkProxyConfiguration( NetworkProxy networkProxy )
{
return networkProxy == null
? null
- : new BeanReplicator().replicateBean( networkProxy, NetworkProxyConfiguration.class );
+ : getModelMapper().map( networkProxy, NetworkProxyConfiguration.class );
}
}
* under the License.
*/
-import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.AuditInformation;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.ProxyConnector;
{
return proxyConnector == null
? null
- : new BeanReplicator().replicateBean( proxyConnector, ProxyConnectorConfiguration.class );
+ : getModelMapper().map( proxyConnector, ProxyConnectorConfiguration.class );
}
protected ProxyConnector getProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
{
return proxyConnectorConfiguration == null
? null
- : new BeanReplicator().replicateBean( proxyConnectorConfiguration, ProxyConnector.class );
+ : getModelMapper().map( proxyConnectorConfiguration, ProxyConnector.class );
}
protected void validateProxyConnector( ProxyConnector proxyConnector )
* under the License.
*/
-import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.ArchivaRuntimeConfiguration;
import org.apache.archiva.admin.model.beans.CacheConfiguration;
import org.apache.archiva.admin.model.beans.FileLockConfiguration;
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.Configuration;
import org.apache.archiva.configuration.IndeterminateConfigurationException;
*/
@Service( "archivaRuntimeConfigurationAdmin#default" )
public class DefaultArchivaRuntimeConfigurationAdmin
+ extends AbstractRepositoryAdmin
implements ArchivaRuntimeConfigurationAdmin
{
}
ArchivaRuntimeConfiguration res =
- new BeanReplicator().replicateBean( archivaRuntimeConfiguration, ArchivaRuntimeConfiguration.class );
+ getModelMapper().map( archivaRuntimeConfiguration, ArchivaRuntimeConfiguration.class );
if ( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration() != null )
{
res.setUrlFailureCacheConfiguration(
- new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
- CacheConfiguration.class ) );
+ getModelMapper().map( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
+ CacheConfiguration.class ) );
}
if ( archivaRuntimeConfiguration.getFileLockConfiguration() != null )
{
res.setFileLockConfiguration(
- new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getFileLockConfiguration(),
- FileLockConfiguration.class ) );
+ getModelMapper().map( archivaRuntimeConfiguration.getFileLockConfiguration(),
+ FileLockConfiguration.class ) );
}
return res;
}
org.apache.archiva.configuration.ArchivaRuntimeConfiguration res =
- new BeanReplicator().replicateBean( archivaRuntimeConfiguration,
- org.apache.archiva.configuration.ArchivaRuntimeConfiguration.class );
+ getModelMapper().map( archivaRuntimeConfiguration,
+ org.apache.archiva.configuration.ArchivaRuntimeConfiguration.class );
if ( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration() != null )
{
res.setUrlFailureCacheConfiguration(
- new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
- org.apache.archiva.configuration.CacheConfiguration.class ) );
+ getModelMapper().map( archivaRuntimeConfiguration.getUrlFailureCacheConfiguration(),
+ org.apache.archiva.configuration.CacheConfiguration.class ) );
}
if ( archivaRuntimeConfiguration.getFileLockConfiguration() != null )
{
res.setFileLockConfiguration(
- new BeanReplicator().replicateBean( archivaRuntimeConfiguration.getFileLockConfiguration(),
- org.apache.archiva.configuration.FileLockConfiguration.class ) );
+ getModelMapper().map( archivaRuntimeConfiguration.getFileLockConfiguration(),
+ org.apache.archiva.configuration.FileLockConfiguration.class ) );
}
return res;
* under the License.
*/
-import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.RepositoryAdminException;
import org.apache.archiva.admin.model.beans.CacheConfiguration;
import org.apache.archiva.admin.model.beans.LdapConfiguration;
import org.apache.archiva.admin.model.beans.LdapGroupMapping;
import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
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.Configuration;
import org.apache.archiva.configuration.IndeterminateConfigurationException;
import javax.inject.Named;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
*/
@Service( "redbackRuntimeConfigurationAdmin#default" )
public class DefaultRedbackRuntimeConfigurationAdmin
+ extends AbstractRepositoryAdmin
implements RedbackRuntimeConfigurationAdmin, UserConfiguration
{
org.apache.archiva.configuration.RedbackRuntimeConfiguration runtimeConfiguration )
{
RedbackRuntimeConfiguration redbackRuntimeConfiguration =
- new BeanReplicator().replicateBean( runtimeConfiguration, RedbackRuntimeConfiguration.class );
+ getModelMapper().map( runtimeConfiguration, RedbackRuntimeConfiguration.class );
if ( runtimeConfiguration.getLdapConfiguration() != null )
{
redbackRuntimeConfiguration.setLdapConfiguration(
- new BeanReplicator().replicateBean( runtimeConfiguration.getLdapConfiguration(),
- LdapConfiguration.class ) );
+ getModelMapper().map( runtimeConfiguration.getLdapConfiguration(), LdapConfiguration.class ) );
}
if ( runtimeConfiguration.getUsersCacheConfiguration() != null )
{
redbackRuntimeConfiguration.setUsersCacheConfiguration(
- new BeanReplicator().replicateBean( runtimeConfiguration.getUsersCacheConfiguration(),
- CacheConfiguration.class ) );
+ getModelMapper().map( runtimeConfiguration.getUsersCacheConfiguration(), CacheConfiguration.class ) );
}
if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
RedbackRuntimeConfiguration redbackRuntimeConfiguration )
{
org.apache.archiva.configuration.RedbackRuntimeConfiguration res =
- new BeanReplicator().replicateBean( redbackRuntimeConfiguration,
- org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );
+ getModelMapper().map( redbackRuntimeConfiguration,
+ org.apache.archiva.configuration.RedbackRuntimeConfiguration.class );
if ( redbackRuntimeConfiguration.getLdapConfiguration() == null )
{
redbackRuntimeConfiguration.setLdapConfiguration( new LdapConfiguration() );
}
res.setLdapConfiguration(
- new BeanReplicator().replicateBean( redbackRuntimeConfiguration.getLdapConfiguration(),
- org.apache.archiva.configuration.LdapConfiguration.class ) );
+ getModelMapper().map( redbackRuntimeConfiguration.getLdapConfiguration(),
+ org.apache.archiva.configuration.LdapConfiguration.class ) );
if ( redbackRuntimeConfiguration.getUsersCacheConfiguration() == null )
{
res.setUsersCacheConfiguration(
- new BeanReplicator().replicateBean( redbackRuntimeConfiguration.getUsersCacheConfiguration(),
- org.apache.archiva.configuration.CacheConfiguration.class ) );
+ getModelMapper().map( redbackRuntimeConfiguration.getUsersCacheConfiguration(),
+ org.apache.archiva.configuration.CacheConfiguration.class ) );
List<LdapGroupMapping> ldapGroupMappings = redbackRuntimeConfiguration.getLdapGroupMappings();
<version>1.0-2</version>
</dependency>
+ <dependency>
+ <groupId>org.modelmapper</groupId>
+ <artifactId>modelmapper</artifactId>
+ <version>0.6.2</version>
+ </dependency>
+
<dependency>
<groupId>net.sf.beanlib</groupId>
<artifactId>beanlib</artifactId>