Examples of HttpClientFactory


Examples of com.linkedin.r2.transport.http.client.HttpClientFactory

                                      new DegraderLoadBalancerStrategyFactoryV3());

    Map<String, TransportClientFactory> clientFactories =
            new HashMap<String, TransportClientFactory>();

    clientFactories.put("http", new HttpClientFactory());

    // We rely on _tmpdir below being fresh for each test case.  Otherwise, leftover files in
    // _tmpdir from a previous test could affect another test.  This is accomplished with the
    // @BeforeMethod and @AfterMethod annotations.
    ZKFSTogglingLoadBalancerFactoryImpl f2 = new ZKFSTogglingLoadBalancerFactoryImpl(
View Full Code Here

Examples of com.linkedin.r2.transport.http.client.HttpClientFactory

  @BeforeSuite
  private void init() throws Exception
  {
    _testServer = new TestServer();
    _clientFactory = new HttpClientFactory();
  }
View Full Code Here

Examples of com.linkedin.r2.transport.http.client.HttpClientFactory

    final int N = 5;
    final int REQUEST_TIMEOUT = 1000;

    // Specify the get timeout; we know the max rate will be half the get timeout
    final TransportClient transportClient =
        new HttpClientFactory().getClient(Collections.singletonMap(HttpClientFactory.HTTP_REQUEST_TIMEOUT,
                                                                   Integer.toString(REQUEST_TIMEOUT)));
    final Client client = new TransportClientAdapter(transportClient);

    final ServerSocket ss = new ServerSocket();
    ss.bind(null);
View Full Code Here

Examples of com.linkedin.r2.transport.http.client.HttpClientFactory

                                      new DegraderLoadBalancerStrategyFactoryV3());

    Map<String, TransportClientFactory> clientFactories =
        new HashMap<String, TransportClientFactory>();

    clientFactories.put("http", new HttpClientFactory());

    SynchronousExecutorService executorService = new SynchronousExecutorService();
    MockStore<ServiceProperties> serviceRegistry = new MockStore<ServiceProperties>();
    MockStore<ClusterProperties> clusterRegistry = new MockStore<ClusterProperties>();
    MockStore<UriProperties> uriRegistry = new MockStore<UriProperties>();
View Full Code Here

Examples of com.volantis.shared.net.http.client.HttpClientFactory

    /**
     * Prepare HTTPClient for request,
     * Set headers if are pass in parameters
     */
    private HttpClient prepareHttpClient() {
        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(CONNECTION_TIMEOUT);
        builder.setRoundTripTimeout(ROUNDTRIP_TIMEOUT);
        return builder.buildHttpClient();
    }
View Full Code Here

Examples of com.volantis.shared.net.http.client.HttpClientFactory

            final XMLPipelineContext xmlPipelineContext) throws HTTPException {

        final HttpState state = new HttpState();
        state.setCookiePolicy(CookiePolicy.COMPATIBILITY);

        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setState(state);
        builder.setConnectionTimeout(timeout);
        builder.setRoundTripTimeout(timeout);

        // create the HTTPClient instance.
View Full Code Here

Examples of com.volantis.shared.net.http.client.HttpClientFactory

    public HttpContent retrieve(final URL url, final Period timeout,
                               final HttpUrlConfiguration httpConfig)
            throws IOException {
        // Create a HTTP Client which will timeout connections and round trips
        // in the specified period.
        final HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        final HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(timeout);
        builder.setRoundTripTimeout(timeout);
        final HttpClient httpClient = builder.buildHttpClient();

        final GetMethod method = new GetMethod(url.toExternalForm());
View Full Code Here

Examples of com.volantis.shared.net.http.client.HttpClientFactory

    public HttpGetMethod createGetMethod(String url) {

        GetMethod method = new GetMethod(url);
        method.setHttp11(false);

        HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
        HttpClientBuilder builder = factory.createClientBuilder();
        builder.setConnectionTimeout(connectionTimeout);
        builder.setRoundTripTimeout(connectionTimeout);
        HttpClient httpClient = builder.buildHttpClient();

        URL netURL = null;
View Full Code Here

Examples of com.volantis.shared.net.http.client.HttpClientFactory

            } else {
                method.addRequestHeader("Host",
                        url.getHost() + ":" + url.getPort());
            }

            HttpClientFactory factory = HttpClientFactory.getDefaultInstance();
            HttpClientBuilder builder = factory.createClientBuilder();
            HttpClient httpClient = builder.buildHttpClient();
            httpClient.executeMethod(method);
        }
        return method;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.host.http.client.HttpClientFactory

        post.addHeader("Slug", "Slug " + receiptName + "");

        post.setEntity(new FileEntity(input, "image/gif"));

        // Get HTTP client
        org.apache.http.client.HttpClient httpclient = new HttpClientFactory().createHttpClient();
        try {
            // Execute request
            HttpResponse response = httpclient.execute(post);
            int result = response.getStatusLine().getStatusCode();
            // Pseudo Code (see APP (http://tools.ietf.org/html/rfc5023#section-9.6)
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.