public class AccountManager extends Object implements Plugin
| Modifier and Type | Field and Description |
|---|---|
static String |
EVENT_NAME |
static String |
ON_CLOSE_CALLBACK |
static String |
ON_OPEN_CALLBACK |
| Constructor and Description |
|---|
AccountManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
accountList(Object data,
JavascriptCallback callback)
Retrieves the map of all accounts with their public user data, see #AccountList.
|
void |
addAccount(Object data,
JavascriptCallback callback)
Adds a new account.
|
void |
appendJavascript(JavascriptAppender loader)
Must load the javascript implementation of plugin.
|
void |
changePassword(Object data,
JavascriptCallback callback)
Changes account password.
|
void |
closeAccount(Object data,
JavascriptCallback callback)
Closes a currently open account.
|
String |
getName()
Must return the name of plugin
|
void |
getPrivateAccountData(Object data,
JavascriptCallback callback)
Returns a list of all private data stored for currently open account.
|
void |
init(PluginInitializationContext context)
Can be implemented by the plugin to have access to plugins registry,
application description or to fire js events
|
void |
onDestroy()
Called when WebApplication is stopped or destroyed and this plugin is no longer used.
|
void |
onEvent(AccountManagerEvent.OnClose event) |
void |
onEvent(AccountManagerEvent.OnOpen event)
EventBus handlers
|
void |
onPageLoaded()
Called when WebApplication has finished loading and JavaScript has been injected into HybridWebView
|
void |
onReload()
Called when url has changed or has been reloaded
|
void |
openAccount(Object data,
JavascriptCallback callback)
Opens/authenticates the account and gives access to private (encrypted) data.
|
void |
removeAccount(Object data,
JavascriptCallback callback)
Removes account.
|
void |
removeField(Object data,
JavascriptCallback callback)
Removes a key with corresponding value from given scope.
|
void |
setField(Object data,
JavascriptCallback callback)
Sets the value for a key in selected custom account data scope (public, private).
|
public static String EVENT_NAME
public static String ON_OPEN_CALLBACK
public static String ON_CLOSE_CALLBACK
public String getName()
Pluginpublic void onPageLoaded()
PluginonPageLoaded in interface Pluginpublic void onReload()
Pluginpublic void onDestroy()
Pluginpublic void init(PluginInitializationContext context)
Pluginpublic void appendJavascript(JavascriptAppender loader)
PluginappendJavascript in interface Pluginloader - AssetLoader objectpublic void accountList(Object data, JavascriptCallback callback)
data - the payload mapcallback - the callbackpublic void addAccount(Object data, JavascriptCallback callback)
data - the payload map with fields:
identifier - the identifier namecallback - the callbackpublic void removeAccount(Object data, JavascriptCallback callback)
data - the payload map with fields:
identifier - the identifier name,callback - the callbackpublic void changePassword(Object data, JavascriptCallback callback)
data - the payload map with fields:
identifier - the identifier name,
oldPassword - the identifier current password
newPassword - the identifier new password to be setcallback - the callbackpublic void openAccount(Object data, JavascriptCallback callback)
data - the payload map with fields:
identifier - the identifier name,
password - the identifier passwordcallback - the callbackpublic void closeAccount(Object data, JavascriptCallback callback)
data - the payload mapcallback - the callbackpublic void getPrivateAccountData(Object data, JavascriptCallback callback)
data - the mapcallback - the callbackpublic void setField(Object data, JavascriptCallback callback)
data - the payload map with fields:
key - the field key,
value - the field value,
scope - the data scope (public/private)callback - the callbackpublic void removeField(Object data, JavascriptCallback callback)
data - the payload map with fields:
key - the field key,
scope - the data scope (public/private)callback - the callbackpublic void onEvent(AccountManagerEvent.OnOpen event)
public void onEvent(AccountManagerEvent.OnClose event)