Package org.apache.archiva.admin.model.beans

Examples of org.apache.archiva.admin.model.beans.ProxyConnectorRule


        }
        List<ProxyConnectorRule> proxyConnectorRules = new ArrayList<>( proxyConnectorRuleConfigurations.size() );
        for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : proxyConnectorRuleConfigurations )
        {

            ProxyConnectorRule proxyConnectorRule = new ProxyConnectorRule();
            proxyConnectorRule.setPattern( proxyConnectorRuleConfiguration.getPattern() );
            proxyConnectorRule.setProxyConnectorRuleType(
                getProxyConnectorRuleType( proxyConnectorRuleConfiguration.getRuleType() ) );
            for ( ProxyConnectorConfiguration proxyConnectorConfiguration : proxyConnectorRuleConfiguration.getProxyConnectors() )
            {
                ProxyConnector proxyConnector = new ProxyConnector();
                proxyConnector.setSourceRepoId( proxyConnectorConfiguration.getSourceRepoId() );
                proxyConnector.setTargetRepoId( proxyConnectorConfiguration.getTargetRepoId() );
                proxyConnectorRule.getProxyConnectors().add( proxyConnector );
            }
            proxyConnectorRules.add( proxyConnectorRule );
        }

        return proxyConnectorRules;
View Full Code Here


        List<ProxyConnectorRule> proxyConnectorRules =
            new ArrayList<ProxyConnectorRule>( proxyConnectorRuleConfigurations.size() );
        for ( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration : proxyConnectorRuleConfigurations )
        {

            ProxyConnectorRule proxyConnectorRule = new ProxyConnectorRule();
            proxyConnectorRule.setPattern( proxyConnectorRuleConfiguration.getPattern() );
            proxyConnectorRule.setProxyConnectorRuleType(
                getProxyConnectorRuleType( proxyConnectorRuleConfiguration.getRuleType() ) );
            for ( ProxyConnectorConfiguration proxyConnectorConfiguration : proxyConnectorRuleConfiguration.getProxyConnectors() )
            {
                ProxyConnector proxyConnector = new ProxyConnector();
                proxyConnector.setSourceRepoId( proxyConnectorConfiguration.getSourceRepoId() );
                proxyConnector.setTargetRepoId( proxyConnectorConfiguration.getTargetRepoId() );
                proxyConnectorRule.getProxyConnectors().add( proxyConnector );
            }
            proxyConnectorRules.add( proxyConnectorRule );
        }

        return proxyConnectorRules;
