public static String getEncodeUrl(String url, Map<String, String> params) { return new AVRequestParams(params).getWholeUrl(url); }
public static String getEncodeUrl(String url, Map<String, String> params) { return new AVRequestParams(params).getWholeUrl(url); }
static void getStatusCountImpl(final String endPoint, Map<String, String> map, final CountCallback callback) { PaasClient.storageInstance().getObject(endPoint, new AVRequestParams(map), false, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { int count = processStatusCount(content); if (callback != null) { callback.internalDone(count, null); } } @Override public void onFailure(Throwable error, String content) { if (callback != null) { callback.internalDone(0, AVErrorUtils.createException(error, content)); } } }); }
static void getStatusCountImpl(final String endPoint, Map<String, String> map, final CountCallback callback) { PaasClient.storageInstance().getObject(endPoint, new AVRequestParams(map), false, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { int count = processStatusCount(content); if (callback != null) { callback.internalDone(count, null); } } @Override public void onFailure(Throwable error, String content) { if (callback != null) { callback.internalDone(0, AVErrorUtils.createException(error, content)); } } }); }
static void getStatusImpl(final String endPoint, Map<String, String> map, final StatusListCallback callback) { AVRequestParams params = null; if (map != null) { params = new AVRequestParams(map); } PaasClient.storageInstance().getObject(endPoint, params, false, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { List<AVStatus> result = processStatusResultList(content); if (callback != null) { callback.internalDone(result, null); } } @Override public void onFailure(Throwable error, String content) { if (callback != null) { callback.internalDone(null, AVErrorUtils.createException(error, content)); } } }); }
static void getStatusImpl(final String endPoint, Map<String, String> map, final StatusListCallback callback) { AVRequestParams params = null; if (map != null) { params = new AVRequestParams(map); } PaasClient.storageInstance().getObject(endPoint, params, false, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { List<AVStatus> result = processStatusResultList(content); if (callback != null) { callback.internalDone(result, null); } } @Override public void onFailure(Throwable error, String content) { if (callback != null) { callback.internalDone(null, AVErrorUtils.createException(error, content)); } } }); }
private void refreshInBackground(boolean sync, String includeKeys, RefreshCallback<AVObject> callback) { Map<String, String> params = new HashMap<String, String>(); if (!AVUtils.isBlankString(includeKeys)) { params.put("include", includeKeys); } PaasClient.storageInstance().getObject(AVPowerfulUtils.getEndpoint(this), new AVRequestParams(params), sync, headerMap(), new FetchObjectCallback(callback)); }
private void refreshInBackground(boolean sync, String includeKeys, RefreshCallback<AVObject> callback) { Map<String, String> params = new HashMap<String, String>(); if (!AVUtils.isBlankString(includeKeys)) { params.put("include", includeKeys); } getPaasClientInstance().getObject(AVPowerfulUtils.getEndpoint(this), new AVRequestParams(params), sync, headerMap(), new FetchObjectCallback(callback)); }
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); }
Map<String, String> queryParams = queryConditions.getParameters(); queryParams.put("client_id", this.clientId); AVRequestParams params = new AVRequestParams(queryParams);
private static AVRequestParams getOptionParams(AVCaptchaOption option) { AVRequestParams params = new AVRequestParams(); if (null != option) { if (option.getHeight() > 0) { params.put("height", option.getHeight()); } if (option.getWidth() > 0) { params.put("width", option.getWidth()); } } return params; } }
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())); } }
private void fetchInBackground(boolean sync, String includeKeys, GetCallback<AVObject> callback) { if (AVUtils.isBlankString(getObjectId())) { if (callback != null) { AVException exception = AVErrorUtils.createException(AVErrorUtils.MISSING_OBJECTID, "Missing objectId"); callback.internalDone(null, exception); } return; } final Map<String, String> params = new HashMap<String, String>(); if (!AVUtils.isBlankString(includeKeys)) { params.put("include", includeKeys); } getPaasClientInstance().getObject(AVPowerfulUtils.getEndpoint(this), new AVRequestParams(params), sync, headerMap(), new FetchObjectCallback(callback)); }
private void fetchInBackground(boolean sync, String includeKeys, GetCallback<AVObject> callback) { if (AVUtils.isBlankString(getObjectId())) { if (callback != null) { AVException exception = AVErrorUtils.createException(AVErrorUtils.MISSING_OBJECTID, "Missing objectId"); callback.internalDone(null, exception); } return; } final Map<String, String> params = new HashMap<String, String>(); if (!AVUtils.isBlankString(includeKeys)) { params.put("include", includeKeys); } PaasClient.storageInstance().getObject(AVPowerfulUtils.getEndpoint(this), new AVRequestParams(params), sync, headerMap(), new FetchObjectCallback(callback)); }
AVRequestParams params = new AVRequestParams(); params.put("session_token", sessionToken);
final List<T> result = new ArrayList<T>(); queryPath = PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), true, null, new GenericObjectCallback() { @Override
/** * Whether the AVUser has been authenticated on this device. * @param callback */ public void isAuthenticated(final AVCallback<Boolean> callback) { if (null == callback) { return; } if (AVUtils.isBlankContent(sessionToken)) { callback.internalDone(false, null); return; } AVRequestParams params = new AVRequestParams(); params.put("session_token", sessionToken); PaasClient.storageInstance().getObject("users/me", params, false, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { callback.internalDone(true, e); } @Override public void onFailure(Throwable error, String content) { if (callback != null) { callback.internalDone(null, AVErrorUtils.createException(error, content)); } } }); }
public static void getStatusWithIdInBackgroud(String statusId, final StatusCallback callback) { if (!checkStatusId(statusId, callback)) { return; } if (!checkCurrentUser(callback)) { return; } String userId = AVUser.getCurrentUser().getObjectId(); String endPoint = String.format("statuses/%s", statusId); Map<String, String> map = statusQueryMap(userId, 0, 0, 0, null, null, true, false); AVRequestParams params = new AVRequestParams(map); PaasClient.storageInstance().getObject(endPoint, params, false, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { AVStatus status = new AVStatus(); processStatus(content, status); if (callback != null) { callback.internalDone(status, null); } } @Override public void onFailure(Throwable error, String content) { if (callback != null) { callback.internalDone(null, AVErrorUtils.createException(error, content)); } } }); }
private static void getStatusWithIdInBackground(boolean sync, String statusId, final StatusCallback callback) { if (!checkStatusId(statusId, callback)) { return; } if (!checkCurrentUser(callback)) { return; } String userId = AVUser.getCurrentUser().getObjectId(); String endPoint = String.format("statuses/%s", statusId); Map<String, String> map = statusQueryMap(userId, 0, 0, 0, null, null, true, false); AVRequestParams params = new AVRequestParams(map); PaasClient.storageInstance().getObject(endPoint, params, sync, null, new GenericObjectCallback() { @Override public void onSuccess(String content, AVException e) { AVStatus status = new AVStatus(); processStatus(content, status); if (callback != null) { callback.internalDone(status, null); } } @Override public void onFailure(Throwable error, String content) { if (callback != null) { callback.internalDone(null, AVErrorUtils.createException(error, content)); } } }); }