public class SmartStoreSDKManager
extends SalesforceSDKManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GLOBAL_SUFFIX |
Modifier | Constructor and Description |
---|---|
protected |
SmartStoreSDKManager(Context context,
java.lang.Class<? extends Activity> mainActivity,
java.lang.Class<? extends Activity> loginActivity,
java.lang.Class<? extends Activity> nativeLoginActivity)
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
cleanUp(UserAccount userAccount) |
protected java.util.Map<java.lang.String,DevActionHandler> |
getDevActions(Activity frontActivity) |
java.util.List<java.lang.String> |
getDevSupportInfos() |
KeyValueEncryptedFileStore |
getGlobalKeyValueStore(java.lang.String storeName)
Get global key value store with given name
|
java.util.List<java.lang.String> |
getGlobalKeyValueStoresPrefixList()
Returns a list of global key value store names.
|
SmartStore |
getGlobalSmartStore()
Return default database used by smart store in the global context
|
SmartStore |
getGlobalSmartStore(java.lang.String dbName)
Returns the database used by smart store in the global context.
|
java.util.List<java.lang.String> |
getGlobalStoresPrefixList()
Returns a list of global store names.
|
static SmartStoreSDKManager |
getInstance()
Returns a singleton instance of this class.
|
KeyValueEncryptedFileStore |
getKeyValueStore(java.lang.String storeName)
Get key value store with given name for current user
|
KeyValueEncryptedFileStore |
getKeyValueStore(java.lang.String storeName,
UserAccount account)
Get key value store with given name for given user
|
KeyValueEncryptedFileStore |
getKeyValueStore(java.lang.String storeName,
UserAccount account,
java.lang.String communityId)
Get key value store with given name for given user / community
|
java.util.List<java.lang.String> |
getKeyValueStoresPrefixList()
Returns a list of key value store names for current user.
|
java.util.List<java.lang.String> |
getKeyValueStoresPrefixList(UserAccount account)
Returns a list of key value store names for given user.
|
SmartStore |
getSmartStore()
Returns the database used by smart store for the current user.
|
SmartStore |
getSmartStore(java.lang.String dbNamePrefix,
UserAccount account,
java.lang.String communityId)
Returns the database used by smart store for a specified database name and
user in the specified community.
|
SmartStore |
getSmartStore(UserAccount account)
Returns the database used by smart store for a specified user.
|
SmartStore |
getSmartStore(UserAccount account,
java.lang.String communityId)
Returns the database used by smart store for a specified user in the
specified community.
|
java.util.List<java.lang.String> |
getUserStoresPrefixList()
Returns a list of store names for current user.
|
java.util.List<java.lang.String> |
getUserStoresPrefixList(UserAccount account)
Returns a list of store names for given user.
|
boolean |
hasGlobalKeyValueStore(java.lang.String storeName)
Return whether there is a global key value store with given name
|
boolean |
hasGlobalSmartStore(java.lang.String dbName)
Returns whether global smart store is enabled or not.
|
boolean |
hasKeyValueStore(java.lang.String storeName)
Return whether there is a key value store with given name for current user
|
boolean |
hasKeyValueStore(java.lang.String storeName,
UserAccount account)
Return whether there is a key value store with given name for given user
|
boolean |
hasKeyValueStore(java.lang.String storeName,
UserAccount account,
java.lang.String communityId)
Return whether there is a key value store with given name for given user / community id
|
boolean |
hasSmartStore()
Returns whether smart store is enabled for the current user or not.
|
boolean |
hasSmartStore(java.lang.String dbNamePrefix,
UserAccount account,
java.lang.String communityId)
Returns whether smart store is enabled for the specified database or not.
|
boolean |
hasSmartStore(UserAccount account)
Returns whether smart store is enabled for the specified user or not.
|
boolean |
hasSmartStore(UserAccount account,
java.lang.String communityId)
Returns whether smart store is enabled for the specified community or not.
|
static void |
initNative(Context context,
java.lang.Class<? extends Activity> mainActivity)
Initializes components required for this class
to properly function.
|
static void |
initNative(Context context,
java.lang.Class<? extends Activity> mainActivity,
java.lang.Class<? extends Activity> loginActivity)
Initializes components required for this class
to properly function.
|
static void |
initNative(Context context,
java.lang.Class<? extends Activity> mainActivity,
java.lang.Class<? extends Activity> loginActivity,
java.lang.Class<? extends Activity> nativeLoginActivity)
Initializes components required for this class
to properly function.
|
void |
removeAllGlobalKeyValueStores()
Removes all the global key value stores.
|
void |
removeAllGlobalStores()
Removes all the global stores.
|
void |
removeAllKeyValueStores()
Removes all the key value stores for current user.
|
void |
removeAllKeyValueStores(UserAccount account)
Removes all the key value stores for given user.
|
void |
removeAllUserStores()
Removes all the stores for current user.
|
void |
removeAllUserStores(UserAccount account)
Removes all the stores for current user.
|
void |
removeGlobalKeyValueStore(java.lang.String storeName)
Remove global key value store with given name
|
void |
removeGlobalSmartStore(java.lang.String dbName)
Removes the global smart store.
|
void |
removeKeyValueStore(java.lang.String storeName)
Remove key value store with given name for current user
|
void |
removeKeyValueStore(java.lang.String storeName,
UserAccount account)
Remove key value store with given name for given user
|
void |
removeKeyValueStore(java.lang.String storeName,
UserAccount account,
java.lang.String communityId)
Remove key value store with given name for given user / community id
|
void |
removeSmartStore()
Removes the default smart store for the current user.
|
void |
removeSmartStore(java.lang.String dbNamePrefix,
UserAccount account,
java.lang.String communityId)
Removes the named smart store for the specified user and community.
|
void |
removeSmartStore(UserAccount account)
Removes the default smart store for the specified user.
|
void |
removeSmartStore(UserAccount account,
java.lang.String communityId)
Removes the default smart store for the specified user and community.
|
void |
setupGlobalStoreFromDefaultConfig()
Setup global store using config found in res/raw/globalstore.json
|
void |
setupUserStoreFromDefaultConfig()
Setup user store using config found in res/raw/userstore.json
|
public static final java.lang.String GLOBAL_SUFFIX
protected SmartStoreSDKManager(Context context, java.lang.Class<? extends Activity> mainActivity, java.lang.Class<? extends Activity> loginActivity, java.lang.Class<? extends Activity> nativeLoginActivity)
context
- Application context.mainActivity
- Activity that should be launched after the login flow.loginActivity
- Login activity.nativeLoginActivity
- Native login activity.public static void initNative(Context context, java.lang.Class<? extends Activity> mainActivity)
context
- Application context.mainActivity
- Activity that should be launched after the login flow.public static void initNative(Context context, java.lang.Class<? extends Activity> mainActivity, java.lang.Class<? extends Activity> loginActivity)
context
- Application context.mainActivity
- Activity that should be launched after the login flow.loginActivity
- Login activity.public static void initNative(Context context, java.lang.Class<? extends Activity> mainActivity, java.lang.Class<? extends Activity> loginActivity, java.lang.Class<? extends Activity> nativeLoginActivity)
context
- Application context.mainActivity
- Activity that should be launched after the login flow.loginActivity
- Login activity.nativeLoginActivity
- Native login activity.public static SmartStoreSDKManager getInstance()
protected void cleanUp(UserAccount userAccount)
public SmartStore getGlobalSmartStore()
public SmartStore getGlobalSmartStore(java.lang.String dbName)
dbName
- The database name. This must be a valid file name without a
filename extension such as ".db". Pass 'null' for default.public SmartStore getSmartStore()
public SmartStore getSmartStore(UserAccount account)
account
- UserAccount instance.public SmartStore getSmartStore(UserAccount account, java.lang.String communityId)
account
- UserAccount instance.communityId
- Community ID.public SmartStore getSmartStore(java.lang.String dbNamePrefix, UserAccount account, java.lang.String communityId)
dbNamePrefix
- The database name. This must be a valid file name without a
filename extension such as ".db".account
- UserAccount instance.communityId
- Community ID.public boolean hasGlobalSmartStore(java.lang.String dbName)
dbName
- Database name. This must be a valid file name without a
filename extension such as ".db". Pass 'null' for default.public boolean hasSmartStore()
public boolean hasSmartStore(UserAccount account)
account
- UserAccount instance.public boolean hasSmartStore(UserAccount account, java.lang.String communityId)
account
- UserAccount instance.communityId
- Community ID.public boolean hasSmartStore(java.lang.String dbNamePrefix, UserAccount account, java.lang.String communityId)
dbNamePrefix
- The database name. This must be a valid file name without a
filename extension such as ".db".account
- UserAccount instance.communityId
- Community ID.public void removeGlobalSmartStore(java.lang.String dbName)
dbName
- Database name. This must be a valid file name without a
filename extension such as ".db". Pass 'null' for default.public void removeSmartStore()
public void removeSmartStore(UserAccount account)
account
- UserAccount instance.public void removeSmartStore(UserAccount account, java.lang.String communityId)
account
- UserAccount instance.communityId
- Community ID.public void removeSmartStore(java.lang.String dbNamePrefix, UserAccount account, java.lang.String communityId)
dbNamePrefix
- The database name. This must be a valid file name without a
filename extension such as ".db".account
- UserAccount instance.communityId
- Community ID.public java.util.List<java.lang.String> getGlobalStoresPrefixList()
public java.util.List<java.lang.String> getUserStoresPrefixList()
public java.util.List<java.lang.String> getUserStoresPrefixList(UserAccount account)
account
- user accountpublic void removeAllGlobalStores()
public void removeAllUserStores()
public void removeAllUserStores(UserAccount account)
account
- user accountpublic void setupGlobalStoreFromDefaultConfig()
public void setupUserStoreFromDefaultConfig()
protected java.util.Map<java.lang.String,DevActionHandler> getDevActions(Activity frontActivity)
public java.util.List<java.lang.String> getDevSupportInfos()
public KeyValueEncryptedFileStore getKeyValueStore(java.lang.String storeName)
storeName
- store namepublic KeyValueEncryptedFileStore getKeyValueStore(java.lang.String storeName, UserAccount account)
storeName
- store nameaccount
- user accountpublic KeyValueEncryptedFileStore getKeyValueStore(java.lang.String storeName, UserAccount account, java.lang.String communityId)
storeName
- store nameaccount
- user accountcommunityId
- community idpublic boolean hasKeyValueStore(java.lang.String storeName)
public boolean hasKeyValueStore(java.lang.String storeName, UserAccount account)
public boolean hasKeyValueStore(java.lang.String storeName, UserAccount account, java.lang.String communityId)
public void removeKeyValueStore(java.lang.String storeName)
public void removeKeyValueStore(java.lang.String storeName, UserAccount account)
public void removeKeyValueStore(java.lang.String storeName, UserAccount account, java.lang.String communityId)
public java.util.List<java.lang.String> getKeyValueStoresPrefixList()
public java.util.List<java.lang.String> getKeyValueStoresPrefixList(UserAccount account)
account
- user accountpublic void removeAllKeyValueStores()
public void removeAllKeyValueStores(UserAccount account)
account
- user accountpublic KeyValueEncryptedFileStore getGlobalKeyValueStore(java.lang.String storeName)
storeName
- store namepublic boolean hasGlobalKeyValueStore(java.lang.String storeName)
public void removeGlobalKeyValueStore(java.lang.String storeName)
public java.util.List<java.lang.String> getGlobalKeyValueStoresPrefixList()
public void removeAllGlobalKeyValueStores()