Package org.apache.maven.archiva.configuration

Examples of org.apache.maven.archiva.configuration.ProxyConnectorConfiguration


                int count = 0;
                for ( Iterator iter = value.getProxyConnectors().iterator(); iter.hasNext(); count++ )
                {
                    String name = "proxyConnectors.proxyConnector(" + count + ")";
                    ProxyConnectorConfiguration o = ( ProxyConnectorConfiguration ) iter.next();
                    writeProxyConnectorConfiguration( prefix + name + ".", o, registry );
                }
            }
            if ( value.getNetworkProxies() != null && value.getNetworkProxies().size() > 0
)
View Full Code Here


        value.setRemoteRepositories( remoteRepositories );
        java.util.List proxyConnectors = new java.util.ArrayList/*<ProxyConnectorConfiguration>*/();
        List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" );
        for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); )
        {
            ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() );
            proxyConnectors.add( v );
        }
        value.setProxyConnectors( proxyConnectors );
        java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
        List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
View Full Code Here

        return value;
    }
   
    private ProxyConnectorConfiguration readProxyConnectorConfiguration( String prefix, Registry registry )
    {
        ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();

        int order = registry.getInt( prefix + "order", value.getOrder() );
        value.setOrder( order );
        String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
        value.setSourceRepoId( sourceRepoId );
        String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
        value.setTargetRepoId( targetRepoId );
        String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
        value.setProxyId( proxyId );
        java.util.List blackListPatterns = new java.util.ArrayList/*<String>*/();
        blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
        value.setBlackListPatterns( blackListPatterns );
        java.util.List whiteListPatterns = new java.util.ArrayList/*<String>*/();
        whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
        value.setWhiteListPatterns( whiteListPatterns );
        java.util.Map policies = registry.getProperties( prefix + "policies" );
        value.setPolicies( policies );
        java.util.Map properties = registry.getProperties( prefix + "properties" );
        value.setProperties( properties );
        boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
        value.setDisabled( disabled );

        return value;
    }
View Full Code Here

        value.setRemoteRepositories( remoteRepositories );
        java.util.List proxyConnectors = new java.util.ArrayList();
        List proxyConnectorsSubsets = registry.getSubsetList( prefix + "proxyConnectors.proxyConnector" );
        for ( Iterator i = proxyConnectorsSubsets.iterator(); i.hasNext(); )
        {
            ProxyConnectorConfiguration v = readProxyConnectorConfiguration( "", (Registry) i.next() );
            proxyConnectors.add( v );
        }
        value.setProxyConnectors( proxyConnectors );
        java.util.List networkProxies = new java.util.ArrayList();
        List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
View Full Code Here

        return value;
    }
   
    private ProxyConnectorConfiguration readProxyConnectorConfiguration( String prefix, Registry registry )
    {
        ProxyConnectorConfiguration value = new ProxyConnectorConfiguration();

        int order = registry.getInt( prefix + "order", value.getOrder() );
        value.setOrder( order );
        String sourceRepoId = registry.getString( prefix + "sourceRepoId", value.getSourceRepoId() );
        value.setSourceRepoId( sourceRepoId );
        String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );
        value.setTargetRepoId( targetRepoId );
        String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );
        value.setProxyId( proxyId );
        java.util.List blackListPatterns = new java.util.ArrayList();
        blackListPatterns.addAll( registry.getList( prefix + "blackListPatterns.blackListPattern" ) );
        value.setBlackListPatterns( blackListPatterns );
        java.util.List whiteListPatterns = new java.util.ArrayList();
        whiteListPatterns.addAll( registry.getList( prefix + "whiteListPatterns.whiteListPattern" ) );
        value.setWhiteListPatterns( whiteListPatterns );
        java.util.Map policies = registry.getProperties( prefix + "policies" );
        value.setPolicies( policies );
        java.util.Map properties = registry.getProperties( prefix + "properties" );
        value.setProperties( properties );
        boolean disabled = registry.getBoolean( prefix + "disabled", value.isDisabled() );
        value.setDisabled( disabled );

        return value;
    }
