public class WLJSONStore
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
changePassword(java.lang.String username,
java.lang.String old_password,
java.lang.String new_password)
Change the password.
|
void |
changePassword(java.lang.String username,
java.lang.String old_password,
java.lang.String new_password,
int pbkdf2Iterations)
Change the password.
|
void |
closeAll()
Locks access to all the collections until the init method is called.
|
boolean |
commitTransaction()
Commit a transaction.
|
void |
destroy()
Permanently deletes all data for all users, clears security artifacts, and removes accessors.
|
void |
destroy(java.lang.String username)
Permanently deletes all data, clears security artifacts, and removes the accessor for a specific user.
|
JSONStoreCollection |
getCollectionByName(java.lang.String collectionName)
Provides an accessor to the collection if the collection exists.
|
java.util.List |
getFileInfo()
Returns a list of objects with information about all the stores in the device.
|
static WLJSONStore |
getInstance(android.content.Context android_context)
Responsible for retrieving a WLJSONStore instance that is unique to the application's Android context object.
|
void |
openCollections(java.util.List collections)
Provides access to the collections that are inside the store, and creates them if they do not already exist.
|
void |
openCollections(java.util.List collections,
JSONStoreInitOptions initOptions)
Provides access to the collections that are inside the store, and creates them if they do not already exist.
|
boolean |
rollbackTransaction()
Roll back a transaction.
|
void |
setAnalyticsEnabled(boolean isAnalyticsEnabled)
Enable or disable the collection of analytic data for JSONStore.
|
void |
startTransaction()
Begin a new transaction.
|
public static WLJSONStore getInstance(android.content.Context android_context)
android_context
- The current Android context object that is associated with this application.public void openCollections(java.util.List collections, JSONStoreInitOptions initOptions) throws JSONStoreInvalidSchemaException, JSONStoreFileAccessException, JSONStoreMigrationException, JSONStoreCloseAllException, JSONStoreInvalidPasswordException, JSONStoreSchemaMismatchException, JSONStoreTransactionDuringInitException
collections
- An array of collection definitions (JSONStoreCollection objects) that are to be initialized (either reopened or
created).initOptions
- Specific set of options to initialize the collection with (such as security credentials).JSONStoreInvalidSchemaException
JSONStoreCollectionExistsException
JSONStoreSchemaMismatchException
JSONStoreInvalidPasswordException
JSONStoreCloseAllException
JSONStoreMigrationException
JSONStoreFileAccessException
JSONStoreTransactionDuringInitException
java.lang.Exception
public void openCollections(java.util.List collections) throws JSONStoreInvalidSchemaException, JSONStoreFileAccessException, JSONStoreMigrationException, JSONStoreCloseAllException, JSONStoreInvalidPasswordException, JSONStoreSchemaMismatchException, JSONStoreTransactionDuringInitException
collections
- An array of collection definitions (JSONStoreCollection objects) that are to be initialized (either reopened or
created).JSONStoreCollectionExistsException
JSONStoreSchemaMismatchException
JSONStoreInvalidPasswordException
JSONStoreCloseAllException
JSONStoreMigrationException
JSONStoreFileAccessException
JSONStoreInvalidSchemaException
JSONStoreTransactionDuringInitException
java.lang.Exception
public void closeAll() throws JSONStoreCloseAllException, JSONStoreDatabaseClosedException, JSONStoreTransactionFailureException
JSONStoreCloseAllException
- An unexpected error occurred when trying to close access to all collections.JSONStoreDatabaseClosedException
- The database is already closed, so this operation is futile.JSONStoreTransactionFailureException
public JSONStoreCollection getCollectionByName(java.lang.String collectionName)
collectionName
- The name of the initialized JSONStore collection to retrieve.public void destroy(java.lang.String username) throws JSONStoreTransactionFailureException, JSONStoreDestroyFailureException, JSONStoreDestroyFileError, JSONStoreMetadataRemovalFailure
JSONStoreDestroyFailureException
- Unexpected failure.JSONStoreTransactionFailureException
- Transaction in progress.JSONStoreDestroyFileError
- Failure to remove the file.JSONStoreMetadataRemovalFailure
- Failure to remove metadata.public void destroy() throws JSONStoreDestroyFailureException, JSONStoreTransactionFailureException
JSONStoreDestroyFailureException
- When a system failure occurs (such as lack of file permissions). The destroy has failed completely.JSONStoreTransactionFailureException
public java.util.List getFileInfo()
public void startTransaction() throws JSONStoreTransactionInProgressException, JSONStoreTransactionFailureException, JSONStoreDatabaseClosedException
JSONStoreTransactionInProgressException
- occurs if a transaction is already in progress.JSONStoreTransactionFailureException
- occurs if there was an error while starting the transaction.JSONStoreDatabaseClosedException
- occurs if the collection has not been opened.public boolean commitTransaction() throws JSONStoreNoTransactionInProgressException, JSONStoreTransactionFailureException, JSONStoreDatabaseClosedException
JSONStoreNoTransactionInProgressException
- occurs if there is no transaction that is currently in progress.JSONStoreTransactionFailureException
- occurs if there is a problem while committing the transaction.JSONStoreDatabaseClosedException
- occurs if the collection has not been opened.public boolean rollbackTransaction() throws JSONStoreNoTransactionInProgressException, JSONStoreDatabaseClosedException, JSONStoreTransactionFailureException
JSONStoreNoTransactionInProgressException
- occurs if there is no transaction that is currently in progress.JSONStoreDatabaseClosedException
- occurs if the collection has not been opened.JSONStoreTransactionFailureException
- occurs if there is a problem while rolling back the transaction.public void changePassword(java.lang.String username, java.lang.String old_password, java.lang.String new_password, int pbkdf2Iterations) throws JSONStoreDatabaseClosedException, JSONStoreChangePasswordException
username
- The user name.old_password
- The old password.new_password
- The new password.pbkdf2Iterations
- The number of iterations used by the Password-Based Key Derivation Function 2 algorithm used to secure the password.JSONStoreDatabaseClosedException
JSONStoreChangePasswordException
- if there was a problem changing the password, usually because the provided password was wrongpublic void changePassword(java.lang.String username, java.lang.String old_password, java.lang.String new_password) throws JSONStoreDatabaseClosedException, JSONStoreChangePasswordException
username
- The user name.old_password
- The old password.new_password
- The new password.JSONStoreDatabaseClosedException
JSONStoreChangePasswordException
- if there was a problem changing the password, usually because the provided password was wrongpublic void setAnalyticsEnabled(boolean isAnalyticsEnabled)
isAnalyticsEnabled
- should be true if analytic data should be collected
© Copyright IBM Corp. 2006, 2015. All Rights Reserved.