Class DummyIndexedStorageUtility<T extends Persistable>

java.lang.Object
org.javarosa.core.services.storage.util.DummyIndexedStorageUtility<T>
All Implemented Interfaces:
IStorageUtility<T>, IStorageUtilityIndexed<T>

public class DummyIndexedStorageUtility<T extends Persistable>
extends Object
implements IStorageUtilityIndexed<T>
Author:
ctsims
  • Constructor Summary

    Constructors 
    Constructor Description
    DummyIndexedStorageUtility()  
  • Method Summary

    Modifier and Type Method Description
    int add​(T e)
    Add a new record to the store.
    void close()
    Close all resources associated with this StorageUtility.
    void destroy()
    Delete the storage utility itself, along with all stored records and meta-data
    boolean exists​(int id)
    Return whether a record exists in the store
    Object getAccessLock()
    Fetch the object that acts as the synchronization lock for this StorageUtility
    List<Integer> getIDsForValue​(String fieldName, Object value)
    Retrieves a List of IDs of Externalizable objects in storage for which the field specified contains the value specified.
    int getNumRecords()
    Return the number of records in the store
    T getRecordForValue​(String fieldName, Object value)
    Retrieves a Externalizable object from the storage which is reference by the unique index fieldName.
    int getRecordSize​(int id)
    Get the size of a record
    int getTotalSize()
    Return total size of device storage consumed by this StorageUtility
    boolean isEmpty()
    Return whether the store is empty
    IStorageIterator<T> iterate()
    Return an iterator to iterate through all records in this store
    T read​(int id)
    Read and return the record corresponding to 'id'.
    byte[] readBytes​(int id)
    Read and return the raw bytes for the record corresponding to 'id'.
    void registerIndex​(String filterIndex)
    Optional.
    void remove​(int id)
    Remove record with the given ID from the store.
    void remove​(Persistable p)
    Remove object from the store
    void removeAll()  
    List<Integer> removeAll​(EntityFilter ef)  
    void repack()
    Perform any clean-up/consolidation of the StorageUtility's underlying datastructures that is too expensive to do during normal usage (e.g., if all the records are scattered among 10 half-empty RMSes, repack them into 5 full RMSes)
    void repair()
    If the StorageUtility has been left in a corrupt/inconsistent state, restore it to a non-corrupt state, even if it results in data loss.
    void setReadOnly()  
    void update​(int id, T e)
    Update a record in the store.
    void write​(Persistable p)
    Write an object to the store.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait