Package org.apache.archiva.configuration

Examples of org.apache.archiva.configuration.RemoteRepositoryConfiguration


    }

    private RemoteRepositoryConfiguration getRemoteRepositoryConfiguration( RemoteRepository remoteRepository )
    {
        RemoteRepositoryConfiguration remoteRepositoryConfiguration = new RemoteRepositoryConfiguration();
        remoteRepositoryConfiguration.setId( remoteRepository.getId() );
        remoteRepositoryConfiguration.setPassword( remoteRepository.getPassword() );
        remoteRepositoryConfiguration.setTimeout( remoteRepository.getTimeout() );
        remoteRepositoryConfiguration.setUrl( remoteRepository.getUrl() );
        remoteRepositoryConfiguration.setUsername( remoteRepository.getUserName() );
        remoteRepositoryConfiguration.setLayout( remoteRepository.getLayout() );
        remoteRepositoryConfiguration.setName( remoteRepository.getName() );
        remoteRepositoryConfiguration.setDownloadRemoteIndex( remoteRepository.isDownloadRemoteIndex() );
        remoteRepositoryConfiguration.setRemoteIndexUrl( remoteRepository.getRemoteIndexUrl() );
        remoteRepositoryConfiguration.setRefreshCronExpression( remoteRepository.getCronExpression() );
        remoteRepositoryConfiguration.setIndexDir( remoteRepository.getIndexDirectory() );
        remoteRepositoryConfiguration.setRemoteDownloadNetworkProxyId(
            remoteRepository.getRemoteDownloadNetworkProxyId() );
        remoteRepositoryConfiguration.setRemoteDownloadTimeout( remoteRepository.getRemoteDownloadTimeout() );
        remoteRepositoryConfiguration.setDownloadRemoteIndexOnStartup(
            remoteRepository.isDownloadRemoteIndexOnStartup() );
        remoteRepositoryConfiguration.setDescription( remoteRepository.getDescription() );
        remoteRepositoryConfiguration.setExtraHeaders( remoteRepository.getExtraHeaders() );
        remoteRepositoryConfiguration.setExtraParameters( remoteRepository.getExtraParameters() );
        return remoteRepositoryConfiguration;
    }
View Full Code Here


    {
        remoteCentral = createServer( "central" );

        assertServerSetupCorrectly( remoteCentral );

        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
            archivaConfiguration.getConfiguration().getRemoteRepositoriesAsMap().get( remoteCentral.id );
        if ( remoteRepositoryConfiguration != null )
        {
            archivaConfiguration.getConfiguration().removeRemoteRepository( remoteRepositoryConfiguration );
        }
View Full Code Here

        throws Exception
    {
        remoteSnapshots = createServer( "snapshots" );

        assertServerSetupCorrectly( remoteSnapshots );
        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
            archivaConfiguration.getConfiguration().getRemoteRepositoriesAsMap().get( remoteSnapshots.id );
        if ( remoteRepositoryConfiguration != null )
        {
            archivaConfiguration.getConfiguration().removeRemoteRepository( remoteRepositoryConfiguration );
        }
View Full Code Here

        testRepoS.setLocation( new File( "target/test-repositorys" ).getAbsolutePath() );
        testRepoS.setReleases( false );
        testRepoS.setSnapshots( true );
        c.addManagedRepository( testRepoS );

        RemoteRepositoryConfiguration testRemoteRepo = new RemoteRepositoryConfiguration();
        testRemoteRepo.setId( TEST_REMOTE_REPO_ID );
        testRemoteRepo.setLayout( "default" );
        testRemoteRepo.setName( "Central Repository" );
        testRemoteRepo.setUrl( "http://central.repo.com/maven2" );
        testRemoteRepo.setTimeout( 10 );
        c.addRemoteRepository( testRemoteRepo );

        ProxyConnectorConfiguration proxyConnector = new ProxyConnectorConfiguration();
        proxyConnector.setSourceRepoId( TEST_REPO_ID );
        proxyConnector.setTargetRepoId( TEST_REMOTE_REPO_ID );
View Full Code Here

    public void testGetProjectVersionMetadataWithParentNoRemoteReposConfigured()
        throws Exception
    {
        // remove configuration
        Configuration config = configuration.getConfiguration();
        RemoteRepositoryConfiguration remoteRepo = config.findRemoteRepositoryById( TEST_REMOTE_REPO_ID );
        config.removeRemoteRepository( remoteRepo );

        configuration.save( config );

        copyTestArtifactWithParent( "target/test-classes/com/example/test/test-artifact-module-a",
View Full Code Here

        proxyConfig.setProtocol( "http" );
        proxyConfig.setId( PROXY_ID );
        config.getConfiguration().addNetworkProxy( proxyConfig );

        // Setup target (proxied to) repository.
        RemoteRepositoryConfiguration repoConfig = new RemoteRepositoryConfiguration();

        repoConfig.setId( PROXIED_ID );
        repoConfig.setName( "Proxied Repository 1" );
        repoConfig.setLayout( "default" );
        repoConfig.setUrl( "http://www.example.com/" );

        config.getConfiguration().addRemoteRepository( repoConfig );

    }
View Full Code Here

        config.triggerChange( prefix + ".layout", repoConfig.getLayout() );
    }

    protected void saveRemoteRepositoryConfig( String id, String name, String url, String layout )
    {
        RemoteRepositoryConfiguration repoConfig = new RemoteRepositoryConfiguration();

        repoConfig.setId( id );
        repoConfig.setName( name );
        repoConfig.setLayout( layout );
        repoConfig.setUrl( url );

        int count = config.getConfiguration().getRemoteRepositories().size();
        config.getConfiguration().addRemoteRepository( repoConfig );

        String prefix = "remoteRepositories.remoteRepository(" + count + ")";
        config.triggerChange( prefix + ".id", repoConfig.getId() );
        config.triggerChange( prefix + ".name", repoConfig.getName() );
        config.triggerChange( prefix + ".url", repoConfig.getUrl() );
        config.triggerChange( prefix + ".layout", repoConfig.getLayout() );
    }
View Full Code Here

                int count = 0;
                for ( Iterator iter = value.getRemoteRepositories().iterator(); iter.hasNext(); count++ )
                {
                    String name = "remoteRepositories.remoteRepository(" + count + ")";
                    RemoteRepositoryConfiguration o = ( RemoteRepositoryConfiguration ) iter.next();
                    writeRemoteRepositoryConfiguration( prefix + name + ".", o, registry );
                }
            }
            if ( value.getProxyConnectors() != null && value.getProxyConnectors().size() > 0
)
View Full Code Here

        value.setManagedRepositories( managedRepositories );
        java.util.List remoteRepositories = new java.util.ArrayList/*<RemoteRepositoryConfiguration>*/();
        List remoteRepositoriesSubsets = registry.getSubsetList( prefix + "remoteRepositories.remoteRepository" );
        for ( Iterator i = remoteRepositoriesSubsets.iterator(); i.hasNext(); )
        {
            RemoteRepositoryConfiguration v = readRemoteRepositoryConfiguration( "", (Registry) i.next() );
            remoteRepositories.add( v );
        }
        value.setRemoteRepositories( remoteRepositories );
        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
        List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" );
View Full Code Here

        return value;
    }
   
    private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration( String prefix, Registry registry )
    {
        RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();

        String url = registry.getString( prefix + "url", value.getUrl() );
        value.setUrl( url );
        String username = registry.getString( prefix + "username", value.getUsername() );
        value.setUsername( username );
        String password = registry.getString( prefix + "password", value.getPassword() );
        value.setPassword( password );
        int timeout = registry.getInt( prefix + "timeout", value.getTimeout() );
        value.setTimeout( timeout );
        String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
        value.setRefreshCronExpression( refreshCronExpression );
        boolean downloadRemoteIndex = registry.getBoolean( prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex() );
        value.setDownloadRemoteIndex( downloadRemoteIndex );
        String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
        value.setRemoteIndexUrl( remoteIndexUrl );
        String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
        value.setRemoteDownloadNetworkProxyId( remoteDownloadNetworkProxyId );
        int remoteDownloadTimeout = registry.getInt( prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout() );
        value.setRemoteDownloadTimeout( remoteDownloadTimeout );
        String id = registry.getString( prefix + "id", value.getId() );
        value.setId( id );
        String name = registry.getString( prefix + "name", value.getName() );
        value.setName( name );
        String layout = registry.getString( prefix + "layout", value.getLayout() );
        value.setLayout( layout );
        String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
        value.setIndexDir( indexDir );

        return value;
    }
View Full Code Here

TOP

Related Classes of org.apache.archiva.configuration.RemoteRepositoryConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.