Package cn.leancloud

Class LCCloud

java.lang.Object
cn.leancloud.LCCloud

public class LCCloud extends Object
  • Method Details

    • setProductionMode

      public static void setProductionMode(boolean productionMode)
      设置调用云代码函数的测试环境或者生产环境,默认为true,也就是生产环境。
      Parameters:
      productionMode - flag to production mode.
    • isProductionMode

      public static boolean isProductionMode()
      Whether current mode is production or not.
      Returns:
      flag to production mode.
    • callFunctionInBackground

      public static <T> io.reactivex.Observable<T> callFunctionInBackground(String name, Map<String,Object> params)
      Call Cloud Function in Background.
      Type Parameters:
      T - template type.
      Parameters:
      name - function name.
      params - invoke parameters.
      Returns:
      observable instance.
    • callFunctionInBackground

      public static <T> io.reactivex.Observable<T> callFunctionInBackground(LCUser asAuthenticatedUser, String name, Map<String,Object> params)
      Call Cloud Function in Background.
      Type Parameters:
      T - template type.
      Parameters:
      asAuthenticatedUser - explicit user for request authentication.
      name - function name.
      params - invoke parameters.
      Returns:
      observable instance. in general, this method should be invoked in lean engine.
    • callFunctionWithCacheInBackground

      public static <T> io.reactivex.Observable<T> callFunctionWithCacheInBackground(String name, Map<String,Object> params, LCQuery.CachePolicy cachePolicy, long maxCacheAge, Class<T> clazz)
      call cloud funtion with cache policy.
      Type Parameters:
      T - template type of result.
      Parameters:
      name - function name.
      params - parameters.
      cachePolicy - cache policy same as AVQuery.
      maxCacheAge - max age in milliseconds.
      clazz - clazz
      Returns:
      observable instance.
    • callFunctionWithCacheInBackground

      public static <T> io.reactivex.Observable<T> callFunctionWithCacheInBackground(LCUser asAuthenticatedUser, String name, Map<String,Object> params, LCQuery.CachePolicy cachePolicy, long maxCacheAge, Class<T> clazz)
      call cloud funtion with cache policy.
      Type Parameters:
      T - template type of result.
      Parameters:
      asAuthenticatedUser - explicit user for request authentication.
      name - function name.
      params - parameters.
      cachePolicy - cache policy same as AVQuery.
      maxCacheAge - max age in milliseconds.
      clazz - clazz
      Returns:
      observable instance. in general, this method should be invoked in lean engine.
    • callRPCInBackground

      public static <T> io.reactivex.Observable<T> callRPCInBackground(String name, Object params)
      Call Cloud RPC Function in Background.
      Type Parameters:
      T - template type.
      Parameters:
      name - function name.
      params - invoke parameters.
      Returns:
      observable instance.
    • callRPCInBackground

      public static <T> io.reactivex.Observable<T> callRPCInBackground(LCUser asAuthenticatedUser, String name, Object params)
      Call Cloud RPC Function in Background.
      Type Parameters:
      T - template type.
      Parameters:
      asAuthenticatedUser - explicit user for request authentication.
      name - function name.
      params - invoke parameters.
      Returns:
      observable instance. in general, this method should be invoked in lean engine.
    • callRPCWithCacheInBackground

      public static <T> io.reactivex.Observable<T> callRPCWithCacheInBackground(String name, Map<String,Object> params, LCQuery.CachePolicy cachePolicy, long maxCacheAge, Class<T> clazz)
      Call Cloud RPC Function with cache policy in Background.
      Type Parameters:
      T - template type.
      Parameters:
      name - function name.
      params - invoke parameters.
      cachePolicy - cache policy same as AVQuery
      maxCacheAge - max cache age in milliseconds.
      clazz - clazz
      Returns:
      observable instance.
    • callRPCWithCacheInBackground

      public static <T> io.reactivex.Observable<T> callRPCWithCacheInBackground(LCUser asAuthenticatedUser, String name, Map<String,Object> params, LCQuery.CachePolicy cachePolicy, long maxCacheAge, Class<T> clazz)
      Call Cloud RPC Function with cache policy in Background.
      Type Parameters:
      T - template type.
      Parameters:
      asAuthenticatedUser - explicit user for request authentication.
      name - function name.
      params - invoke parameters.
      cachePolicy - cache policy same as AVQuery
      maxCacheAge - max cache age in milliseconds.
      clazz - clazz
      Returns:
      observable instance. in general, this method should be invoked in lean engine.