Package org.sonatype.nexus.component.source.api.http

Examples of org.sonatype.nexus.component.source.api.http.HttpProxyConfig


    return null;
  }

  private ProxyConfig proxyFromMap(final Map<String, Object> configMap) {
    ProxyConfig proxyConfig = null;
    HttpProxyConfig httpProxyConfig = httpProxyFromMap(configMap, "http.proxy.http");
    if (httpProxyConfig != null) {
      proxyConfig = new ProxyConfig();
      proxyConfig.withHttpProxyConfig(httpProxyConfig);
      proxyConfig.withHttpsProxyConfig(httpProxyFromMap(configMap, "http.proxy.https"));
      if (configMap.containsKey("http.proxy.nonProxyHosts")) {
View Full Code Here


  }

  private HttpProxyConfig httpProxyFromMap(final Map<String, Object> configMap,
                                           final String prefix)
  {
    HttpProxyConfig httpProxyConfig = null;
    if (configMap.containsKey(prefix + ".hostname")) {
      httpProxyConfig = new HttpProxyConfig();
      httpProxyConfig.withHostname((String) configMap.get(prefix + ".hostname"));
      httpProxyConfig.withPort((Integer) configMap.get(prefix + ".port"));
      httpProxyConfig.withAuthenticationConfig(authenticationFromMap(configMap, prefix));
    }
    return httpProxyConfig;
  }
View Full Code Here

        .withAuthenticationConfig(new UsernameAuthenticationConfig()
            .withUsername("foo")
            .withPassword("bar")
        )
        .withProxyConfig(new ProxyConfig()
            .withHttpProxyConfig(new HttpProxyConfig()
                .withHostname("httpHost")
                .withPort(3)
                .withAuthenticationConfig(new UsernameAuthenticationConfig()
                    .withUsername("foo1")
                    .withPassword("bar1")
                )
            )
            .withHttpsProxyConfig(new HttpProxyConfig()
                .withHostname("httpsHost")
                .withPort(4)
                .withAuthenticationConfig(new NtlmAuthenticationConfig()
                    .withUsername("foo2")
                    .withPassword("bar2")
View Full Code Here

  @VisibleForTesting
  public void applyProxyConfig(final Builder builder, final HttpClientConfig config) {
    if (config.getProxyConfig() != null && config.getProxyConfig().getHttpProxyConfig() != null) {
      Map<String, HttpHost> proxies = Maps.newHashMap();

      HttpProxyConfig httpProxyConfig = config.getProxyConfig().getHttpProxyConfig();
      HttpHost httpProxy = new HttpHost(httpProxyConfig.getHostname(), httpProxyConfig.getPort());
      applyAuthenticationConfig(builder, httpProxyConfig.getAuthenticationConfig(), httpProxy);

      log.debug("http proxy setup with host '{}'", httpProxyConfig.getHostname());
      proxies.put("http", httpProxy);
      proxies.put("https", httpProxy);

      if (config.getProxyConfig().getHttpsProxyConfig() != null) {
        HttpProxyConfig httpsProxyConfig = config.getProxyConfig().getHttpsProxyConfig();
        HttpHost httpsProxy = new HttpHost(httpsProxyConfig.getHostname(), httpsProxyConfig.getPort());
        applyAuthenticationConfig(builder, httpsProxyConfig.getAuthenticationConfig(), httpsProxy);
        log.debug("https proxy setup with host '{}'", httpsProxy.getHostName());
        proxies.put("https", httpsProxy);
      }

      final Set<Pattern> nonProxyHostPatterns = Sets.newHashSet();
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.component.source.api.http.HttpProxyConfig

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.