Java 类org.apache.http.conn.SchemePortResolver 实例源码

项目:remote-files-sync    文件:BasicAuthCache.java   
/**
 * Default constructor.
 *
 * @since 4.3
 */
public BasicAuthCache(final SchemePortResolver schemePortResolver) {
    super();
    this.map = new HashMap<HttpHost, AuthScheme>();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
项目:remote-files-sync    文件:HttpClientConnectionOperator.java   
HttpClientConnectionOperator(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    Args.notNull(socketFactoryRegistry, "Socket factory registry");
    this.socketFactoryRegistry = socketFactoryRegistry;
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
    this.dnsResolver = dnsResolver != null ? dnsResolver :
        SystemDefaultDnsResolver.INSTANCE;
}
项目:remote-files-sync    文件:BasicHttpClientConnectionManager.java   
public BasicHttpClientConnectionManager(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
    this.expiry = Long.MAX_VALUE;
    this.socketConfig = SocketConfig.DEFAULT;
    this.connConfig = ConnectionConfig.DEFAULT;
    this.isShutdown = new AtomicBoolean(false);
}
项目:remote-files-sync    文件:PoolingHttpClientConnectionManager.java   
public PoolingHttpClientConnectionManager(
        final Registry<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver,
        final long timeToLive, final TimeUnit tunit) {
    super();
    this.configData = new ConfigData();
    this.pool = new CPool(
            new InternalConnectionFactory(this.configData, connFactory), 2, 20, timeToLive, tunit);
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
项目:remote-files-sync    文件:PoolingHttpClientConnectionManager.java   
PoolingHttpClientConnectionManager(
        final CPool pool,
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.configData = new ConfigData();
    this.pool = pool;
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
项目:purecloud-iot    文件:BasicAuthCache.java   
/**
 * Default constructor.
 *
 * @since 4.3
 */
public BasicAuthCache(final SchemePortResolver schemePortResolver) {
    super();
    this.map = new ConcurrentHashMap<HttpHost, byte[]>();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
项目:purecloud-iot    文件:BasicHttpClientConnectionManager.java   
public BasicHttpClientConnectionManager(
    final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
    final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
    final SchemePortResolver schemePortResolver,
    final DnsResolver dnsResolver) {
  this(
      new DefaultHttpClientConnectionOperator(socketFactoryRegistry, schemePortResolver, dnsResolver),
      connFactory
  );
}
项目:purecloud-iot    文件:PoolingHttpClientConnectionManager.java   
public PoolingHttpClientConnectionManager(
        final Registry<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver,
        final long timeToLive, final TimeUnit tunit) {
    this(
        new DefaultHttpClientConnectionOperator(socketFactoryRegistry, schemePortResolver, dnsResolver),
        connFactory,
        timeToLive, tunit
    );
}
项目:purecloud-iot    文件:PoolingHttpClientConnectionManager.java   
/**
 * Visible for test.
 */
PoolingHttpClientConnectionManager(
        final CPool pool,
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.configData = new ConfigData();
    this.pool = pool;
    this.connectionOperator = new DefaultHttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
项目:purecloud-iot    文件:DefaultHttpClientConnectionOperator.java   
public DefaultHttpClientConnectionOperator(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    Args.notNull(socketFactoryRegistry, "Socket factory registry");
    this.socketFactoryRegistry = socketFactoryRegistry;
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
    this.dnsResolver = dnsResolver != null ? dnsResolver :
        SystemDefaultDnsResolver.INSTANCE;
}
项目:purecloud-iot    文件:TestBasicAuthCache.java   
@Test
public void testGetKeyWithSchemeRegistry() throws Exception {
    final SchemePortResolver schemePortResolver = Mockito.mock(SchemePortResolver.class);
    final BasicAuthCache cache = new BasicAuthCache(schemePortResolver);
    Mockito.when(schemePortResolver.resolve(new HttpHost("localhost", -1, "https"))).thenReturn(443);
    final HttpHost target = new HttpHost("localhost", 443, "https");
    Assert.assertSame(target, cache.getKey(target));
    Assert.assertEquals(target, cache.getKey(new HttpHost("localhost", -1, "https")));
}
项目:purecloud-iot    文件:TestDefaultProxyRoutePlanner.java   
@Before
public void setup() {
    defaultProxy = new HttpHost("default.proxy.host", 8888);
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    routePlanner = new DefaultProxyRoutePlanner(defaultProxy,
        schemePortResolver);
}
项目:purecloud-iot    文件:TestHttpClientConnectionOperator.java   
@SuppressWarnings("unchecked")
@Before
public void setup() throws Exception {
    conn = Mockito.mock(ManagedHttpClientConnection.class);
    socket = Mockito.mock(Socket.class);
    plainSocketFactory = Mockito.mock(ConnectionSocketFactory.class);
    sslSocketFactory = Mockito.mock(LayeredConnectionSocketFactory.class);
    socketFactoryRegistry = Mockito.mock(Lookup.class);
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    dnsResolver = Mockito.mock(DnsResolver.class);
    connectionOperator = new DefaultHttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
}
项目:Visit    文件:BasicAuthCache.java   
/**
 * Default constructor.
 *
 * @since 4.3
 */
public BasicAuthCache(final SchemePortResolver schemePortResolver) {
    super();
    this.map = new HashMap<HttpHost, AuthScheme>();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
项目:Visit    文件:HttpClientConnectionOperator.java   
HttpClientConnectionOperator(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    Args.notNull(socketFactoryRegistry, "Socket factory registry");
    this.socketFactoryRegistry = socketFactoryRegistry;
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
    this.dnsResolver = dnsResolver != null ? dnsResolver :
        SystemDefaultDnsResolver.INSTANCE;
}
项目:Visit    文件:BasicHttpClientConnectionManager.java   
public BasicHttpClientConnectionManager(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
    this.expiry = Long.MAX_VALUE;
    this.socketConfig = SocketConfig.DEFAULT;
    this.connConfig = ConnectionConfig.DEFAULT;
    this.isShutdown = new AtomicBoolean(false);
}
项目:Visit    文件:PoolingHttpClientConnectionManager.java   
public PoolingHttpClientConnectionManager(
        final Registry<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver,
        final long timeToLive, final TimeUnit tunit) {
    super();
    this.configData = new ConfigData();
    this.pool = new CPool(
            new InternalConnectionFactory(this.configData, connFactory), 2, 20, timeToLive, tunit);
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
项目:Visit    文件:PoolingHttpClientConnectionManager.java   
PoolingHttpClientConnectionManager(
        final CPool pool,
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.configData = new ConfigData();
    this.pool = pool;
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
项目:SolRDF    文件:IntegrationTestSupertypeLayer.java   
/**
 * Initilisation procedure for this test case.
 * 
 * @throws UnableToBuildSolRDFClientException in case the client cannot be built.
 * @throws Exception in case of Solr startup failure.
 */
@BeforeClass
public static void initITTest() {
    System.setProperty("tests.asserts", "false");   
    System.setProperty("jetty.port", "8080");
    System.setProperty("solr.core.name", "store");
    System.setProperty("solr.data.dir", initCoreDataDir.getAbsolutePath());

    try {
        SOLR = createJetty(
                "target/solrdf-integration-tests-1.1-dev/solrdf",
                JettyConfig.builder()
                    .setPort(8080)
                    .setContext("/solr")
                    .stopAtShutdown(true)
                    .build());      

        final HttpClient httpClient = HttpClientBuilder.create()
                .setRoutePlanner(
                        new DefaultRoutePlanner(
                                new SchemePortResolver() {
                                    @Override
                                    public int resolve(final HttpHost host) throws UnsupportedSchemeException {
                                        return SOLR.getLocalPort();
                                    }
                                })).build();


        SOLRDF_CLIENT = SolRDF.newBuilder()
                  .withEndpoint("http://127.0.0.1:8080/solr/store")
                  .withGraphStoreProtocolEndpointPath("/rdf-graph-store")
                  .withHttpClient(httpClient)
                  .withSPARQLEndpointPath("/sparql")
                  .build();

        PLAIN_SOLR_CLIENT = new HttpSolrClient(SOLR_URI);
    } catch (final Exception exception) {
        throw new RuntimeException(exception);
    }
}
项目:ZTLib    文件:BasicAuthCache.java   
/**
 * Default constructor.
 *
 * @since 4.3
 */
public BasicAuthCache(final SchemePortResolver schemePortResolver) {
    super();
    this.map = new HashMap<HttpHost, AuthScheme>();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
项目:ZTLib    文件:HttpClientConnectionOperator.java   
HttpClientConnectionOperator(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    Args.notNull(socketFactoryRegistry, "Socket factory registry");
    this.socketFactoryRegistry = socketFactoryRegistry;
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
    this.dnsResolver = dnsResolver != null ? dnsResolver :
        SystemDefaultDnsResolver.INSTANCE;
}
项目:ZTLib    文件:BasicHttpClientConnectionManager.java   
public BasicHttpClientConnectionManager(
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.connFactory = connFactory != null ? connFactory : ManagedHttpClientConnectionFactory.INSTANCE;
    this.expiry = Long.MAX_VALUE;
    this.socketConfig = SocketConfig.DEFAULT;
    this.connConfig = ConnectionConfig.DEFAULT;
    this.isShutdown = new AtomicBoolean(false);
}
项目:ZTLib    文件:PoolingHttpClientConnectionManager.java   
public PoolingHttpClientConnectionManager(
        final Registry<ConnectionSocketFactory> socketFactoryRegistry,
        final HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver,
        final long timeToLive, final TimeUnit tunit) {
    super();
    this.configData = new ConfigData();
    this.pool = new CPool(
            new InternalConnectionFactory(this.configData, connFactory), 2, 20, timeToLive, tunit);
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
项目:ZTLib    文件:PoolingHttpClientConnectionManager.java   
PoolingHttpClientConnectionManager(
        final CPool pool,
        final Lookup<ConnectionSocketFactory> socketFactoryRegistry,
        final SchemePortResolver schemePortResolver,
        final DnsResolver dnsResolver) {
    super();
    this.configData = new ConfigData();
    this.pool = pool;
    this.connectionOperator = new HttpClientConnectionOperator(
            socketFactoryRegistry, schemePortResolver, dnsResolver);
    this.isShutDown = new AtomicBoolean(false);
}
项目:remote-files-sync    文件:HttpClientBuilder.java   
/**
 * Assigns {@link SchemePortResolver} instance.
 */
public final HttpClientBuilder setSchemePortResolver(
        final SchemePortResolver schemePortResolver) {
    this.schemePortResolver = schemePortResolver;
    return this;
}
项目:remote-files-sync    文件:SystemDefaultRoutePlanner.java   
public SystemDefaultRoutePlanner(
        final SchemePortResolver schemePortResolver,
        final ProxySelector proxySelector) {
    super(schemePortResolver);
    this.proxySelector = proxySelector != null ? proxySelector : ProxySelector.getDefault();
}
项目:remote-files-sync    文件:DefaultRoutePlanner.java   
public DefaultRoutePlanner(final SchemePortResolver schemePortResolver) {
    super();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
项目:remote-files-sync    文件:DefaultProxyRoutePlanner.java   
public DefaultProxyRoutePlanner(final HttpHost proxy, final SchemePortResolver schemePortResolver) {
    super(schemePortResolver);
    this.proxy = Args.notNull(proxy, "Proxy host");
}
项目:purecloud-iot    文件:HttpClientBuilder.java   
/**
 * Assigns {@link SchemePortResolver} instance.
 */
public final HttpClientBuilder setSchemePortResolver(
        final SchemePortResolver schemePortResolver) {
    this.schemePortResolver = schemePortResolver;
    return this;
}
项目:purecloud-iot    文件:SystemDefaultRoutePlanner.java   
public SystemDefaultRoutePlanner(
        final SchemePortResolver schemePortResolver,
        final ProxySelector proxySelector) {
    super(schemePortResolver);
    this.proxySelector = proxySelector != null ? proxySelector : ProxySelector.getDefault();
}
项目:purecloud-iot    文件:DefaultRoutePlanner.java   
public DefaultRoutePlanner(final SchemePortResolver schemePortResolver) {
    super();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
项目:purecloud-iot    文件:DefaultProxyRoutePlanner.java   
public DefaultProxyRoutePlanner(final HttpHost proxy, final SchemePortResolver schemePortResolver) {
    super(schemePortResolver);
    this.proxy = Args.notNull(proxy, "Proxy host");
}
项目:purecloud-iot    文件:TestSystemDefaultRoutePlanner.java   
@Before
public void setup() {
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    proxySelector = Mockito.mock(ProxySelector.class);
    routePlanner = new SystemDefaultRoutePlanner(schemePortResolver, proxySelector);
}
项目:purecloud-iot    文件:TestDefaultRoutePlanner.java   
@Before
public void setup() {
    schemePortResolver = Mockito.mock(SchemePortResolver.class);
    routePlanner = new DefaultRoutePlanner(schemePortResolver);
}
项目:Visit    文件:HttpClientBuilder.java   
/**
 * Assigns {@link SchemePortResolver} instance.
 */
public final HttpClientBuilder setSchemePortResolver(
        final SchemePortResolver schemePortResolver) {
    this.schemePortResolver = schemePortResolver;
    return this;
}
项目:Visit    文件:SystemDefaultRoutePlanner.java   
public SystemDefaultRoutePlanner(
        final SchemePortResolver schemePortResolver,
        final ProxySelector proxySelector) {
    super(schemePortResolver);
    this.proxySelector = proxySelector != null ? proxySelector : ProxySelector.getDefault();
}
项目:Visit    文件:DefaultRoutePlanner.java   
public DefaultRoutePlanner(final SchemePortResolver schemePortResolver) {
    super();
    this.schemePortResolver = schemePortResolver != null ? schemePortResolver :
        DefaultSchemePortResolver.INSTANCE;
}
项目:Visit    文件:DefaultProxyRoutePlanner.java   
public DefaultProxyRoutePlanner(final HttpHost proxy, final SchemePortResolver schemePortResolver) {
    super(schemePortResolver);
    this.proxy = Args.notNull(proxy, "Proxy host");
}
项目:ZTLib    文件:HttpClientBuilder.java   
/**
 * Assigns {@link SchemePortResolver} instance.
 */
public final HttpClientBuilder setSchemePortResolver(
        final SchemePortResolver schemePortResolver) {
    this.schemePortResolver = schemePortResolver;
    return this;
}
项目:ZTLib    文件:SystemDefaultRoutePlanner.java   
public SystemDefaultRoutePlanner(
        final SchemePortResolver schemePortResolver,
        final ProxySelector proxySelector) {
    super(schemePortResolver);
    this.proxySelector = proxySelector != null ? proxySelector : ProxySelector.getDefault();
}