Package com.google.api.client.util.store (1.45.0)

Utilities to store serializable data.

Classes

AbstractDataStore<V>

Abstract data store implementation.

AbstractDataStoreFactory

Abstract data store factory implementation.

AbstractMemoryDataStore<V>

Abstract, thread-safe, in-memory implementation of a data store factory.

DataStoreUtils

Utilities for data stores.

FileDataStoreFactory

Thread-safe file implementation of a credential store.

For security purposes, the file's permissions are set such that the file is only accessible by the file's owner.

Note: this class is not compatible with Android lower than API level 26 (Oreo). For an implementation compatible with Android < 26, please use com.google.api.client.extensions.android.util.store.FileDataStoreFactory which is provided by com.google.http-client:google-http-client-android.

MemoryDataStoreFactory

Thread-safe in-memory implementation of a data store factory.

For convenience, a default global instance is provided in #getDefaultInstance().

Interfaces

DataStore<V>

Stores and manages serializable data of a specific type, where the key is a string and the value is a Serializable object.

null keys or values are not allowed. Implementation should be thread-safe.

DataStoreFactory

Factory for a store that manages serializable data, where the key is a string and the value is a Serializable object.

Users should keep a single globally shared instance of the data store factory. Otherwise, some implementations may not share the internal copies of the data, and you'll end up with multiple data stores by the same IDs, each living in a separate implementation. Some implementations may also have some overhead, or may have caching implemented, and so multiple instances may defeat that. Finally, have multiple instances may defeat the thread-safety guarantee for some implementations.

Implementation should store the data in a persistent storage such as a database. Implementation should be thread-safe. Read the JavaDoc of the implementation for those details. See Also: MemoryDataStoreFactory, FileDataStoreFactory