Tabnine Logo
AVErrorUtils.sessionMissingException
Code IndexAdd Tabnine to your IDE (free)

How to use
sessionMissingException
method
in
com.avos.avoscloud.AVErrorUtils

Best Java code snippets using com.avos.avoscloud.AVErrorUtils.sessionMissingException (Showing top 15 results out of 315)

origin: cn.leancloud.android/avoscloud-sdk

private static boolean checkCurrentUser(final AVCallback callback) {
 if (AVUser.getCurrentUser() == null) {
  if (callback != null) {
   callback.internalDone(null, AVErrorUtils.sessionMissingException());
  }
  return false;
 }
 return true;
}
origin: cn.leancloud/leancloud-common

private static boolean checkCurrentUser(final AVCallback callback) {
 if (AVUser.getCurrentUser() == null) {
  if (callback != null) {
   callback.internalDone(null, AVErrorUtils.sessionMissingException());
  }
  return false;
 }
 return true;
}
origin: cn.leancloud/leancloud-common

@Deprecated
public static void getInboxUnreadStatusesCountWithInboxTypeInBackgroud(long sid, long count,
  final String inboxType, final CountCallback callback) {
 if (!checkCurrentUser(null)) {
  if (callback != null) {
   callback.internalDone(0, AVErrorUtils.sessionMissingException());
  }
  return;
 }
 String userId = AVUser.getCurrentUser().getObjectId();
 Map<String, String> map = statusQueryMap(userId, sid, count, 0, inboxType, null, true, true);
 getStatusCountImpl("subscribe/statuses/count", map, callback);
}
origin: cn.leancloud.android/avoscloud-sdk

@Deprecated
public static void getInboxUnreadStatusesCountWithInboxTypeInBackgroud(long sid, long count,
  final String inboxType, final CountCallback callback) {
 if (!checkCurrentUser(null)) {
  if (callback != null) {
   callback.internalDone(0, AVErrorUtils.sessionMissingException());
  }
  return;
 }
 String userId = AVUser.getCurrentUser().getObjectId();
 Map<String, String> map = statusQueryMap(userId, sid, count, 0, inboxType, null, true, true);
 getStatusCountImpl("subscribe/statuses/count", map, callback);
}
origin: cn.leancloud.android/avoscloud-sdk

/**
 * <p>
 * 创建follower查询。创建follower查询后,您可以使用whereEqualTo("follower", userFollower)查询特定的follower。
 * 您也可以使用skip和limit支持分页操作。
 * 
 * </p>
 * 
 * @param clazz AVUser类或者其子类。
 * @since 2.3.0
 */
public <T extends AVUser> AVQuery<T> followerQuery(Class<T> clazz) throws AVException {
 if (AVUtils.isBlankString(this.getObjectId())) {
  throw AVErrorUtils.sessionMissingException();
 }
 return followerQuery(getObjectId(), clazz);
}
origin: cn.leancloud.android/avoscloud-sdk

/**
 * <p>
 * 创建followee查询。 创建followee查询后,您可以使用whereEqualTo("followee", userFollowee)查询特定的followee。
 * 您也可以使用skip和limit支持分页操作。
 * 
 * </p>
 * 
 * @param clazz AVUser类或者其子类。
 * 
 * @since 2.3.0
 */
public <T extends AVUser> AVQuery<T> followeeQuery(Class<T> clazz) throws AVException {
 if (AVUtils.isBlankString(this.getObjectId())) {
  throw AVErrorUtils.sessionMissingException();
 }
 return followeeQuery(getObjectId(), clazz);
}
origin: cn.leancloud/leancloud-common

/**
 * <p>
 * 创建follower查询。创建follower查询后,您可以使用whereEqualTo("follower", userFollower)查询特定的follower。
 * 您也可以使用skip和limit支持分页操作。
 * 
 * </p>
 * 
 * @param clazz AVUser类或者其子类。
 * @param <T> subclass of AVUser
 * @return follower查询对象
 * @since 2.3.0
 * @throws AVException 如果当前对象未保存过则会报错
 */
public <T extends AVUser> AVQuery<T> followerQuery(Class<T> clazz) throws AVException {
 if (AVUtils.isBlankString(this.getObjectId())) {
  throw AVErrorUtils.sessionMissingException();
 }
 return followerQuery(getObjectId(), clazz);
}
origin: cn.leancloud/leancloud-common

/**
 * <p>
 * 创建followee查询。 创建followee查询后,您可以使用whereEqualTo("followee", userFollowee)查询特定的followee。
 * 您也可以使用skip和limit支持分页操作。
 * 
 * </p>
 * 
 * @param clazz AVUser类或者其子类。
 * @return followee 查询
 * @param <T> AVUser的子类
 * @throws AVException 如果本对象从来没有保存过会遇到错误
 * 
 * @since 2.3.0
 */
public <T extends AVUser> AVQuery<T> followeeQuery(Class<T> clazz) throws AVException {
 if (AVUtils.isBlankString(this.getObjectId())) {
  throw AVErrorUtils.sessionMissingException();
 }
 return followeeQuery(getObjectId(), clazz);
}
origin: cn.leancloud/leancloud-common

public static void getUnreadStatusesCountInBackground(String inboxType,
  final CountCallback callback) {
 if (!checkCurrentUser(null)) {
  if (callback != null) {
   callback.internalDone(0, AVErrorUtils.sessionMissingException());
  }
  return;
 }
 String userId = AVUser.getCurrentUser().getObjectId();
 Map<String, String> map = getStatusQueryMap(userId, 0, 0, 0, inboxType, null, true, true);
 getStatusCountImpl("subscribe/statuses/count", map, callback);
}
origin: cn.leancloud.android/avoscloud-sdk

