return new AHCGetCallResult<T>(CallFailure.timeout(_server, startTime, startTime));
}
AHCPathBuilder path = _server.rootPath();
path = _pathFinder.appendStoreEntryPath(path);
path = _keyConverter.appendToPath(path, contentId);
BoundRequestBuilder reqBuilder = path.getRequest(_httpClient);
// plus, allow use of GZIP and LZF
reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_ACCEPT_COMPRESSION,
"lzf, gzip, identity");
// and may use range as well
if (range != null) {
reqBuilder = reqBuilder.addHeader(ClusterMateConstants.HTTP_HEADER_RANGE_FOR_REQUEST,
range.asRequestHeader());
}
int statusCode = -1;
UncompressingAsyncHandler<T> handler = new UncompressingAsyncHandler<T>(processor);
try {
T resp = null;
ListenableFuture<T> futurama = _httpClient.executeRequest(reqBuilder.build(), handler);
try {
resp = futurama.get(timeout, TimeUnit.MILLISECONDS);
} catch (TimeoutException e) {
return new AHCGetCallResult<T>(CallFailure.timeout(_server, startTime, System.currentTimeMillis()));
}