View Full Code Here

    {
        ProxyConnector proxyConnector = new ProxyConnector();
        proxyConnector.setSourceRepoId( "snapshots" );
        proxyConnector.setTargetRepoId( "central" );

        ProxyConnectorRule rule = null;
        try
        {
            int size = proxyConnectorRuleAdmin.getProxyConnectorRules().size();
            assertEquals( 0, size );

            proxyConnectorAdmin.addProxyConnector( proxyConnector, getFakeAuditInformation() );

            rule = new ProxyConnectorRule( "org/apache/maven", ProxyConnectorRuleType.BLACK_LIST,
                                           Arrays.asList( proxyConnector ) );

            proxyConnectorRuleAdmin.addProxyConnectorRule( rule, getFakeAuditInformation() );
            assertEquals( size + 1, proxyConnectorRuleAdmin.getProxyConnectorRules().size() );

            rule = proxyConnectorRuleAdmin.getProxyConnectorRules().get( 0 );

            assertEquals( "org/apache/maven", rule.getPattern() );
            assertEquals( 1, rule.getProxyConnectors().size() );
            assertEquals( "snapshots", rule.getProxyConnectors().get( 0 ).getSourceRepoId() );
            assertEquals( "central", rule.getProxyConnectors().get( 0 ).getTargetRepoId() );
            assertEquals( ProxyConnectorRuleType.BLACK_LIST, rule.getProxyConnectorRuleType() );
        }
        finally
        {
            proxyConnectorRuleAdmin.deleteProxyConnectorRule( rule, getFakeAuditInformation() );
            proxyConnectorAdmin.deleteProxyConnector( proxyConnector, getFakeAuditInformation() );
View Full Code Here

        ProxyConnector proxyConnector2 = new ProxyConnector();
        proxyConnector2.setSourceRepoId( "snapshots" );
        proxyConnector2.setTargetRepoId( "archiva" );
        proxyConnectorAdmin.addProxyConnector( proxyConnector2, getFakeAuditInformation() );

        ProxyConnectorRule rule = new ProxyConnectorRule( "org/apache/maven", ProxyConnectorRuleType.BLACK_LIST,
                                                          Arrays.asList( proxyConnector1, proxyConnector2 ) );
        try
        {
            proxyConnectorRuleAdmin.addProxyConnectorRule( rule, getFakeAuditInformation() );
            assertEquals( size + 1, proxyConnectorRuleAdmin.getProxyConnectorRules().size() );

            rule = proxyConnectorRuleAdmin.getProxyConnectorRules().get( 0 );

            assertEquals( "org/apache/maven", rule.getPattern() );
            assertEquals( 2, rule.getProxyConnectors().size() );
            assertEquals( ProxyConnectorRuleType.BLACK_LIST, rule.getProxyConnectorRuleType() );
        }
        finally
        {
            proxyConnectorRuleAdmin.deleteProxyConnectorRule( rule, getFakeAuditInformation() );
            proxyConnectorAdmin.deleteProxyConnector( proxyConnector1, getFakeAuditInformation() );
View Full Code Here

        ProxyConnector proxyConnector2 = new ProxyConnector();
        proxyConnector2.setSourceRepoId( "snapshots" );
        proxyConnector2.setTargetRepoId( "archiva" );
        proxyConnectorAdmin.addProxyConnector( proxyConnector2, getFakeAuditInformation() );

        ProxyConnectorRule rule = new ProxyConnectorRule( "org/apache/maven", ProxyConnectorRuleType.BLACK_LIST,
                                                          Arrays.asList( proxyConnector1, proxyConnector2 ) );
        try
        {
            proxyConnectorRuleAdmin.addProxyConnectorRule( rule, getFakeAuditInformation() );
            assertEquals( size + 1, proxyConnectorRuleAdmin.getProxyConnectorRules().size() );

            rule = proxyConnectorRuleAdmin.getProxyConnectorRules().get( 0 );

            assertEquals( "org/apache/maven", rule.getPattern() );
            assertEquals( 2, rule.getProxyConnectors().size() );
            //assertEquals( "snapshots", rule.getProxyConnectors().get( 0 ).getSourceRepoId() );
            //assertEquals( "central", rule.getProxyConnectors().get( 0 ).getTargetRepoId() );
            assertEquals( ProxyConnectorRuleType.BLACK_LIST, rule.getProxyConnectorRuleType() );

            rule.setProxyConnectors( Arrays.asList( proxyConnector1 ) );

            proxyConnectorRuleAdmin.updateProxyConnectorRule( rule, getFakeAuditInformation() );

            assertEquals( size + 1, proxyConnectorRuleAdmin.getProxyConnectorRules().size() );

            rule = proxyConnectorRuleAdmin.getProxyConnectorRules().get( 0 );

            assertEquals( "org/apache/maven", rule.getPattern() );
            assertEquals( 1, rule.getProxyConnectors().size() );
            assertEquals( "snapshots", rule.getProxyConnectors().get( 0 ).getSourceRepoId() );
            assertEquals( "central", rule.getProxyConnectors().get( 0 ).getTargetRepoId() );

        }
        finally
        {
            proxyConnectorRuleAdmin.deleteProxyConnectorRule( rule, getFakeAuditInformation() );
View Full Code Here

        proxyConnector.setSourceRepoId( "snapshots" );
        proxyConnector.setTargetRepoId( "central" );

        ProxyConnectorRuleService service = getProxyConnectorRuleService( authorizationHeader );

        ProxyConnectorRule rule = null;
        try
        {

            int size = service.getProxyConnectorRules().size();
            assertEquals( 0, size );

            getProxyConnectorService().addProxyConnector( proxyConnector );

            rule = new ProxyConnectorRule( "org/apache/maven", ProxyConnectorRuleType.BLACK_LIST,
                                           Arrays.asList( proxyConnector ) );

            service.addProxyConnectorRule( rule );
            assertEquals( size + 1, service.getProxyConnectorRules().size() );

            rule = service.getProxyConnectorRules().get( 0 );

            assertEquals( "org/apache/maven", rule.getPattern() );
            assertEquals( 1, rule.getProxyConnectors().size() );
            assertEquals( "snapshots", rule.getProxyConnectors().get( 0 ).getSourceRepoId() );
            assertEquals( "central", rule.getProxyConnectors().get( 0 ).getTargetRepoId() );
            assertEquals( ProxyConnectorRuleType.BLACK_LIST, rule.getProxyConnectorRuleType() );
        }
        finally
        {
            service.deleteProxyConnectorRule( rule );
            getProxyConnectorService().deleteProxyConnector( proxyConnector );
View Full Code Here

TOP

Related Classes of org.apache.archiva.admin.model.beans.ProxyConnectorRule

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.