/** * Blocks (up to a timeout) for the response to arrive (http status code, * etc.) * * @throws IOException if there is a problem, if there is a timeout, etc. */ private void ensureResponse() throws IOException { if (m_response == null) { try { final boolean traceEnabled = log.isTraceEnabled(); final long start = traceEnabled ? System.currentTimeMillis() : 0; m_response = get(queryTimeoutMillis, TimeUnit.MILLISECONDS); if (traceEnabled) log.trace("Response in " + (System.currentTimeMillis() - start) + "ms"); } catch (InterruptedException | TimeoutException | ExecutionException e) { throw new IOException(e); } } }