|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--com.syncbuilder.storage.DatabaseBase
|
+--com.syncbuilder.storage.DeviceDatabase
A representation of an open database on the Palm device.
DeviceDatabase is based on DatabaseBase, which provides several fundamental methods which
are common to all implementations of databases (e.g createRecord() ).
Database-objects are supposed to be obtained through the methods of the Dlp
class (such as openDB(), and createDB()).
Dlp,
DatabaseBase| Fields inherited from class com.syncbuilder.storage.DatabaseBase |
_creator,
_dbimpl,
_dbmode,
_dbname |
| Constructor Summary | |
DeviceDatabase(Dlp dlp,
int handle,
Char4 creator,
java.lang.String dbname,
int dbmode,
int dbcard)
Construct a DeviceDatabase object. !!! |
|
DeviceDatabase(Dlp dlp,
int handle,
DatabaseImpl dbimpl,
int dbmode,
int dbcard)
Construct a DeviceDatabase object. !!! |
|
| Method Summary | |
void |
close()
Closes the database. |
void |
deleteAllRecords()
Delete ALL records in the database. |
void |
deleteAllResources()
Delete ALL resources. |
void |
deleteCategory(int category)
Delete all records from a specified category |
void |
deleteRecord(RecordID uid)
Delete the record with the specified UID from the database. |
void |
deleteResource(Char4 type,
int id)
|
AppBlock |
getAppBlock()
|
DBInfo |
getDBInfo()
Return meta-information about the Database Caution! |
Record |
getNextModifiedRecord()
|
Record |
getNextModifiedRecord(int category)
|
Record |
getNextRecord(int category)
|
Pref |
getPref(int id,
boolean backed_up)
Get one of the preferences which are associated with the same app as the database. |
Record |
getRecord(int index)
|
Record |
getRecord(RecordID uid)
|
int |
getRecordCount()
Return the number of records in the Database |
RecordID[] |
getRecordIDs(boolean sort,
int start,
int max)
Return the UIDs of selected records in the DB. |
Resource |
getResource(Char4 type,
int id)
|
Resource |
getResource(int index)
|
SortBlock |
getSortBlock()
|
void |
moveCategory(int from,
int to)
|
void |
moveRecord(int from,
int to)
Move a record from one position to another. |
void |
purgeRecords()
Deletes all records which are marked as archived or deleted |
void |
putRecord(Record record)
Writes a record to the database. |
void |
putResource(Resource resource)
|
void |
resetFlags()
For record databases, reset all dirty flags. |
void |
resetNext()
Resets the "next record" index to the beginning |
void |
setAppBlock(AppBlock appblock)
|
void |
setDBInfo(DBInfo dbinfo)
Associate a complete set of meta-information with the Database. Caution! |
void |
setPref(Pref pref)
Store a Pref which is associated with the same app as the database to the database. |
void |
setSortBlock(SortBlock sortblock)
|
| Methods inherited from class com.syncbuilder.storage.DatabaseBase |
createAppBlock,
createPref,
createPref,
createRecord,
createRecord,
createRecord,
createResource,
createResource,
createResource,
createSortBlock,
finalize,
getPref,
getRecordIDs,
getRecordIDs,
getRecordIDs |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public DeviceDatabase(Dlp dlp,
int handle,
Char4 creator,
java.lang.String dbname,
int dbmode,
int dbcard)
handle - a database-handle as returned by DlpImpl.openDBcreator - the creator ID of the databasedbname - the name of the databasedbmode - the mode of the database, use the Database.OPEN_XXX-flagsdbcard - the card on which the database is located.
public DeviceDatabase(Dlp dlp,
int handle,
DatabaseImpl dbimpl,
int dbmode,
int dbcard)
handle - a database-handle as returned by DlpImpl.openDBdbimpl - the DatabaseImpl to be useddbmode - the mode of the database, use the Database.OPEN_XXX-flagsdbcard - the card on which the database is located.| Method Detail |
public AppBlock getAppBlock()
throws DatabaseException
public void setAppBlock(AppBlock appblock)
throws DatabaseException
public SortBlock getSortBlock()
throws DatabaseException
public void setSortBlock(SortBlock sortblock)
throws DatabaseException
public Record getRecord(int index)
throws DatabaseException
public Record getRecord(RecordID uid)
throws DatabaseException
public Record getNextRecord(int category)
throws DatabaseException
public Record getNextModifiedRecord()
throws DatabaseException
public Record getNextModifiedRecord(int category)
throws DatabaseException
public void resetNext()
throws DatabaseException
public void putRecord(Record record)
throws DatabaseException
public void deleteRecord(RecordID uid)
throws DatabaseException
uid - the UID (not the index!) of the record
public void deleteAllRecords()
throws DatabaseException
public void deleteCategory(int category)
throws DatabaseException
category - the category
public void moveCategory(int from,
int to)
throws DatabaseException
public RecordID[] getRecordIDs(boolean sort,
int start,
int max)
throws DatabaseException
public void purgeRecords()
throws DatabaseException
public void moveRecord(int from,
int to)
throws DatabaseException
Caution: The DL protocol has no official means to accomplish this! This method therefore uses some undocumented magic (RPC), which is broken when being used with Network HotSync, and may be even more broken with future devices!!!
public Resource getResource(int index)
throws DatabaseException
public Resource getResource(Char4 type,
int id)
throws DatabaseException
public void putResource(Resource resource)
throws DatabaseException
public void deleteResource(Char4 type,
int id)
throws DatabaseException
public void deleteAllResources()
throws DatabaseException
public Pref getPref(int id,
boolean backed_up)
throws DatabaseException,
NoCreatorException
public void setPref(Pref pref)
throws DatabaseException
public void close()
throws DatabaseException
public void resetFlags()
throws DatabaseException
public int getRecordCount()
throws DatabaseException
public DBInfo getDBInfo()
throws DatabaseException
public void setDBInfo(DBInfo dbinfo)
throws DatabaseException
Caution! This requires Palm OS 3.0, or higher.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||