public enum AccountManagerService extends Enum<AccountManagerService>
| Enum Constant and Description |
|---|
INSTANCE
The singleton instance of AccountManagerService
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(AccountManagerListener listener)
Registers a listener that will be called whenever an account is opened or closed.
|
String |
getCurrentAccountIdentifier()
Returns Id of currently authenticated user or null if not authenticated.
|
String |
getCurrentAccountSecretServiceKey(String fieldName)
Returns the internal key for a given service name.
|
Map<String,String> |
getPrivateAccountData()
Returns custom, private data associated with currently open account.
|
boolean |
isOpened() |
void |
removeField(String key,
boolean isPublic)
Removes a given key (with associated value) from a custom fields map defined by scope.
|
void |
removeListener(AccountManagerListener listener)
Removes the listener added by addListener
|
String |
setField(String key,
String value,
boolean isPublic)
Sets given value for a given key in one of the custom fields map defined by scope.
|
static AccountManagerService |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AccountManagerService[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AccountManagerService INSTANCE
public static AccountManagerService[] values()
for (AccountManagerService c : AccountManagerService.values()) System.out.println(c);
public static AccountManagerService valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getCurrentAccountIdentifier()
public Map<String,String> getPrivateAccountData() throws AccountManagerException
AccountManagerExceptionpublic String setField(String key, String value, boolean isPublic) throws AccountManagerException
key - A string key under which value is persisted.value - Custom value to be set. Must be serializable to JSON string.isPublic - Flag determining whether field should be public or notAccountManagerExceptionpublic void removeField(String key, boolean isPublic) throws AccountManagerException
key - A string key to be removed.isPublic - Flag determining whether field is public or notAccountManagerExceptionpublic boolean isOpened()
public String getCurrentAccountSecretServiceKey(String fieldName) throws AccountManagerException
fieldName - Name of field.AccountManagerExceptionpublic void addListener(AccountManagerListener listener)
listener - Listener objectpublic void removeListener(AccountManagerListener listener)
listener - Listener object