private void countInBackground(boolean sync, CountCallback callback) { conditions.assembleParameters(); Map<String, String> parameters = conditions.getParameters(); parameters.put("count", "1"); parameters.put("limit", "0"); final CountCallback internalCallback = callback; String path = queryPath(); queryPath = PaasClient.storageInstance().getObject(path, new AVRequestParams(parameters), sync, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { try { AVResponse resp = JSON.parseObject(content, AVResponse.class); if (internalCallback != null) { internalCallback.internalDone(resp.count, null); } } catch (Exception jsonParseException) { internalCallback.internalDone(AVErrorUtils.createException(jsonParseException, "Exception during response parse")); } } @Override public void onFailure(Throwable error, String content) { if (internalCallback != null) { internalCallback.internalDone(0, AVErrorUtils.createException(error, content)); } } }, cachePolicy, maxCacheAge); }
parameters.put("limit", "0"); final CountCallback internalCallback = callback; final String path = queryPath(); queryPath = PaasClient.storageInstance().getObject(path, new AVRequestParams(parameters), sync,
PaasClient.storageInstance().getObject(queryPath(), new AVRequestParams(parameters), sync, null, new GenericObjectCallback() { @Override
final String path = queryPath(); PaasClient.storageInstance().getObject(path, new AVRequestParams(parameters), sync, null, new GenericObjectCallback() {
private void generateQueryPath() { // This method is only used for cache and currently only storage service use cache if (AVUtils.isBlankString(queryPath)) { conditions.assembleParameters(); queryPath = PaasClient.storageInstance().buildUrl(queryPath(), new AVRequestParams(getParameters())); } }
private void generateQueryPath() { // This method is only used for cache and currently only storage service use cache if (AVUtils.isBlankString(queryPath)) { conditions.assembleParameters(); queryPath = PaasClient.storageInstance().buildUrl(queryPath(), new AVRequestParams(getParameters())); } }
String path = queryPath(); this.assembleParameters(); final List<T> result = new ArrayList<T>();
final String path = queryPath(); this.assembleParameters(); final List<T> result = new ArrayList<T>();
final FindCallback<T> internalCallback = callback; String path = queryPath(); queryPath = PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), false,
final FindCallback<T> internalCallback = callback; final String path = queryPath(); queryPath = PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), false,