The Conduit Handler class.
This class provides high-level access to Palm data structures for
synchronization logic classes conforming to the jConduit specification.
Note that this class cannot be constructed outside its parent package.
jConduits are passed an active instance of the ConduitHandler at sync time.
addSyncLogEntry
public void addSyncLogEntry(String text)
Adds an entry to the Palm's synchronization log.
Note that this data is not written to the Palm until the end of the
synchronization process. An end-of-line will automatically be appended
to each text object before writing.
text - the text string to write to the Palm's sync log.
cleanupDatabase
public void cleanupDatabase(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionCleans-up the specified database.
Calls to this method causes the Palm to discard any records flagged
for deletion in the specified database.
This should be called at the end of a database synchronization
in order to free up memory on the Palm.
dbID - the handle of an open database to be cleaned up.
closeDatabase
public void closeDatabase(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionCloses a specified database.
This method will immediately close the speficied open database.
dbID - the handle of the open database to be closed.
createDatabase
public byte createDatabase(String creator,
String type,
String dbName,
char flags,
char version)
throws ConduitHandlerException,
NotConnectedExceptionCreates a new database with the specified parameters.
The newly created database will automatically be open. The returned byte will contain the database handle
for use with subsequent read and write requests (don't forget to close the database when you're finished with it,
otherwise you risk causing a "too many databases open" error during subsequent attempts to open databases).
creator - the 4 character creator ID for the database being created (if more than 4 characters are present, only the first four will be used).type - the 4 character database type identifier for the database being created (if more than 4 characters are present, only the first four will be used).dbName - the name of the database to create.flags - the database creation flags.version - the version number for the database being created.
- the database handle for the newly created database.
createVFSDirectory
public void createVFSDirectory(VolumeReference volRef,
String pathname)
throws ConduitHandlerException,
NotConnectedExceptionCreates the specified directory on the specified VFS volume.
volRef - the volume reference number of the volume to create the directory onto.pathname - a String containing the directory's path.
createVFSFile
public void createVFSFile(VolumeReference volRef,
String filename)
throws ConduitHandlerException,
NotConnectedExceptionCreates a file on the specified VFS volume.
volRef - the volume reference number of the volume to query.filename - a String containing the files path and filename.
deleteDatabase
public void deleteDatabase(String dbName)
throws ConduitHandlerException,
NotConnectedExceptionDeletes the specified database.
This method deletes the specified database from the remote Palm device.
Note that without a host-side backup, these deletions are permenent.
The database to be deleted should not be open when specified for deletion,
otherwise an error will occur.
dbName - the name of the database to delete.
deleteRecord
public void deleteRecord(byte dbID,
byte flags,
int recordID)
throws ConduitHandlerException,
NotConnectedExceptionDeletes a record from the remote Palm.
dbID - the handle to the database containing the record to be deleted.flags - the record deletion flags.recordID - the ID number of the record to be deleted. If you are deleting a complete category (@see DLPRecord#DELETE_ALL_IN_CATEGORY), give the category ID here.
deleteResource
public void deleteResource(byte dbID,
byte flags,
int type,
char resourceID)
throws ConduitHandlerException,
NotConnectedExceptionDeletes the specified resource from the specified Palm database.
dbID - the handle of the open database to delete the specified resource from.flags - the resource flags to use during the deletion.type - the resource type information.resourceID - the ID number of the resource to delete.
deleteVFSFile
public void deleteVFSFile(VolumeReference volRef,
String filename)
throws ConduitHandlerException,
NotConnectedExceptionDeletes the specified file from a VFS filesystem.
volRef - the volume reference number of the volume to delete from.filename - a String containing the files path and filename.
exportDatabaseToVFSFile
public void exportDatabaseToVFSFile(VolumeReference volRef,
char cardNum,
int dbID,
String filename)
throws ConduitHandlerException,
NotConnectedExceptionExports a handheld database to a file on a VFS filesystem.
Calling this method will take a handheld database, and will then save it to a VFS filesystem
as a PRC or PDB file.
volRef - the volume reference number of the volume to query.cardNum - the card number the database resides on.dbID - the databases ID number.filename - a String containing the files path and filename.
findDatabaseByCreator
public DLPFindDBResponse findDatabaseByCreator(byte flags,
byte searchFlags,
String type,
String creator)
throws ConduitHandlerException,
NotConnectedExceptionFinds a database based on its creator information.
flags - the search flags to use.searchFlags - the search flags to use.type - the type information for the database to find.creator - the creator ID of the database to find.
- the handhelds search results object.
findDatabaseByCreator
public DLPFindDBResponse findDatabaseByCreator(byte flags,
byte searchFlags,
int type,
int creator)
throws ConduitHandlerException,
NotConnectedExceptionFinds a database based on its creator information.
flags - the search flags to use.searchFlags - the search flags to use.type - the type information for the database to find.creator - the creator ID of the database to find.
- the handhelds search results object.
findDatabaseByName
public DLPFindDBResponse findDatabaseByName(byte flags,
byte cardNumber,
String dbName)
throws ConduitHandlerException,
NotConnectedExceptionFinds the specified database by name.
Note that you should generally pass in at least the flag DLPFindDBResponse.GET_ATTRIBUTES_FLAG
in order to get information on the database. Otherwise you'lll get null if the database
exists, and a ConduitHandlerException with a DLP_Packet.ERR_NOT_FOUND code if it isn't.
flags - the search flags to use.cardNumber - the card number to search on.dbName - the name of the database to find.
- the handhelds search results object.
findDatabaseByOpenHandle
public DLPFindDBResponse findDatabaseByOpenHandle(byte flags,
byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionFinds information on a database using its open database handle.
flags - the search flags to use.dbID - the open database handle to query.
- the handhelds search results object.
getApplicationBlock
public DLPBlock getApplicationBlock(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionRetrieves the application block for the specified database.
dbID - the handle of the open database from which to retrieve the Application Block.
getDatabaseInfo
public DLPDatabaseInfo getDatabaseInfo(String dbName)
throws ConduitHandlerExceptionRetrieves the Database Info object for a specified database.
Note that the jSyncManager collects this information at the beginning
of the synchronization, thus this information may not be available for
databases created since this time, and may be incorrect for databases
created since this time.
dbName - the name of the database the retrieve information on.
- the DLPDatabaseInfo object for the requested database.
getDatabaseInfoList
public Vector getDatabaseInfoList()
Retrieves a Vector containing the DLPDatabaseInfo objects for
every database on the remote Palm.
Note that this information is obtained at the beginning of
synchronization, and thus may be out-of-date when read by a jConduit.
- a Vector of DLPDatabaseInfo objects.
getDeviceSerialNumber
public String getDeviceSerialNumber()
throws ConduitHandlerException,
NotConnectedExceptionRetreives the handhelds serial number.
This method uses RPC to read the serial number of the handheld device.
Note that this function may not work on all handheld devices.
- a String containing the serial number information.
getExpansionSlotEnumeration
public SlotReference[] getExpansionSlotEnumeration()
throws ConduitHandlerException,
NotConnectedExceptionRetrieves a list of the slot reference IDs present on this device.
To query the number of slots, use returnedValue.length.
- a list of the slot reference IDs present on this device.
getFrameHandle
public Frame getFrameHandle()
Returns a handle to the main jSyncManager frame.
This method is suitable for grabbing the jSyncManager as a Frame
object for passing into a Dialog constructor for jConduits requiring GUI
display.
This method returns null if the Frame parent has not been set.
- the Frame handle to the jSyncManager object.
getOpenDatabaseInfo
public int getOpenDatabaseInfo(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionReturns the number of resources or records in a currently open database.
dbID - the handle of the open database to query.
getProperty
public Object getProperty(Object key)
Gets a named property from the ConduitHandler.
The ConduitHandler is constructed at the beginning of sync time,
and is iteritively passed to each installed and active jConduit.
Multiple jConduits which form a grouping may do simple inter-conduit
communications by leaving a message with the ConduitHandler with
a specified key, which can be later retrieved via this method by
a subsequent jConduit. All such keys and values are destroyed at the
end of synchronization - jConduits which require persistent storage
should use their own object variables (note that all jConduit object
variables are serialized persistently across jSyncManager invocations
unless they are marked as being transient).
key - the key value to retrieve from the property hash.
- an Object corresponding to the associated key, or null
if the specified key is not found.
getSortBlock
public DLPBlock getSortBlock(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionRetrieves the Sort Block from the specified database, if one exists.
dbID - the handle of the open database from which to retrieve the sort block, if one exists.
getStorageInfo
public DLPStorageInfo getStorageInfo(byte card)
throws ConduitHandlerException,
NotConnectedExceptionGets the current storage info for the specified memory card.
Unlike getStorageInfo(), this method queries and returns the information
directly from the Palm at the time of the call, and can thus be considered to be
current and correct.
card - the card number to query (currently, this should always be set to 0).
- the DLPStorageInfo object for the specified memory card.
getSystemInfo
public DLPSystemInfo getSystemInfo()
Retrieves the Palm's system information object.
Note that this information is obtained at the beginning of
synchronization, however, this information does not change during the
course of the synchronization, and thus is considered accurate.
- the DLPSystemInfo containing the Palm's system information.
getUserInfo
public DLPUserInfo getUserInfo()
Retrieves the user information from the Palm.
Note that this information is obtained at the beginning of
synchronization, however, this information does not change during the
course of the synchronization, and thus is considered accurate.
- a DLPUserInfo object containing the current Palm users information.
getVFSDefaultDirectory
public String getVFSDefaultDirectory(VolumeReference volRef,
String fileType)
throws ConduitHandlerException,
NotConnectedExceptionRetrieves the VFS Default Directory.
volRef - the volume reference number of the volume to query.fileType - a String containing the file type information.
- the default directory for the specified volume and filetype.
getVFSFileDate
public Calendar getVFSFileDate(FileReference file,
char dateType)
throws ConduitHandlerException,
NotConnectedExceptionRetrieves a file date for the specified file.
This method can return three possible file dates: the creation date, modified date, and last accessed date.
To specify which to return, use one of the VFS date constants in the DLP_Date class.
file - the file reference of the file to query.dateType - the date type to return.
- a Calendar object containing the requested date data.
getVersion
public static final double getVersion()
Returns the version number for this ConduitHandler class.
The version number should be queried by jConduit which require
methods and features not found in previous versions of the ConduitHandler
in order to verify that they will be available.
- the ConduitHandler version, as a double.
hasDatabase
public boolean hasDatabase(String dbName)
throws NotConnectedExceptionChecks to see if the Palm has the specified database.
This information is based on the database information on the Palm as
of the start of synchronization.
dbName - the name of the database to check for existance.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
importDatabaseFromVFSFile
public ImportDBFromVFSFileResponse importDatabaseFromVFSFile(VolumeReference volRef,
String filename)
throws ConduitHandlerException,
NotConnectedExceptionImports a handheld database from a file on a VFS filesystem.
Calling this method will take a PRC or PDB file on a VFS volume, and will install it as a
handheld database.
volRef - the volume reference number of the volume to query.filename - a String containing the files path and filename.
isExpansionCardPresent
public boolean isExpansionCardPresent(SlotReference slotRef)
throws ConduitHandlerException,
NotConnectedExceptionTests to see wether a card is present in the specified expansion slot.
slotRef - the expansion slot reference to test.
- true if a card is present, false otherwise.
isModemSync
public boolean isModemSync()
This method is used to determine wether this is a modem or cradle synchronization.
This method is useful for jConduits which have different operations based on
wether the synchronization type is via a local dock, or via a remote modem dialup.
- true if this is a modem synchronization, false otherwise.
isPopupAllowed
public boolean isPopupAllowed()
Used to query wether the jSyncManager has been set to supress popups or not.
jConduits which present a GUI interface should honour this user setting
by suppressing popups when this method returns false. This is
important for embedded application use, and for modem and network
synchronization where the Palm and user may not be present at the
synchronization host to dismiss dialogs.
- boolean true if it's okay to display popups, false otherwise.
isVFSFileAtEOF
public boolean isVFSFileAtEOF(FileReference file)
throws ConduitHandlerException,
NotConnectedExceptionDetermines wether or not the given file reference's pointer is at the End Of File (EOF).
file - the file reference of the file to query.
- true if we're at the end-of-file, false otherwise.
makeVFSCustomControlRequest
public char[] makeVFSCustomControlRequest(int fsCreator,
int apiCreator,
char apiSelector,
char[] buffer)
throws ConduitHandlerException,
NotConnectedExceptionVFS File custom control method.
Calls to this method will make the corresponding custom control calls to the handhelds
VFS Manager filesystem API.
fsCreator - the fsCreator value.apiCreator - the apiCreator value.apiSelector - the API Selectorbuffer - the data to transmit with this request.
- an array of char containing the returned data.
moveCategory
public void moveCategory(byte dbID,
byte to,
byte from)
throws ConduitHandlerException,
NotConnectedExceptionMoves a category from one ID to another for the specified database.
dbID - the handle of the open database in which to move the categories.to - the category ID to move the records to.from - the category ID to move the records from.
openConduit
public void openConduit()
throws ConduitHandlerException,
NotConnectedExceptionInforms the remote Palm that a new jConduit is being opened.
Calls to this method update the Palm's display during the HotSync to
show that actions are being undertaken on the host side.
Note that calling this method is not normally necessary, as the
jSyncManager always makes this call prior to calling a jConduit's
startSync(ConduitHandler) method. This method should only be used by
jConduits which internally implement multiple conduits to multiple databases.
openDatabase
public byte openDatabase(String dbName,
byte mode)
throws ConduitHandlerException,
NotConnectedExceptionOpens the specified database in the specified mode.
dbName - the name of the database to open.mode - the mode in which to open this database (see DLPDatabase for available modes).
openOrCreateDatabase
public byte openOrCreateDatabase(String creator,
String type,
String dbName,
char flags,
char version)
throws ConduitHandlerException,
NotConnectedExceptionAttempts to open the specified database, optionally creating it if it is not present.
If the database exists, it will be opened in read/write mode. Otherwise, it will be created.
creator - the 4 character creator ID for the database being created (if more than 4 characters are present, only the first four will be used).type - the 4 character database type identifier for the database being created (if more than 4 characters are present, only the first four will be used).dbName - the name of the database to create.flags - the database creation flags.version - the version number for the database being created.
- the database handle for the newly created database.
openVFSFile
public FileReference openVFSFile(VolumeReference volRef,
char openMode,
String pathString)
throws ConduitHandlerException,
NotConnectedExceptionOpens a VFS file.
volRef - the volume reference to open the file from.openMode - the open mode flags for the file.pathString - the path and filename of the file to open.
- the file reference to the opened file.
postToLog
public void postToLog(String s)
Adds a text message to the jSyncManager's synchronization log.
Note that this method will not display any text in the Sync Window's
status line. If you require status info to be displayed, use setStatus(String).
s - a String to add to the jSyncManager synchronization log.
queryDLPVersion
public float queryDLPVersion()
Queries the remote Palm's DLP version number.
This method is useful for jConduit which may sync differently for different DLP versions.
Note that if this information is not available, this method will return 1.0.
- the DLP version number as a float consisting if major revision.minor revision
queryVFSFilePosition
public int queryVFSFilePosition(FileReference file)
throws ConduitHandlerException,
NotConnectedExceptionRetrieves the location of the file pointer in the specified VFS file.
file - the file reference of the file to query.
- an integer containing the value for the specified files current I/O position pointer.
readAppPreference
public DLPAppPreference readAppPreference(String creatorID,
char prefID,
char size,
byte flags)
throws ConduitHandlerException,
NotConnectedExceptionReads the specified application preference.
creatorID - the app preference creator ID.prefID - the desired preference ID.size - the size in bytes to read.flags - Valid preference flags.
- The DLPAppPreference object representing the requested app preference.
readAppPreference
public DLPAppPreference readAppPreference(byte[] creatorID,
char prefID,
char size,
byte flags)
throws ConduitHandlerException,
NotConnectedExceptionReads the specified application preference.
creatorID - the app preference creator ID.prefID - the desired preference ID.size - the size in bytes to read.flags - Valid preference flags.
- The DLPAppPreference object representing the requested app preference.
readAppPreference
public DLPAppPreference readAppPreference(int creatorID,
char prefID,
char size,
byte flags)
throws ConduitHandlerException,
NotConnectedExceptionReads the specified application preference.
creatorID - the app preference creator ID.prefID - the desired preference ID.size - the size in bytes to read.flags - Valid preference flags.
- The DLPAppPreference object representing the requested app preference.
readDatabase
public DLPDatabase readDatabase(String dbName)
throws ConduitHandlerException,
NotConnectedExceptionReads an entire database from the Palm.
This method will read an entire database from the Palm, including all records, resources, blocks and attributes.
The resulting database can be saved in serialized form, or as a PRC/PDB file, and otherwise generally manipulated.
dbName - the name of the Database to retrieve.
- a DLPDatabase object representing the desired database.
readFeature
public int readFeature(String creator,
char featureNum)
throws ConduitHandlerException,
NotConnectedExceptionReads the specified feature from the handheld.
Features are used to store short application-specific data from the handheld.
Features are stored as a 4-byte value, and are identified by a creator ID and a feature number.
creator - the 4-character creator ID, expressed as a String.featureNum - the feature number to be read.
- the requested feature value.
readFeature
public int readFeature(int creator,
char featureNum)
throws ConduitHandlerException,
NotConnectedExceptionReads the specified feature from the handheld.
Features are used to store short application-specific data from the handheld.
Features are stored as a 4-byte value, and are identified by a creator ID and a feature number.
creator - the creator ID, expressed as an integer.featureNum - the feature number to be read.
- the requested feature value.
readNextModifiedRecord
public DLPRecord readNextModifiedRecord(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionRead the next record from the specified database which has it's Modified flag set.
This method will return the next modified record. Modified records are those which have been changed since
the last synchronization.
If there are no more modified records to be read, a ConduitHandlerException will be thrown with a
DLP_Packet.ERR_NOT_FOUND result.
dbID - the ID of the database to read the next modified record from.
readNextModifiedRecordInCategory
public DLPRecord readNextModifiedRecordInCategory(byte dbID,
byte category)
throws ConduitHandlerException,
NotConnectedExceptionRead the next record from the specified database and category which has it's Modified flag set.
This method will return the next modified record in the specified category. Modified records
are those which have been changed since the last synchronization.
If there are no more modified records to be read, a ConduitHandlerException will be thrown with a
DLP_Packet.ERR_NOT_FOUND result.
dbID - the ID of the database to read the next modified record from.category - the category ID to read the record from.
readNextRecordInCategory
public DLPRecord readNextRecordInCategory(byte dbID,
byte category)
throws ConduitHandlerException,
NotConnectedExceptionRead the next record from the specified database and category.
This method will return the next record in the specified category.
If there are no more records to be read, a ConduitHandlerException will be thrown with a
DLP_Packet.ERR_NOT_FOUND result.
dbID - the ID of the database to read the next record from.category - the category ID to read the record from.
readRecordByID
public DLPRecord readRecordByID(byte dbID,
int recordID)
throws ConduitHandlerException,
NotConnectedExceptionReads the record from the specified database that has the specified record ID.
dbID - the ID of the database to read from.recordID - the ID number of the record to be read. Record ID nubmers are unique identifiers for each record.
readRecordByIndex
public DLPRecord readRecordByIndex(byte dbID,
char recordIndex)
throws ConduitHandlerException,
NotConnectedExceptionReads the record from the specified database that has the specified record index.
dbID - the ID of the database to read from.recordIndex - the index of the record to be read. This index is a 1-based ordinal denoting the record order within the database.
readRecordIDList
public int[] readRecordIDList(byte dbID,
byte flags,
char firstRecNum,
char maximumEntries)
throws ConduitHandlerException,
NotConnectedExceptionReads the ID list for the records contained within the specified database.
This method returns a list of ID numbers contained within the selected database.
dbID - the handle to the open database.flags - Set to ConduitHandler.READ_ID_LIST_SORT_FLAG to sort the returned record IDs, or 0 otherwise.firstRecNum - the first record index number to return. If out of bounds,
a ConditHandlerException will be thrown with DLP_Packet.ERR_NOT_FOUND set.maximumEntries - the maximum number of entries to return.
readResourceByID
public DLPResource readResourceByID(byte dbID,
int type,
char resourceID)
throws ConduitHandlerException,
NotConnectedExceptionReads the resource from the specified database that has the specified resource ID.
dbID - the ID of the database to read from.type - the resource type.resourceID - the ID number of the resource to be read. Resource ID numbers are unique identifiers for each resource.
readResourceByIndex
public DLPResource readResourceByIndex(byte dbID,
char resourceIndex)
throws ConduitHandlerException,
NotConnectedExceptionReads the resource from the specified database that has the specified resource index.
dbID - the ID of the database to read from.resourceIndex - the index of the resource to be read. This index is a 1-based ordinal denoting the resource order within the database.
readVFSFile
public byte[] readVFSFile(FileReference file,
int numBytes)
throws ConduitHandlerException,
NotConnectedExceptionReads the specified number of bytes from a VFS file.
file - the file reference to read from.numBytes - the number of bytes to be read.
- an array of bytes containing the read data.
readVFSFileToStream
public int readVFSFileToStream(FileReference file,
int numBytes,
OutputStream out)
throws ConduitHandlerException,
NotConnectedExceptionReads the specified number of bytes from a VFS file, and outputs it to a stream.
This method is less memory intensive than readVFSFile for large files.
file - the file reference to read from.numBytes - the number of bytes to be read.out - the OutputStream object to write the data to.
renameVFSFile
public void renameVFSFile(VolumeReference volRef,
String oldFilename,
String newFilename)
throws ConduitHandlerException,
NotConnectedExceptionRennames the specified VFS file to the newly specified name.
volRef - the volume reference number of the volume to delete from.oldFilename - a String containing the name of the file to be renamed.newFilename - a String containing the new name for the file.
resetRecordIndex
public void resetRecordIndex(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionResets the readNextModifiedRecord counters back to the beginning of the database.
Calling this method will reset where the readNextModifiedRecord methods
read records from. It resets the pointer back to the first modified record
in the specified database.
dbID - the handle to the database to reset.
resetSyncFlags
public void resetSyncFlags(byte dbID)
throws ConduitHandlerException,
NotConnectedExceptionResets all dirty flags in the specified database, and sorts the last sync time to now.
Calls to this method will reset all of the modified flags for the specified database.
The database last sync time will also be set to the time of this call.
dbID - the handle to the database to reset.
resetSystem
public void resetSystem()
throws ConduitHandlerException,
NotConnectedExceptionCauses the Palm to require a reboot after synchronization completes.
Calls to this method will cause the Palm, at the end of sync, to
tell the user that their Palm needs to be restarted, providing them
with a button to do so.
This method should only be called for OS patches and other system-level
databases that require a system restart to take effect.
seekVFSFile
public void seekVFSFile(FileReference file,
char origin,
int offset)
throws ConduitHandlerException,
NotConnectedExceptionSeeks to the specified position in the specified VFS file.
file - the file reference to seek in.origin - the location to seek from.offset - the offset to seek to (may be negative).
setDatabaseInfo
public void setDatabaseInfo(byte dbID,
char clearFlags,
char setFlags,
char dbVersion,
DLP_Date creationDate,
DLP_Date modifiedDate,
DLP_Date backupDate,
int dbTypeID,
int dbCreator,
String dbName)
throws ConduitHandlerException,
NotConnectedExceptionSets the specified information for a database.
dbID - the database ID handle of the database to modify.clearFlags - a set of flags to denote which fields should be cleared.setFlags - a set of flags to denote which flags should be set.dbVersion - the new database version.creationDate - the new creation date for the database.modifiedDate - the new modification date for the database.backupDate - the new backup date for the database.dbTypeID - the databases new type ID.dbCreator - the new creator for the database.dbName - the new name for the database.
setFrameHandle
public static void setFrameHandle(Frame f)
Sets the Frame handle to use for dialogs.
Note that jConduits should not call this method.
f - the Frame object handle.
setStatus
public void setStatus(String status)
Displays a text string in the Sync Windows status line.
Calls to this method display the specified text in the jSyncManager's
Sync Window status line, and also adds the specified text to the
jSyncManager's synchronization log. To post just to the log, please use
postToLog(String).
status - the status String to be displayed.
setVFSFileAttributes
public void setVFSFileAttributes(FileReference file,
int attributes)
throws ConduitHandlerException,
NotConnectedExceptionSets the atttributes for the specified file
file - the file reference of the file to set the attributes for.attributes - the new file attributes bitmap.
setVFSFileDate
public void setVFSFileDate(FileReference file,
char dateType,
Calendar newValue)
throws ConduitHandlerException,
NotConnectedExceptionSets the specified date for the specified file.
This method can set three possible file dates: the creation date, modified date, and last accessed date.
To specify which to set, use one of the VFS date constants in the DLP_Date class.
file - the file reference of the file to query.dateType - the date type to be set.newValue - the new value for the specified date.
setVFSVolumeLabel
public void setVFSVolumeLabel(VolumeReference volRef,
String newLabel)
throws ConduitHandlerException,
NotConnectedExceptionSets the volume label for the specified VFS Volume.
volRef - the volume reference number of the volume to query.newLabel - the new label to use on the specified volume.
startTickles
public void startTickles()
Starts the sending of tickle packets.
Tickle packets are transmitted to the Palm from the PADP protocol layer
in order to prevent timeouts during lengthy operations, and are sent
at predetermined intervals until explicitly stopped.
This method should be called by jConduit before doing any stenuous
operations, such as file IO, which may cause the Palm time out before
processing is completed. Tickle packets should be explicitly stopped
before making any other calls to this class.
stopTickles
public void stopTickles()
Stops the transmission of tickle packets.
storeProperty
public void storeProperty(Object key,
Object data)Stores a jConduit property.
writeAppPreference
public void writeAppPreference(int creatorID,
char prefID,
byte flags,
DLPAppPreference preference)
throws ConduitHandlerException,
NotConnectedExceptionWrites an application preference to the remote device.
This method allows for the writing aof application preferences to the remote device.
creatorID - the desired creator ID.prefID - the desired preference ID.flags - Set to either ConduitHandler.WRITE_APP_PREF_BACKUP to restore a backed up app preference.
Set to 0 otherwise.preference - the preference to write.
writeApplicationBlock
public void writeApplicationBlock(byte dbID,
appBlock[] )
throws ConduitHandlerException,
NotConnectedExceptionWrites an application block to the remote device.
This method will write an application block to the specified database.
dbID - the handle to an open database to write the app block to.
writeApplicationBlock
public void writeApplicationBlock(byte dbID,
DLPBlock appBlock)
throws ConduitHandlerException,
NotConnectedExceptionWrites an application block to the remote device.
This method will write an application block to the specified database.
dbID - the handle to an open database to write the app block to.appBlock - the application block (as a DLPBlock object) to write.
writeDatabase
public void writeDatabase(DLPDatabase dbName)
throws ConduitHandlerException,
NotConnectedExceptionWrite an entire database to the remote device.
Calls to this method allow for the writing of an entire DLPDatabase object to the remote device.
dbName - the DLPDatabase object to write.
writeRecord
public int writeRecord(byte dbID,
byte flags,
int recordID,
byte attributes,
byte category,
data[] )
throws ConduitHandlerException,
NotConnectedExceptionWrites a record to the remote device.
This method will write the specified record to the remote device.
dbID - the open database handle to write to.flags - the record writing flags. See DLPRecord for valid flags.recordID - the ID of the record to be written.
Set to 0 to allow the remote device to assign a suitable ID number.attributes - the record attributes. See DLPRecord for valid attributes.category - the category ID to write to.
writeRecord
public int writeRecord(byte dbID,
byte flags,
DLPRecord record)
throws ConduitHandlerException,
NotConnectedExceptionWrites a record to the remote device.
This method will write the specified record to the remote device.
dbID - the open database handle to write to.flags - the record writing flags. See DLPRecord for valid flags.record - the DLPRecord object to write.
writeResource
public void writeResource(byte dbID,
int type,
char resourceID,
data[] )
throws ConduitHandlerException,
NotConnectedExceptionWrites a resource to the remote device.
This method will write the specified resource to the remote device.
dbID - the open database handle to write to.type - the resource type buing written.resourceID - the ID of the resource to be written.
Set to 0 to allow the remote device to assign a suitable ID number.
writeResource
public void writeResource(byte dbID,
DLPResource resource)
throws ConduitHandlerException,
NotConnectedExceptionWrites a resource to the remote device.
This method will write the specified resource to the remote device.
dbID - the open database handle to write to.resource - the DLPResource object to write.
writeSortBlock
public void writeSortBlock(byte dbID,
DLPBlock sortBlock)
throws ConduitHandlerException,
NotConnectedExceptionWrites an sort block to the remote device.
This method will write an sort block to the specified database.
dbID - the handle to an open database to write the sort block to.sortBlock - the sort block (as a DLPBlock object) to write.
writeSortBlock
public void writeSortBlock(byte dbID,
sortBlock[] )
throws ConduitHandlerException,
NotConnectedExceptionWrites an sort block to the remote device.
This method will write an sort block to the specified database.
dbID - the handle to an open database to write the sort block to.
writeVFSFileFromStream
public int writeVFSFileFromStream(FileReference file,
InputStream stream)
throws ConduitHandlerException,
NotConnectedException,
IOExceptionWrite the specified data stream to a VFS file.
This method will write the supplied data stream as a series of 1KB packets.
This is convienent if you don't know the length of the data in the stream beforehand,
however it is somewhat slower due to all of the extra protocol handler packet overhead.
file - the file reference to write to.stream - the data stream to be written from.
- the response from the handheld write proccess.
writeVFSFileFromStream
public int writeVFSFileFromStream(FileReference file,
InputStream stream,
int length)
throws ConduitHandlerException,
NotConnectedExceptionWrite the specified data stream to a VFS file.
file - the file reference to write to.stream - the data stream to be written from.length - the number of bytes to be written.
- the response from the handheld write proccess.