protected PaasClient getPaasClientInstance() { return PaasClient.storageInstance(); }
@Override public void done(AVException e) { for (AVObject o : objects) { o.running = true; o.buildParameterForNonSavedObject(list); } PaasClient.storageInstance().postBatchSave(list, sync, false, null, genericObjectCallback, null, null); }
@Override public void done(AVException e) { for (AVObject o : objects) { o.running = true; o.buildParameterForNonSavedObject(list); } PaasClient.storageInstance().postBatchSave(list, sync, false, null, genericObjectCallback, null, null); }
public static PaasClient.AVHttpClient getDirectlyClientForUse() { return PaasClient.storageInstance().clientInstance(); }
protected Map<String, String> headerMap() { return PaasClient.storageInstance().userHeaderMap(); }
private void completeFileUpload(boolean success){ if (!AVUtils.isBlankString(token)) { try { JSONObject completeResult = new JSONObject(); completeResult.put("result",success); completeResult.put("token",this.token); PaasClient.storageInstance().postObject("fileCallback", completeResult.toJSONString(), false, new GenericObjectCallback() {}); } catch (Exception e) { // ignore } } }
private void completeFileUpload(boolean success) { if (!AVUtils.isBlankString(token)) { try { JSONObject completeResult = new JSONObject(); completeResult.put("result", success); completeResult.put("token", this.token); PaasClient.storageInstance().postObject("fileCallback", completeResult.toJSONString(), false, new GenericObjectCallback() {}); } catch (Exception e) { // ignore } } }
private void init() { objectId = ""; isDataReady = false; if (PaasClient.storageInstance().getDefaultACL() != null) { acl = new AVACL(PaasClient.storageInstance().getDefaultACL()); } running = false; }
public AVFile() { super(); if (PaasClient.storageInstance().getDefaultACL() != null) { acl = new AVACL(PaasClient.storageInstance().getDefaultACL()); } }
public AVFile() { super(); if (PaasClient.storageInstance().getDefaultACL() != null) { acl = new AVACL(PaasClient.storageInstance().getDefaultACL()); } }
/** * Constructs a new AVRole with the given name. If no default ACL has been specified, you must * provide an ACL for the role. * * @param name The name of the Role to create. */ public AVRole(String name) { super(className); this.name = name; acl = PaasClient.storageInstance().getDefaultACL(); if (acl == null) { throw new IllegalStateException( "There is no default ACL,please provide an ACL for the role with AVRole(String name, AVACL acl) constructor."); } this.put("name", name); }
/** * Logs out the currently logged in user session. This will remove the session from disk, log out * of linked services, and future calls to AVUser.getCurrentUser() will return null. */ public static void logOut() { AVUser.changeCurrentUser(null, true); PaasClient.storageInstance().setDefaultACL(null); }
/** * Logs out the currently logged in user session. This will remove the session from disk, log out * of linked services, and future calls to AVUser.getCurrentUser() will return null. */ public static void logOut() { AVUser.changeCurrentUser(null, true); PaasClient.storageInstance().setDefaultACL(null); }
/** * Constructs a new AVRole with the given name. If no default ACL has been specified, you must * provide an ACL for the role. * * @param name The name of the Role to create. */ public AVRole(String name) { super(className); this.name = name; acl = PaasClient.storageInstance().getDefaultACL(); if (acl == null) { throw new IllegalStateException( "There is no default ACL,please provide an ACL for the role with AVRole(String name, AVACL acl) constructor."); } this.put("name", name); }
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)); } } }); }
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 Map<String, Object> wrapperRequestBody(Map<String, Object> requestBody, List children, boolean compoundRequest) { requestBody.put("__children", children); if (acl != null) { requestBody.putAll(AVUtils.getParsedMap(acl.getACLMap())); } requestBody.put("__internalId", internalId()); String method = "PUT"; boolean post = (AVUtils.isBlankString(getObjectId()) || alwaysUsePost()) && !compoundRequest; if (post) { method = "POST"; } String path = AVPowerfulUtils.getBatchEndpoint(PaasClient.storageInstance().getApiVersion(), this, post); return PaasClient.storageInstance().batchItemMap(method, path, requestBody, getBatchParams()); }
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); } PaasClient.storageInstance().getObject(AVPowerfulUtils.getEndpoint(this), new AVRequestParams(params), sync, headerMap(), new FetchObjectCallback(callback)); }