Search in sources :

Example 1 with ApacheHttpClientHttpService

use of com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService in project odata-client by davidmoten.

the class CarServiceTest method testWithApacheHttpService.

@Test
public void testWithApacheHttpService() throws Exception {
    Path basePath = new Path("http://localhost:8090/cars.svc", PathStyle.IDENTIFIERS_IN_ROUND_BRACKETS);
    HttpService service = new ApacheHttpClientHttpService(basePath);
    checkServiceCalls(service).stop();
}
Also used : ApacheHttpClientHttpService(com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService) ApacheHttpClientHttpService(com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService) Test(org.junit.Test)

Example 2 with ApacheHttpClientHttpService

use of com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService in project odata-client by davidmoten.

the class MicrosoftClientBuilder method createService.

@SuppressWarnings("resource")
private static <T> T createService(String baseUrl, Authenticator authenticator, // 
long connectTimeoutMs, // 
long readTimeoutMs, // 
Optional<String> proxyHost, // 
Optional<Integer> proxyPort, Optional<String> proxyUsername, Optional<String> proxyPassword, Optional<Supplier<CloseableHttpClient>> supplier, Optional<Function<HttpClientBuilder, HttpClientBuilder>> httpClientBuilderExtras, // 
Creator<T> creator, // 
String authenticationEndpoint, // 
Function<? super HttpService, ? extends HttpService> httpServiceTransformer, List<SchemaInfo> schemas, PathStyle pathStyle) {
    final Supplier<CloseableHttpClient> clientSupplier = createClientSupplier(connectTimeoutMs, readTimeoutMs, proxyHost, proxyPort, proxyUsername, proxyPassword, supplier, httpClientBuilderExtras);
    Path basePath = new Path(baseUrl, pathStyle);
    HttpService httpService = new // 
    ApacheHttpClientHttpService(// 
    basePath, // 
    clientSupplier, authenticator::authenticate);
    httpService = httpServiceTransformer.apply(httpService);
    return creator.create(new Context(Serializer.INSTANCE, httpService, createProperties(), schemas));
}
Also used : Path(com.github.davidmoten.odata.client.Path) Context(com.github.davidmoten.odata.client.Context) CloseableHttpClient(org.apache.http.impl.client.CloseableHttpClient) HttpService(com.github.davidmoten.odata.client.HttpService) ApacheHttpClientHttpService(com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService) ApacheHttpClientHttpService(com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService)

Aggregations

ApacheHttpClientHttpService (com.github.davidmoten.odata.client.internal.ApacheHttpClientHttpService)2 Context (com.github.davidmoten.odata.client.Context)1 HttpService (com.github.davidmoten.odata.client.HttpService)1 Path (com.github.davidmoten.odata.client.Path)1 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)1 Test (org.junit.Test)1