public void getElementsOfPage( NavigationEntity<T> navigationEntity, OnLoadingFinished<T> onLoadingFinished, OnError onError) { int offset = navigationEntity.getLoadedElementsCount(); params.put(offsetParamName, offset); List<T> result = null; try { String json; if (requestExecutor == null) { json = Network.executeGetRequest(url, params); } else { String urlCopy = Network.getUrl(url, params); json = requestExecutor.execute(urlCopy); } result = Json.readList(json, responseKey, aClass); } catch (IOException e) { if (ioExceptionListener != null) { ioExceptionListener.onIOError(e); } onError.onError(e); } if (result == null) { onLoadingFinished.onLoadingFinished(Collections.<T>emptyList(), false); } else { onLoadingFinished.onLoadingFinished(result, result.isEmpty()); } }
@Override public DeleteResult loadInBackground() { final Delete delete = (Delete) getContentRequest(); final RequestExecutor executor = getRequestExecutor(); return executor.execute(delete); }
public HttpResponse execute(HttpRequest request) throws IOException { return requestExecutor.execute(request); }