|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.DataStore
public final class DataStore
| Field Summary | |
|---|---|
static int |
AUTO_SYNC_WAIT_FOR_CONFIRM
|
static boolean |
DEBUG_AUTO_SYNC
|
static boolean |
DEBUG_AUTO_SYNC_UID
|
static String |
DS_SCHEDULED_FOR_ACTIVATION
|
static int |
RECORD_FLAG_MASK
|
static int |
RECORD_MODIFIED
System Record flags |
| Method Summary | |
|---|---|
int |
addRecord(byte[] data)
Add a new record with flags=0, return its number |
int |
addRecord(byte[] data,
int flags)
Add a new record, return its number |
int |
addRecord(byte[] data,
int flags,
int uid)
Add a new record, return its number |
static void |
allowAutoSyncToService(boolean flag)
|
boolean |
autoSync()
|
void |
autoSyncFromServiceDone()
resolve the positive and negative UIDs |
static boolean |
autoSyncToService()
|
int |
binarySearch(Comparator inComparator,
byte[] inKey)
|
int |
binarySearch(int inUID)
|
static void |
broadcastAutoSyncDone()
|
int |
compareTo(Object o)
|
static DataStore |
createDataStore(String name)
|
static DataStore |
createDataStore(String name,
boolean autoSync)
|
static DataStore |
createSharedDataStore(String name)
Create a new shared DataStore by name. |
static DataStore |
createSharedDataStore(String name,
boolean autoSync)
|
static boolean |
dataStoresPendingActivation()
|
static void |
deleteDataStore(DataStore inDS)
|
static void |
deleteLocalDataStore(DataStore inDS)
|
static void |
deregisterListenerForAutoSyncDone(Listener inListener)
|
static void |
discardAllOnReboot()
|
boolean |
discardOnReboot()
|
void |
discardOnReboot(boolean flag)
|
void |
doneResolvingConflict()
|
static void |
dumpList()
|
static DataStore |
findDataStore(String name)
Locate a DataStore by name. |
static DataStore |
findSharedDataStore(String name)
Locate a shared DataStore by name. |
static void |
flattenStores()
Used by SimHeap to flatten the stores XXX Security Need to exclude this from the SDK link list |
static String[] |
getAllFullNames()
|
int |
getAutoSyncNextUID()
|
int |
getByteSize()
|
int |
getBytesUsed()
|
String |
getDBName()
|
String |
getFullName()
Returns the full name of the database (which will be slightly different than the name an app uses to find the database) |
int |
getLastModified()
Get the time the database was last modified. |
long |
getLastModifiedMillis()
Get the time the database was last modified. |
int |
getLastSynced()
Obtain the time the database was last synced. |
long |
getLastSyncedMillis()
Get the time the database was last synced. |
int |
getRecordCount()
Obtain the number of records in the datastore |
byte[] |
getRecordData(int n)
obtain the byte array containing the data of record #n or null if record n is out of range or empty |
byte[] |
getRecordDataByUID(int uid)
|
int |
getRecordFlags(int n)
Obtain the flags of record n or 0 if n is an invalid number |
int |
getRecordIndexByUID(int uid)
|
byte[][] |
getRecords()
obtain an array of byte arrays for all records |
int |
getRecordUID(int n)
Obtain the uid for the nth record |
int |
getVersion()
|
static Object |
initialize()
|
int |
insertRecord(byte[] data,
int index)
Insert a new record |
int |
insertRecord(byte[] data,
int index,
int flags)
Insert a new record |
int |
insertRecordSorted(Comparator inComparator,
byte[] inItem)
|
int |
insertRecordSorted(int inUID,
byte[] inItem)
|
boolean |
isRecordDirty(int n)
Check if the nth record is dirty |
static boolean |
journalReconcile(Object inKey,
String inName)
|
static void |
processBackingStoreResponse(BackingStoreTransaction bt)
|
static void |
recoverDataStores()
only used during system startup |
static void |
registerListenerForAutoSyncDone(Listener inListener)
|
void |
removeAllRecords()
Remove all records. |
void |
removeRecord(int n)
Remove record #n, causes records after that to renumber |
void |
removeRecordByUID(int uid)
|
void |
removeRecordWithoutAutoSync(int n)
|
void |
setAutoSyncNotifyee(Listener inNotifyee)
|
void |
setAutoSyncNotifyee(Listener inNotifyee,
Bundle bundle)
|
void |
setRecordData(int n,
byte[] data)
Replace the data of record #n with the provided byte array. |
void |
setRecordData(int n,
byte[] data,
boolean makeDirty)
Replace the data of record #n with the provided byte array. |
void |
setRecordDataByUID(int uid,
byte[] data)
|
void |
setRecordDataByUID(int uid,
byte[] data,
boolean makeDirty)
|
void |
setRecordDirty(int n,
boolean flag)
set nth record's dirty bit |
void |
setRecordFlags(int n,
int flags)
Replace the flags of record #n with the provided int. |
void |
setRecordFlagsByUID(int uid,
int flags)
Replace the flags of record #n with the provided int. |
void |
setRecordUID(int n,
int uid)
set the nth record's uid |
void |
setVersion(int inVersion)
|
void |
sort(Comparator comparator)
|
void |
sortByUID()
|
void |
swapRecords(int this_rec,
int that_rec)
Exchange the data and flags of this_rec with that_rec. |
void |
updateLastModified()
Set Last Modified time to current system time |
void |
updateLastSynced()
Set Last Synced time to current system time |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DS_SCHEDULED_FOR_ACTIVATION
public static final int RECORD_MODIFIED
public static final int AUTO_SYNC_WAIT_FOR_CONFIRM
public static final int RECORD_FLAG_MASK
public static final boolean DEBUG_AUTO_SYNC
public static final boolean DEBUG_AUTO_SYNC_UID
| Method Detail |
|---|
public static Object initialize()
public static boolean dataStoresPendingActivation()
public static void flattenStores()
throws IOException
IOExceptionpublic static void dumpList()
public int compareTo(Object o)
compareTo in interface Comparablepublic static void discardAllOnReboot()
public static DataStore createDataStore(String name)
public static DataStore createDataStore(String name,
boolean autoSync)
public static DataStore createSharedDataStore(String name)
public static DataStore createSharedDataStore(String name,
boolean autoSync)
public static void deleteDataStore(DataStore inDS)
public static void deleteLocalDataStore(DataStore inDS)
public static void recoverDataStores()
public static String[] getAllFullNames()
public static DataStore findDataStore(String name)
public static DataStore findSharedDataStore(String name)
public void setVersion(int inVersion)
public int getVersion()
public static boolean autoSyncToService()
public static void processBackingStoreResponse(BackingStoreTransaction bt)
public int getRecordCount()
public long getLastModifiedMillis()
public int getLastModified()
public long getLastSyncedMillis()
public int getLastSynced()
public String getFullName()
public String getDBName()
public void updateLastModified()
public void updateLastSynced()
public void discardOnReboot(boolean flag)
public boolean discardOnReboot()
public boolean autoSync()
public int getAutoSyncNextUID()
public int addRecord(byte[] data)
public int addRecord(byte[] data,
int flags)
public int addRecord(byte[] data,
int flags,
int uid)
public int insertRecord(byte[] data,
int index)
public int insertRecord(byte[] data,
int index,
int flags)
public void removeRecord(int n)
public void removeRecordWithoutAutoSync(int n)
public void removeRecordByUID(int uid)
public void removeAllRecords()
public byte[][] getRecords()
public byte[] getRecordData(int n)
public int getRecordIndexByUID(int uid)
public byte[] getRecordDataByUID(int uid)
public int getRecordFlags(int n)
public boolean isRecordDirty(int n)
public int getRecordUID(int n)
public void setRecordData(int n,
byte[] data)
public void setRecordData(int n,
byte[] data,
boolean makeDirty)
public void setRecordDataByUID(int uid,
byte[] data)
public void setRecordDataByUID(int uid,
byte[] data,
boolean makeDirty)
public void setRecordFlags(int n,
int flags)
public void setRecordFlagsByUID(int uid,
int flags)
public void setRecordDirty(int n,
boolean flag)
public void setRecordUID(int n,
int uid)
public void sort(Comparator comparator)
public void sortByUID()
public int insertRecordSorted(Comparator inComparator,
byte[] inItem)
public int insertRecordSorted(int inUID,
byte[] inItem)
public int binarySearch(int inUID)
public int binarySearch(Comparator inComparator,
byte[] inKey)
public void swapRecords(int this_rec,
int that_rec)
public void autoSyncFromServiceDone()
public void doneResolvingConflict()
public void setAutoSyncNotifyee(Listener inNotifyee)
public void setAutoSyncNotifyee(Listener inNotifyee,
Bundle bundle)
public static void allowAutoSyncToService(boolean flag)
public int getByteSize()
public int getBytesUsed()
public static void registerListenerForAutoSyncDone(Listener inListener)
public static void deregisterListenerForAutoSyncDone(Listener inListener)
public static void broadcastAutoSyncDone()
public static boolean journalReconcile(Object inKey,
String inName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||