Package cn.leancloud
Class LeanEngine
java.lang.Object
cn.leancloud.LeanEngine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddSessionCookie(EngineSessionCookie sessionCookie) 设置sessionCookie的实例static Stringstatic Stringstatic StringgetAppId()static Stringstatic Stringstatic EngineSessionCookiestatic Stringstatic voidinitialize(String applicationId, String clientKey, String masterKey, String hookKey) Authenticates this client as belonging to your application.protected static voidinitialize(String applicationId, String clientKey, String masterKey, String hookKey, String androidxKey) static voidinitializeWithServerUrl(String applicationId, String clientKey, String masterKey, String hookKey, String serverUrl) protected static voidinitializeWithServerUrl(String applicationId, String clientKey, String masterKey, String hookKey, String androidxKey, String serverUrl) static void请在ServletContextListener.contextInitialized中注册所有的云函数定义类static voidsetHttpsRedirectEnabled(boolean enabled) 设置是否打开 HTTPS 自动跳转static voidsetLocalEngineCallEnabled(boolean enabled) 本方法用于本地调试期间,设置为 true 后所有的云函数调用都直接调用本地而非 LeanCloud 上已经部署的项目static voidsetUseMasterKey(boolean useMasterKey) 设置在与 LeanCloud 服务器进行沟通的时候是否使用 masterKey 使用 masterKey 时, API 将拥有全部权限,不再受到权限的限制
-
Constructor Details
-
LeanEngine
public LeanEngine()
-
-
Method Details
-
initialize
public static void initialize(String applicationId, String clientKey, String masterKey, String hookKey) Authenticates this client as belonging to your application. This must be called before your application can use the AVOSCloud library. The recommended way is to put a call to LeanEngine.initialize in each of your onCreate methods.
- Parameters:
applicationId- The application id provided in the AVOSCloud dashboard.clientKey- The client key provided in the AVOSCloud dashboard.masterKey- The master key provided in the AVOSCloud dashboard.hookKey- lean engine hook key.
-
initializeWithServerUrl
-
initializeWithServerUrl
-
initialize
-
register
请在ServletContextListener.contextInitialized中注册所有的云函数定义类- Parameters:
clazz- 需要注册的云函数定义类
-
addSessionCookie
设置sessionCookie的实例- Parameters:
sessionCookie- sessionCookie
-
getSessionCookie
-
setLocalEngineCallEnabled
public static void setLocalEngineCallEnabled(boolean enabled) 本方法用于本地调试期间,设置为 true 后所有的云函数调用都直接调用本地而非 LeanCloud 上已经部署的项目- Parameters:
enabled- true 为调用本地云函数; false 为调用服务端云函数
-
setHttpsRedirectEnabled
public static void setHttpsRedirectEnabled(boolean enabled) 设置是否打开 HTTPS 自动跳转- Parameters:
enabled- true 为打开 HTTPS 自动跳转
-
hmacSha1
-
setUseMasterKey
public static void setUseMasterKey(boolean useMasterKey) 设置在与 LeanCloud 服务器进行沟通的时候是否使用 masterKey 使用 masterKey 时, API 将拥有全部权限,不再受到权限的限制- Parameters:
useMasterKey- true 为使用 masterKey 发送请求
-
getMetaData
-
getAppId
-
getAppKey
-
getMasterKey
-
getAndroidKey
-
getAppEnv
-