public static void getUnreadStatusesCountInBackground(String inboxType,
  final CountCallback callback) {
 if (!checkCurrentUser(null)) {
  if (callback != null) {
   callback.internalDone(0, AVErrorUtils.sessionMissingException());
  }
  return;
 }
 String userId = AVUser.getCurrentUser().getObjectId();
 Map<String, String> map = getStatusQueryMap(userId, 0, 0, 0, inboxType, null, true, true);
 getStatusCountImpl("subscribe/statuses/count", map, callback);
}
origin: cn.leancloud/leancloud-common

private void updatePasswordInBackground(String oldPassword, String newPassword,
  final UpdatePasswordCallback callback, boolean sync) {
 if (!this.isAuthenticated() || AVUtils.isBlankString(getObjectId())) {
  callback.internalDone(AVErrorUtils.sessionMissingException());
 } else {
  String relativePath = String.format("users/%s/updatePassword", this.getObjectId());
  Map<String, Object> params = new HashMap<String, Object>();
  params.put("old_password", oldPassword);
  params.put("new_password", newPassword);
  String paramsString = AVUtils.restfulServerData(params);
  PaasClient.storageInstance().putObject(relativePath, paramsString, sync, headerMap(),
    new GenericObjectCallback() {
     @Override
     public void onSuccess(String content, AVException e) {
      if (null == e && !AVUtils.isBlankString(content)) {
       sessionToken = AVUtils.getJSONValue(content, SESSION_TOKEN_KEY);
      }
      callback.internalDone(e);
     }
     @Override
     public void onFailure(Throwable error, String content) {
      callback.internalDone(AVErrorUtils.createException(error, content));
     }
    }, getObjectId(), getObjectId());
 }
}
origin: cn.leancloud.android/avoscloud-sdk

private void updatePasswordInBackground(String oldPassword, String newPassword,
  final UpdatePasswordCallback callback, boolean sync) {
 if (!this.isAuthenticated() || AVUtils.isBlankString(getObjectId())) {
  callback.internalDone(AVErrorUtils.sessionMissingException());
 } else {
  String relativePath = String.format("users/%s/updatePassword", this.getObjectId());
  Map<String, Object> params = new HashMap<String, Object>();
  params.put("old_password", oldPassword);
  params.put("new_password", newPassword);
  String paramsString = AVUtils.restfulServerData(params);
  PaasClient.storageInstance().putObject(relativePath, paramsString, sync, headerMap(),
    new GenericObjectCallback() {
     @Override
     public void onSuccess(String content, AVException e) {
      if (null == e && !TextUtils.isEmpty(content)) {
       sessionToken = AVUtils.getJSONValue(content, SESSION_TOKEN_KEY);
      }
      callback.internalDone(e);
     }
     @Override
     public void onFailure(Throwable error, String content) {
      callback.internalDone(AVErrorUtils.createException(error, content));
     }
    }, getObjectId(), getObjectId());
 }
}
origin: cn.leancloud.android/avoscloud-sdk

private static void deleteStatusWithId(boolean sync, String statusId,
  final DeleteCallback callback) {
 if (!checkCurrentUser(null)) {
  if (callback != null) {
   callback.internalDone(AVErrorUtils.sessionMissingException());
  }
  return;
 }
 if (AVUtils.isBlankString(statusId)) {
  if (callback != null) {
   callback.internalDone(AVErrorUtils.invalidObjectIdException());
  }
  return;
 }
 String endPoint = String.format("statuses/%s", statusId);
 PaasClient.storageInstance().deleteObject(endPoint, sync, new GenericObjectCallback() {
  @Override
  public void onSuccess(String content, AVException e) {
   if (callback != null) {
    callback.internalDone(null);
   }
  }
  @Override
  public void onFailure(Throwable error, String content) {
   if (callback != null) {
    callback.internalDone(AVErrorUtils.createException(error, content));
   }
  }
 }, statusId, null);
}
origin: cn.leancloud/leancloud-common

private static void deleteStatusWithId(boolean sync, String statusId,
  final DeleteCallback callback) {
 if (!checkCurrentUser(null)) {
  if (callback != null) {
   callback.internalDone(AVErrorUtils.sessionMissingException());
  }
  return;
 }
 if (AVUtils.isBlankString(statusId)) {
  if (callback != null) {
   callback.internalDone(AVErrorUtils.invalidObjectIdException());
  }
  return;
 }
 String endPoint = String.format("statuses/%s", statusId);
 PaasClient.storageInstance().deleteObject(endPoint, sync, new GenericObjectCallback() {
  @Override
  public void onSuccess(String content, AVException e) {
   if (callback != null) {
    callback.internalDone(null);
   }
  }
  @Override
  public void onFailure(Throwable error, String content) {
   if (callback != null) {
    callback.internalDone(AVErrorUtils.createException(error, content));
   }
  }
 }, statusId, null);
}
origin: cn.leancloud.android/avoscloud-sdk

if (!checkCurrentUser(null)) {
 if (callback != null) {
  callback.internalDone(AVErrorUtils.sessionMissingException());
com.avos.avoscloudAVErrorUtilssessionMissingException

Popular methods of AVErrorUtils

  • createException
  • circleException
  • errorCode
  • invalidObjectIdException
  • createExceptions

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now