uri = URI.create(uri + "/v1/service/" + type + "/");
if (pool != null) {
uri = uri.resolve(pool);
}
Builder requestBuilder = prepareGet()
.setUri(uri)
.setHeader("User-Agent", nodeInfo.getNodeId());
if (serviceDescriptors != null && serviceDescriptors.getETag() != null) {
requestBuilder.setHeader(HttpHeaders.ETAG, serviceDescriptors.getETag());
}
return httpClient.executeAsync(requestBuilder.build(), new DiscoveryResponseHandler<ServiceDescriptors>(format("Lookup of %s", type), uri)
{
@Override
public ServiceDescriptors handle(Request request, Response response)
{
Duration maxAge = extractMaxAge(response);