View Full Code Here

        return central;
    }

    private void setupConnector( String repoId, RemoteRepoInfo remoteRepo, String releasesPolicy, String snapshotsPolicy )
    {
        ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration();
        connector.setSourceRepoId( repoId );
        connector.setTargetRepoId( remoteRepo.id );
        connector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, releasesPolicy );
        connector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, snapshotsPolicy );
        connector.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORED );
        connector.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.IGNORED );

        archivaConfiguration.getConfiguration().addProxyConnector( connector );
    }
View Full Code Here

        // Prepare Test.
        action.setSource( TEST_SOURCE_ID );
        action.setTarget( TEST_TARGET_ID );
        action.prepare();
        ProxyConnectorConfiguration connector = action.getConnector();
        assertInitialProxyConnector( connector );

        // Perform Test w/no values.
        preRequest( action );
        String status = action.addBlackListPattern();
        assertEquals( Action.INPUT, status );

        // Should have returned an error, with no blacklist pattern added.
        assertHasErrors( action );
        assertEquals( 0, connector.getBlackListPatterns().size() );

        // Try again, but now with a pattern to add.
        action.setBlackListPattern( "**/*-javadoc.jar" );
        preRequest( action );
        status = action.addBlackListPattern();
        assertEquals( Action.INPUT, status );

        // Should have no error, and 1 blacklist pattern added.
        assertNoErrors( action );
        assertEquals( 1, connector.getBlackListPatterns().size() );
    }
View Full Code Here

        // Prepare Test.
        action.setSource( TEST_SOURCE_ID );
        action.setTarget( TEST_TARGET_ID );
        action.prepare();
        ProxyConnectorConfiguration connector = action.getConnector();
        assertInitialProxyConnector( connector );

        // Perform Test w/no values.
        preRequest( action );
        String status = action.addProperty();
        assertEquals( Action.INPUT, status );

        // Should have returned an error, with no property pattern added.
        assertHasErrors( action );
        assertEquals( 0, connector.getProperties().size() );

        // Try again, but now with a property key/value to add.
        action.setPropertyKey( "eat-a" );
        action.setPropertyValue( "gramov-a-bits" );
        preRequest( action );
        status = action.addProperty();
        assertEquals( Action.INPUT, status );

        // Should have no error, and 1 property added.
        assertNoErrors( action );
        assertEquals( 1, connector.getProperties().size() );
    }
View Full Code Here

        // Prepare Test.
        action.setSource( TEST_SOURCE_ID );
        action.setTarget( TEST_TARGET_ID );
        action.prepare();
        ProxyConnectorConfiguration connector = action.getConnector();
        assertInitialProxyConnector( connector );

        // Perform Test w/no values.
        preRequest( action );
        String status = action.addWhiteListPattern();
        assertEquals( Action.INPUT, status );

        // Should have returned an error, with no whitelist pattern added.
        assertHasErrors( action );
        assertEquals( 0, connector.getWhiteListPatterns().size() );

        // Try again, but now with a pattern to add.
        action.setWhiteListPattern( "**/*.jar" );
        preRequest( action );
        status = action.addWhiteListPattern();
        assertEquals( Action.INPUT, status );

        // Should have no error, and 1 whitelist pattern added.
        assertNoErrors( action );
        assertEquals( 1, connector.getWhiteListPatterns().size() );
    }
View Full Code Here

        // Prepare Test.
        action.setSource( TEST_SOURCE_ID );
        action.setTarget( TEST_TARGET_ID );
        action.prepare();
        ProxyConnectorConfiguration connector = action.getConnector();
        assertInitialProxyConnector( connector );

        // Create the input screen.
        assertRequestStatus( action, Action.SUCCESS, "commit" );
        assertNoErrors( action );

        // Test configuration.
        List<ProxyConnectorConfiguration> proxyConfigs = archivaConfiguration.getConfiguration().getProxyConnectors();
        assertNotNull( proxyConfigs );
        assertEquals( 1, proxyConfigs.size() );

        ProxyConnectorConfiguration actualConnector = proxyConfigs.get( 0 );

        assertNotNull( actualConnector );
        // The use of "(direct connection)" should result in a proxyId which is <null>.
        assertNull( actualConnector.getProxyId() );
        assertEquals( "corporate", actualConnector.getSourceRepoId() );
        assertEquals( "central", actualConnector.getTargetRepoId() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.configuration.ProxyConnectorConfiguration

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.