private void waitUntilFinished(BLASTQuery query) throws InterruptedException, ExecutionException { StatusTranslator translator = new StatusTranslator(); BLASTSearchEngine service = getServiceFor(query.getVendorID()); SearchStatus current = service.pollQuery(query.getJobIdentifier()); query.setStatus(translator.translate(current)); while (current.equals(SearchStatus.RUNNING)) { current = service.pollQuery(query.getJobIdentifier()); query.setStatus(translator.translate(current)); Log.i(TAG, current.toString()); } Log.i(TAG, "BLAST search finished. Status of query is " + query.getStatus()); }