Examples of NetworkProxyConfiguration


Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

                if( remoteRepoConfig != null )
                {
                    remoteRepositories.add( remoteRepoConfig );

                    NetworkProxyConfiguration networkProxyConfig = archivaConfiguration.getConfiguration().getNetworkProxiesAsMap().get(
                        proxyConnector.getProxyId() );

                    if( networkProxyConfig != null )
                    {
                        ProxyInfo proxy = new ProxyInfo();
                        proxy.setType( networkProxyConfig.getProtocol() );
                        proxy.setHost( networkProxyConfig.getHost() );
                        proxy.setPort( networkProxyConfig.getPort() );
                        proxy.setUserName( networkProxyConfig.getUsername() );
                        proxy.setPassword( networkProxyConfig.getPassword() );

                        // key/value: remote repo ID/proxy info
                        networkProxies.put( proxyConnector.getTargetRepoId(), proxy );
                    }
                }
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

            {
                for( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
                {
                    remoteRepositories.add( archivaConfiguration.getConfiguration().findRemoteRepositoryById( proxyConnector.getTargetRepoId() ) );

                    NetworkProxyConfiguration networkProxyConfig = archivaConfiguration.getConfiguration().getNetworkProxiesAsMap().get(
                        proxyConnector.getProxyId() );

                    if( networkProxyConfig != null )
                    {
                        ProxyInfo proxy = new ProxyInfo();
                        proxy.setType( networkProxyConfig.getProtocol() );
                        proxy.setHost( networkProxyConfig.getHost() );
                        proxy.setPort( networkProxyConfig.getPort() );
                        proxy.setUserName( networkProxyConfig.getUsername() );
                        proxy.setPassword( networkProxyConfig.getPassword() );

                        // key/value: remote repo ID/proxy info
                        networkProxies.put( proxyConnector.getTargetRepoId(), proxy );
                    }
                }
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

        value.setProxyConnectors( proxyConnectors );
        java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
        List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
        for ( Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); )
        {
            NetworkProxyConfiguration v = readNetworkProxyConfiguration( "", (Registry) i.next() );
            networkProxies.add( v );
        }
        value.setNetworkProxies( networkProxies );
        java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
        List legacyArtifactPathsSubsets = registry.getSubsetList( prefix + "legacyArtifactPaths.legacyArtifactPath" );
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

        return value;
    }
   
    private NetworkProxyConfiguration readNetworkProxyConfiguration( String prefix, Registry registry )
    {
        NetworkProxyConfiguration value = new NetworkProxyConfiguration();

        String id = registry.getString( prefix + "id", value.getId() );
        value.setId( id );
        String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
        value.setProtocol( protocol );
        String host = registry.getString( prefix + "host", value.getHost() );
        value.setHost( host );
        int port = registry.getInt( prefix + "port", value.getPort() );
        value.setPort( port );
        String username = registry.getString( prefix + "username", value.getUsername() );
        value.setUsername( username );
        String password = registry.getString( prefix + "password", value.getPassword() );
        value.setPassword( password );

        return value;
    }
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

                int count = 0;
                for ( Iterator iter = value.getNetworkProxies().iterator(); iter.hasNext(); count++ )
                {
                    String name = "networkProxies.networkProxy(" + count + ")";
                    NetworkProxyConfiguration o = ( NetworkProxyConfiguration ) iter.next();
                    writeNetworkProxyConfiguration( prefix + name + ".", o, registry );
                }
            }
            if ( value.getLegacyArtifactPaths() != null && value.getLegacyArtifactPaths().size() > 0
)
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

                int count = 0;
                for ( Iterator iter = value.getNetworkProxies().iterator(); iter.hasNext(); count++ )
                {
                    String name = "networkProxies.networkProxy(" + count + ")";
                    NetworkProxyConfiguration o = ( NetworkProxyConfiguration ) iter.next();
                    writeNetworkProxyConfiguration( prefix + name + ".", o, registry );
                }
            }
            if ( value.getLegacyArtifactPaths() != null && value.getLegacyArtifactPaths().size() > 0
)
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

        value.setProxyConnectors( proxyConnectors );
        java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
        List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
        for ( Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); )
        {
            NetworkProxyConfiguration v = readNetworkProxyConfiguration( "", (Registry) i.next() );
            networkProxies.add( v );
        }
        value.setNetworkProxies( networkProxies );
        java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
        List legacyArtifactPathsSubsets = registry.getSubsetList( prefix + "legacyArtifactPaths.legacyArtifactPath" );
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

        return value;
    }
   
    private NetworkProxyConfiguration readNetworkProxyConfiguration( String prefix, Registry registry )
    {
        NetworkProxyConfiguration value = new NetworkProxyConfiguration();

    //String id = registry.getString( prefix + "id", value.getId() );

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

        value.setId( id );
    //String protocol = registry.getString( prefix + "protocol", value.getProtocol() );

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

        value.setProtocol( protocol );
    //String host = registry.getString( prefix + "host", value.getHost() );

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

        value.setHost( host );
    int port = registry.getInt( prefix + "port", value.getPort() );
        value.setPort( port );
    //String username = registry.getString( prefix + "username", value.getUsername() );

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

        value.setUsername( username );
    //String password = registry.getString( prefix + "password", value.getPassword() );

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

        value.setPassword( password );
        boolean useNtlm = registry.getBoolean( prefix + "useNtlm", value.isUseNtlm() );
        value.setUseNtlm( useNtlm );

        return value;
    }
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

    {
        boolean satisfies = false;

        if ( object instanceof NetworkProxyConfiguration )
        {
            NetworkProxyConfiguration proxy = (NetworkProxyConfiguration) object;
            return ( StringUtils.equals( proxyId, proxy.getId() ) );
        }

        return satisfies;
    }
View Full Code Here

Examples of org.apache.archiva.configuration.NetworkProxyConfiguration

        server.setHandler( handler );
        server.start();

        int port = server.getConnectors()[0].getLocalPort();

        NetworkProxyConfiguration proxyConfig = new NetworkProxyConfiguration();
        proxyConfig.setHost( "localhost" );
        proxyConfig.setPort( port );
        proxyConfig.setProtocol( "http" );
        proxyConfig.setId( PROXY_ID );
        config.getConfiguration().addNetworkProxy( proxyConfig );

        // Setup target (proxied to) repository.
        RemoteRepositoryConfiguration repoConfig = new RemoteRepositoryConfiguration();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.