public class Realtime extends Object implements Exportable
| 构造器和说明 |
|---|
Realtime() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
authorize(String userId,
String token) |
static String |
getToken()
Returns an OAuth access token.
|
static void |
load(String docId,
DocumentLoadedHandler onLoaded,
ModelInitializerHandler opt_initializer,
ErrorHandler opt_error)
Loads the realtime data model associated with
docId. |
static void |
setServerAddress(String serverAddress) |
public static String getToken()
public static void load(String docId, DocumentLoadedHandler onLoaded, ModelInitializerHandler opt_initializer, ErrorHandler opt_error)
docId. If no realtime data model is
associated with docId, a new realtime document will be created and
opt_initializer will be called (if it is provided).docId - The ID of the document to load.onLoaded - A callback that will be called when the realtime document is ready. The created
or opened realtime document object will be passed to this function.opt_initializer - An optional initialization function that will be called before
onLoaded only the first time that the document is loaded. The document's
Model object will be passed to this function.opt_error - An optional error handling function that will be called if an error occurs
while the document is being loaded or edited. A Error
object describing the error will be passed to this function.public static void setServerAddress(String serverAddress)
Copyright © 2013. All Rights Reserved.