Package org.apache.archiva.configuration

Examples of org.apache.archiva.configuration.ProxyConnectorConfiguration


        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 );
        proxyConnector.setDisabled( false );
        c.addProxyConnector( proxyConnector );

        configuration.save( c );

        wagonFactory = mock( WagonFactory.class );
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

                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

                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

                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 );
                }
            }
        }
    }
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

        value.setPattern( pattern );
        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 );

        return value;
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() );

    List<String> sourceRepoIdList = registry.getList( prefix + "sourceRepoId" );
    String sourceRepoId = value.getSourceRepoId();
    if (sourceRepoIdList != null && !sourceRepoIdList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = sourceRepoIdList.size();i<size;i++)
        {
            sb.append( sourceRepoIdList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        sourceRepoId = sb.toString();
    }

        value.setSourceRepoId( sourceRepoId );
    //String targetRepoId = registry.getString( prefix + "targetRepoId", value.getTargetRepoId() );

    List<String> targetRepoIdList = registry.getList( prefix + "targetRepoId" );
    String targetRepoId = value.getTargetRepoId();
    if (targetRepoIdList != null && !targetRepoIdList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = targetRepoIdList.size();i<size;i++)
        {
            sb.append( targetRepoIdList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        targetRepoId = sb.toString();
    }

        value.setTargetRepoId( targetRepoId );
    //String proxyId = registry.getString( prefix + "proxyId", value.getProxyId() );

    List<String> proxyIdList = registry.getList( prefix + "proxyId" );
    String proxyId = value.getProxyId();
    if (proxyIdList != null && !proxyIdList.isEmpty() )
    {
        StringBuilder sb = new StringBuilder(  );
        for (int i = 0,size = proxyIdList.size();i<size;i++)
        {
            sb.append( proxyIdList.get( i ) );
            if (i<size - 1)
            {
                sb.append( ',' );
            }
        }
        proxyId = sb.toString();
    }

        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

    {
        boolean satisfies = false;

        if ( object instanceof ProxyConnectorConfiguration )
        {
            ProxyConnectorConfiguration connector = (ProxyConnectorConfiguration) object;
            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
                                                                                                        connector.getTargetRepoId() ) );
        }

        return satisfies;
    }
View Full Code Here

TOP

Related Classes of org.apache.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.