Java Code Examples for org.apache.http.impl.conn.DefaultSchemePortResolver#INSTANCE

The following examples show how to use org.apache.http.impl.conn.DefaultSchemePortResolver#INSTANCE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApacheHttpClient.java    From aws-sdk-java-v2 with Apache License 2.0 6 votes vote down vote up
public HttpClientConnectionManager create(ApacheHttpClient.DefaultBuilder configuration,
                                          AttributeMap standardOptions) {
    ConnectionSocketFactory sslsf = getPreferredSocketFactory(configuration, standardOptions);

    PoolingHttpClientConnectionManager cm = new
            PoolingHttpClientConnectionManager(
            createSocketFactoryRegistry(sslsf),
            null,
            DefaultSchemePortResolver.INSTANCE,
            null,
            standardOptions.get(SdkHttpConfigurationOption.CONNECTION_TIME_TO_LIVE).toMillis(),
            TimeUnit.MILLISECONDS);

    cm.setDefaultMaxPerRoute(standardOptions.get(SdkHttpConfigurationOption.MAX_CONNECTIONS));
    cm.setMaxTotal(standardOptions.get(SdkHttpConfigurationOption.MAX_CONNECTIONS));
    cm.setDefaultSocketConfig(buildSocketConfig(standardOptions));

    return cm;
}
 
Example 2
Source File: ApacheConnectionManagerFactory.java    From ibm-cos-sdk-java with Apache License 2.0 6 votes vote down vote up
@Override
public HttpClientConnectionManager create(final HttpClientSettings settings) {
    ConnectionSocketFactory sslsf = getPreferredSocketFactory(settings);

    final PoolingHttpClientConnectionManager cm = new
            PoolingHttpClientConnectionManager(
            createSocketFactoryRegistry(sslsf),
            null,
            DefaultSchemePortResolver.INSTANCE,
            new DelegatingDnsResolver(settings.getDnsResolver()),
            settings.getConnectionPoolTTL(),
            TimeUnit.MILLISECONDS);

    cm.setValidateAfterInactivity(settings.getValidateAfterInactivityMillis());
    cm.setDefaultMaxPerRoute(settings.getMaxConnections());
    cm.setMaxTotal(settings.getMaxConnections());
    cm.setDefaultSocketConfig(buildSocketConfig(settings));
    cm.setDefaultConnectionConfig(buildConnectionConfig(settings));

    return cm;
}
 
Example 3
Source File: ExtendedConnectionOperator.java    From lavaplayer with Apache License 2.0 5 votes vote down vote up
public ExtendedConnectionOperator(
    Lookup<ConnectionSocketFactory> socketFactoryRegistry,
    SchemePortResolver schemePortResolver,
    DnsResolver dnsResolver
) {
  this.socketFactoryRegistry = socketFactoryRegistry;
  this.schemePortResolver = schemePortResolver != null ? schemePortResolver : DefaultSchemePortResolver.INSTANCE;
  this.dnsResolver = dnsResolver != null ? dnsResolver : SystemDefaultDnsResolver.INSTANCE;
}
 
Example 4
Source File: AbstractRoutePlanner.java    From lavaplayer with Apache License 2.0 5 votes vote down vote up
protected AbstractRoutePlanner(final List<IpBlock> ipBlocks, final boolean handleSearchFailure) {
  this.ipBlock = new CombinedIpBlock(ipBlocks);
  this.failingAddresses = new HashMap<>();
  this.schemePortResolver = DefaultSchemePortResolver.INSTANCE;
  this.handleSearchFailure = handleSearchFailure;
  log.info("Active RoutePlanner: {} using total of {} ips", getClass().getCanonicalName(), this.ipBlock.getSize());
}
 
Example 5
Source File: NexusHttpRoutePlanner.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @since 2.5
 */
public NexusHttpRoutePlanner(final Map<String, HttpHost> proxies,
                             @Nullable final Pattern nonProxyHostsPattern)
{
  super(DefaultSchemePortResolver.INSTANCE);
  this.proxies = checkNotNull(proxies);
  this.nonProxyHostPattern = nonProxyHostsPattern;
}
 
Example 6
Source File: Substitute_RestClient.java    From quarkus with Apache License 2.0 4 votes vote down vote up
public NoSerializationBasicAuthCache(final SchemePortResolver schemePortResolver) {
    this.map = new ConcurrentHashMap<>();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver
            : DefaultSchemePortResolver.INSTANCE;
}
 
Example 7
Source File: SdkProxyRoutePlanner.java    From aws-sdk-java-v2 with Apache License 2.0 4 votes vote down vote up
public SdkProxyRoutePlanner(String proxyHost, int proxyPort, String proxyProtocol, Set<String> nonProxyHosts) {
    super(DefaultSchemePortResolver.INSTANCE);
    proxy = new HttpHost(proxyHost, proxyPort, proxyProtocol);
    this.hostPatterns = nonProxyHosts;
}
 
Example 8
Source File: SdkProxyRoutePlanner.java    From ibm-cos-sdk-java with Apache License 2.0 4 votes vote down vote up
public SdkProxyRoutePlanner(String proxyHost, int proxyPort, String nonProxyHosts) {
    super(DefaultSchemePortResolver.INSTANCE);
    proxy = new HttpHost(proxyHost, proxyPort);
    parseNonProxyHosts(nonProxyHosts);
}
 
Example 9
Source File: HttpClientConfigurator.java    From bintray-client-java with Apache License 2.0 4 votes vote down vote up
public DefaultHostRoutePlanner(String defaultHost) {
    super(DefaultSchemePortResolver.INSTANCE);
    this.defaultHost = new HttpHost(defaultHost);
}
 
Example 10
Source File: ProxyMappingsAwareRoutePlanner.java    From keycloak with Apache License 2.0 4 votes vote down vote up
public ProxyMappingsAwareRoutePlanner(ProxyMappings proxyMappings) {
  super(DefaultSchemePortResolver.INSTANCE);
  this.proxyMappings = proxyMappings;
}