/** * Method used for response processing * * @param jsonResponse response from API * @param parsedModel model parsed from json */ private void provideResponse(final JSONObject jsonResponse, Object parsedModel) { final VKResponse response = new VKResponse(); response.request = this; response.json = jsonResponse; response.parsedModel = parsedModel; if (mLoadingOperation instanceof VKHttpOperation) { response.responseString = ((VKHttpOperation) mLoadingOperation).getResponseString(); } if (mPostRequestsQueue != null && mPostRequestsQueue.size() > 0) { for (VKRequest request : mPostRequestsQueue) { request.start(); } } if (requestListener != null) { requestListener.onComplete(response); } }
/** Repeats this request with initial parameters and blocks. Used attempts will be set to 0. */ public void repeat() { this.mAttemptsUsed = 0; this.mPreparedParameters = null; this.mLoadingOperation = null; start(); }
/** * Executes that request, and returns result to blocks * * @param listener listener for request events */ public void executeWithListener(VKRequestListener listener) { this.requestListener = listener; start(); }