org.jSyncManager.API.Protocol

Class JHotSync


public class JHotSync
extends java.lang.Object

JHotSync class. This class provides high-level access to HotSync function calls.

Constructor Summary

JHotSync(CMP_DLP cmp_dlp)
Construct a new JHotSync object with the specified CMP_DLP object.
JHotSync(SLPTransportInterface transport)
Construct a new JHotSync object using the provided transport object.

Method Summary

void
addSyncLogEntry(String s)
Add an entry to the handhelds sync log.
void
cleanupDatabase(byte dbID)
Cleans up the specified database.
void
closeAllDatabases()
Close all open databases.
void
closeDatabase(byte dbID)
Close the specified daatabase.
void
closeVFSFile(FileReference file)
Closes the specified file reference on a VFS volume.
void
connect()
Connect the protocol stack, and start listening for a synchronization request.
byte
createDatabase(byte card, String creator, String type, String dbName, char flags, char version)
Creates a database with the specified parameters.
byte
createDatabase(byte card, int creator, int type, String dbName, char flags, char version)
Creates a database with the specified parameters.
void
createVFSDirectory(VolumeReference volRef, String pathname)
Creates the specified directory on the specified VFS volume.
void
createVFSFile(VolumeReference volRef, String filename)
Creates a file on the specified VFS volume.
void
deleteDatabase(byte card, String dbName)
Deletes the database with the specified properties.
void
deleteRecord(byte dbID, byte flags, int recordID)
Delete a record from the handheld.
void
deleteResource(byte dbID, byte flags, int type, char resourceID)
Delete the specified resource from the handheld.
void
deleteVFSFile(VolumeReference volRef, String filename)
Deletes the specified file from a VFS filesystem.
void
disconnect()
Disconnects the protocol stack from the remote end.
void
disconnect(char reasonCode)
Disconnects the protocol stack for the supplied reason code.
byte[]
doLoopbackTest(byte[] data)
Runs a loopback test with the device.
DirectoryEntryEnumeration
enumerateDirectory(FileReference file, int iterator)
Retrieves an enumeration of the entries in the specified directory.
VolumeReference[]
enumerateVFSVolumes()
Enumerates all the VFS volumes available on the system.
void
exportDatabaseToVFSFile(VolumeReference volRef, char cardNum, int dbID, String filename)
Exports a handheld database to a file on a VFS filesystem.
DLPFindDBResponse
findDatabaseByCreator(byte flags, byte searchFlags, int type, int creator)
Finds a database based on its creator information.
DLPFindDBResponse
findDatabaseByName(byte flags, byte cardNumber, String dbName)
Finds the specified database by name.
DLPFindDBResponse
findDatabaseByOpenHandle(byte flags, byte dbID)
Finds information on a database using its open database handle.
void
formatVFSVolume(char filesystemRefNum, byte flags, MountParameters mountParams)
Formats the specified VFS volume.
DLPBlock
getApplicationBlock(byte dbID, char offset, char length)
Retrieve the specified application block.
CMP_DLP
getCmpDlpHandler()
Retreives the CMP_DLP handler in use by the protocol stack.
DLPDatabaseListGroup
getDatabaseList(byte searchFlags, byte cardNumber, char startIndex)
Gets the list of information on the databases stored on the remote Palm Computing Platform device.
DLPExpansionCardInfo
getExpansionCardInfo(SlotReference slotRef)
Reads the expansion card information for the given slot ID.
int
getOpenDatabaseInfo(byte dbID)
Gets the number of records/resources in an open database.
PADP
getPADPHandler()
Gets the PADP protocol in use by the active protocol stack.
SLP
getSLPHandler()
Gets the SLP protocol in use by the active protocol stack.
SlotReference[]
getSlotEnumeration()
Retrieves a list of the slot reference numbers available on the device.
int
getSlotMediaType(SlotReference slotRef)
Retrieves the media type for the given slot identifier.
DLPBlock
getSortBlock(byte dbID, char offset, char length)
Gets the sort block for the specified database.
int
getSpeed()
Retreives the speed of the synchronization.
DLPStorageInfo
getStorageInfo(byte card)
Retreives the storage information for the specified card.
DLPSystemInfo
getSystemInfo()
Retreives the handhelds system information.
Calendar
getTime()
Retreives the date and time reported by the handheld.
DLPUserInfo
getUserInfo()
Retreives the user information for the handheld.
String
getVFSDefaultDirectory(VolumeReference volRef, String fileType)
Retrieves the VFS Default Directory.
long
getVFSFileDate(FileReference file, char dateType)
Retrieves a file date for the specified file.
int
getVFSFileSize(FileReference file)
Retrieves the size of the specified file.
VolumeInfo
getVFSVolumeInfo(VolumeReference volRef)
Retrieves the volume information for the specified volume.
String
getVFSVolumeLabel(VolumeReference volRef)
Retrieves the VFS Volume label.
VolumeSize
getVFSVolumeSize(VolumeReference volRef)
Retrieves the volume size information for the specified volume.
ImportDBFromVFSFileResponse
importDatabaseFromVFSFile(VolumeReference volRef, String filename)
Imports a handheld database from a file on a VFS filesystem.
boolean
isConnected()
Checks to see if the protocol stack is currently connected and active.
boolean
isExpansionCardPresent(SlotReference slotRef)
Tests to see whether a card is present in the specified expansion slot.
boolean
isVFSFileAtEOF(FileReference file)
Determines wether or not the given file reference's pointer is at the End Of File (EOF).
char[]
makeVFSCustomControlRequest(int fsCreator, int apiCreator, char apiSelector, char[] buffer)
VFS File custom control method.
void
moveCategory(byte dbID, byte from, byte to)
Moves the specified category from one ID to another.
void
openConduit()
Informs the handheld that a conduit is about to be opened.
byte
openDatabase(byte card, byte mode, String dbName)
Open the specified database using the specified I/O mode.
FileReference
openVFSFile(VolumeReference volRef, char openMode, String pathString)
Opens a VFS file.
byte[]
processRPC(byte[] data)
Process a Remote Procedure Call request.
RPCPacket
processRPC(RPCPacket pkt)
Process a Remote Procedure Call request.
int
queryVFSFileAttributes(FileReference file)
Retrieves the file attributes for the specified file.
int
queryVFSFilePosition(FileReference file)
Retrieves the location of the file pointer in the specified VFS file.
DLPAppPreference
readAppPreference(int creatorID, char prefID, char size, byte flags)
Reads an application preference from the handheld.
int
readFeature(int creator, char featureNum)
Reads a Feature from the handheld.
DLPNetSyncInfo
readNetSyncInfo()
Reads the network synchronization information from the handheld.
DLPRecord
readNextModifiedRecord(byte dbID)
Read the next modified record from the specified database.
DLPRecord
readNextModifiedRecordInCategory(byte dbID, byte category)
Reads the next modified record in the specified category.
DLPRecord
readNextRecordInCategory(byte dbID, byte category)
Reads the next record in the specified category.
DLPRecord
readRecord(byte dbID, char index, char offset, char length)
Read a record from the specified database.
DLPRecord
readRecord(byte dbID, int id, char offset, char length)
Read a record from the specified database.
int[]
readRecordIDList(byte dbID, byte flags, char start, char maxEntries)
Reads the list of record IDs from the specified database.
DLPResource
readResource(byte dbID, char index, char offset, char length)
Read a resource from the specified database by index.
DLPResource
readResource(byte dbID, int type, char id, char offset, char length)
Read a resource from the specified database by resource ID.
byte[]
readVFSFile(FileReference file, int numBytes)
Reads the specified number of bytes from a VFS file.
int
readVFSFileToStream(FileReference file, int numBytes, OutputStream out)
Reads the specified number of bytes from a VFS file, and outputs it to a stream.
void
renameVFSFile(VolumeReference volRef, String oldFilename, String newFilename)
Renames the specified VFS file to the newly specified name.
void
resetRecordIndex(byte dbID)
Reset the record index.
void
resetSyncFlags(byte dbID)
Reset the synchronization flags for the given database.
void
resetSystem()
Request that the handheld reset itself at the end of synchronization.
void
resizeVFSFile(FileReference file, int newSize)
Resizes the specified file to the specified new size in bytes.
void
seekVFSFile(FileReference file, char origin, int offset)
Seeks to the specified position in the specified VFS file.
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)
Sets the specified information for a database.
void
setTime(Calendar time)
Sets the date and time on the handheld.
void
setTransport(SLPTransportInterface t)
Set the transport for the protocol stack to use.
void
setUserInfo(DLPUserInfo userInfo)
Set the user information for the handheld.
void
setVFSFileAttributes(FileReference file, int attributes)
Sets the atttributes for the specified file
void
setVFSFileDate(FileReference file, char dateType, long newValue)
Sets the specified date for the specified file.
void
setVFSVolumeLabel(VolumeReference volRef, String newLabel)
Sets the volume label for the specified VFS Volume.
void
startTickles()
Start sending tickle packets.
void
stopTickles()
Stop sending tickle packets.
void
suspend()
Put the protocol stack into suspended mode.
void
writeAppPreference(int creatorID, char prefID, byte flags, DLPAppPreference preference)
Write an application preference.
void
writeApplicationBlock(byte dbID, data[] )
Write the specified application block to the specified database.
void
writeApplicationBlock(byte dbID, DLPBlock appBlock)
Write an application block to the specified database.
void
writeNetSyncInfo(DLPNetSyncInfo netSyncInfo)
Writes the network synchronization information to the handheld.
int
writeRecord(byte dbID, byte flags, int id, byte attributes, byte category, data[] )
Write a record to the specified database.
int
writeRecord(byte dbID, byte flags, DLPRecord record)
Write a record to the specified database.
void
writeResource(byte dbID, int type, char id, data[] )
Write a resource to the specified database
void
writeResource(byte dbID, DLPResource res)
Write a resource to the specified database
void
writeSortBlock(byte dbID, data[] )
Writes a sort block to the specified database.
void
writeSortBlock(byte dbID, DLPBlock sortBlock)
Writes a sort block to the specified database.
int
writeVFSFile(FileReference file, byte[] data)
Write the specified data to a VFS file.
int
writeVFSFile(FileReference file, byte[] data, int dataLen)
Write the specified data of specified length to a VFS file.
int
writeVFSFileFromStream(FileReference file, InputStream stream, int length)
Write the specified data stream to a VFS file.

Constructor Details

JHotSync

public JHotSync(CMP_DLP cmp_dlp)
Construct a new JHotSync object with the specified CMP_DLP object.
Parameters:
cmp_dlp - the CMP_DLP handler to use for I/O.

JHotSync

public JHotSync(SLPTransportInterface transport)
Construct a new JHotSync object using the provided transport object. This construct will create all of the necessary protocol objects, and connect them so they're ready for a synchronization session.
Parameters:
transport - the transport class to use for synchronization.

Method Details

addSyncLogEntry

public void addSyncLogEntry(String s)
            throws DLPFunctionCallException,
                   NotConnectedException
Add an entry to the handhelds sync log.
Parameters:
s - the data to append to the handheld's synchronization log.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

cleanupDatabase

public void cleanupDatabase(byte dbID)
            throws DLPFunctionCallException,
                   NotConnectedException
Cleans up the specified database. Calling this method calls the specified database to remove all records flagged as deleted, and to reset all modification flags.
Parameters:
dbID - the database identification handle.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

closeAllDatabases

public void closeAllDatabases()
            throws DLPFunctionCallException,
                   NotConnectedException
Close all open databases.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

closeDatabase

public void closeDatabase(byte dbID)
            throws DLPFunctionCallException,
                   NotConnectedException
Close the specified daatabase.
Parameters:
dbID - the database identification handle.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

closeVFSFile

public void closeVFSFile(FileReference file)
            throws DLPFunctionCallException,
                   NotConnectedException
Closes the specified file reference on a VFS volume.
Parameters:
file - the file reference of the file to close.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

connect

public void connect()
            throws NotConnectedException
Connect the protocol stack, and start listening for a synchronization request. Calls to this method block until a connection is established.
Throws:
NotConnectedException - if the connection is lost during processing.

createDatabase

public byte createDatabase(byte card,
                           String creator,
                           String type,
                           String dbName,
                           char flags,
                           char version)
            throws DLPFunctionCallException,
                   NotConnectedException
Creates a database with the specified parameters.
Parameters:
card - the card number to create the database on.
creator - the database creator.
type - the databases type.
dbName - the name of the database.
flags - the flags to use during database creation.
version - the database version.
Returns:
the database ID of the newly created database.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

createDatabase

public byte createDatabase(byte card,
                           int creator,
                           int type,
                           String dbName,
                           char flags,
                           char version)
            throws DLPFunctionCallException,
                   NotConnectedException
Creates a database with the specified parameters.
Parameters:
card - the card number to create the database on.
creator - the creator ID for this database.
type - the database type.
dbName - the name of the database.
flags - the flags to use in database creation.
version - the databases version.
Returns:
the database ID of the created database.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

createVFSDirectory

public void createVFSDirectory(VolumeReference volRef,
                               String pathname)
            throws DLPFunctionCallException,
                   NotConnectedException
Creates the specified directory on the specified VFS volume.
Parameters:
volRef - the volume reference number of the volume to create the directory onto.
pathname - a String containing the directory's path.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

createVFSFile

public void createVFSFile(VolumeReference volRef,
                          String filename)
            throws DLPFunctionCallException,
                   NotConnectedException
Creates a file on the specified VFS volume.
Parameters:
volRef - the volume reference number of the volume to query.
filename - a String containing the files path and filename.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

deleteDatabase

public void deleteDatabase(byte card,
                           String dbName)
            throws DLPFunctionCallException,
                   NotConnectedException
Deletes the database with the specified properties.
Parameters:
card - the card number to delete the database from.
dbName - the name of the database.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

deleteRecord

public void deleteRecord(byte dbID,
                         byte flags,
                         int recordID)
            throws DLPFunctionCallException,
                   NotConnectedException
Delete a record from the handheld.
Parameters:
dbID - the database identification handle.
flags - the record deletion flags.
recordID - the ID number for the record to delete.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

deleteResource

public void deleteResource(byte dbID,
                           byte flags,
                           int type,
                           char resourceID)
            throws DLPFunctionCallException,
                   NotConnectedException
Delete the specified resource from the handheld.
Parameters:
dbID - the database identification handle.
flags - the resource deletion flags.
type - the type information for the resource to delete.
resourceID - the resource ID to delete.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

deleteVFSFile

public void deleteVFSFile(VolumeReference volRef,
                          String filename)
            throws DLPFunctionCallException,
                   NotConnectedException
Deletes the specified file from a VFS filesystem.
Parameters:
volRef - the volume reference number of the volume to delete from.
filename - a String containing the files path and filename.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

disconnect

public void disconnect()
            throws NotConnectedException
Disconnects the protocol stack from the remote end.
Throws:
NotConnectedException - if we're not connected, or the connection is lost during processing.

disconnect

public void disconnect(char reasonCode)
            throws NotConnectedException
Disconnects the protocol stack for the supplied reason code.
Parameters:
reasonCode - the reason for the disconnect.
Throws:
NotConnectedException - if we're not connected, or the connection is lost during processing.

doLoopbackTest

public byte[] doLoopbackTest(byte[] data)
            throws DLPFunctionCallException,
                   NotConnectedException
Runs a loopback test with the device.
Parameters:
data - the data to transmit.
Returns:
the data that was received back form the handheld.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

enumerateDirectory

public DirectoryEntryEnumeration enumerateDirectory(FileReference file,
                                                    int iterator)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves an enumeration of the entries in the specified directory.
Parameters:
file - the file reference of the directory to enumerate.
iterator - the directory entry iterator (pass 0 to start the enumeration).
Returns:
the enumeration of the directory entries.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

enumerateVFSVolumes

public VolumeReference[] enumerateVFSVolumes()
            throws DLPFunctionCallException,
                   NotConnectedException
Enumerates all the VFS volumes available on the system.
Returns:
an array containing all of the available VFS volumes on the handheld device.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

exportDatabaseToVFSFile

public void exportDatabaseToVFSFile(VolumeReference volRef,
                                    char cardNum,
                                    int dbID,
                                    String filename)
            throws DLPFunctionCallException,
                   NotConnectedException
Exports 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.
Parameters:
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.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

findDatabaseByCreator

public DLPFindDBResponse findDatabaseByCreator(byte flags,
                                               byte searchFlags,
                                               int type,
                                               int creator)
            throws DLPFunctionCallException,
                   NotConnectedException
Finds a database based on its creator information.
Parameters:
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.
Returns:
the handhelds search results object.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

findDatabaseByName

public DLPFindDBResponse findDatabaseByName(byte flags,
                                            byte cardNumber,
                                            String dbName)
            throws DLPFunctionCallException,
                   NotConnectedException
Finds the specified database by name.
Parameters:
flags - the search flags to use.
cardNumber - the card number to search on.
dbName - the name of the database to find.
Returns:
the handhelds search results object.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

findDatabaseByOpenHandle

public DLPFindDBResponse findDatabaseByOpenHandle(byte flags,
                                                  byte dbID)
            throws DLPFunctionCallException,
                   NotConnectedException
Finds information on a database using its open database handle.
Parameters:
flags - the search flags to use.
dbID - the open database handle to query.
Returns:
the handhelds search results object.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

formatVFSVolume

public void formatVFSVolume(char filesystemRefNum,
                            byte flags,
                            MountParameters mountParams)
            throws DLPFunctionCallException,
                   NotConnectedException
Formats the specified VFS volume.
Parameters:
filesystemRefNum - the filesystem reference number to use to do the formatting.
flags - the filesystem-specifiec format flags.
mountParams - the filesystem-specific mounting parameters.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getApplicationBlock

public DLPBlock getApplicationBlock(byte dbID,
                                    char offset,
                                    char length)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieve the specified application block.
Parameters:
dbID - the database identification handle.
offset - the offset into the data to start reading from.
length - the number of bytes to read, or 0xFFFF to read to the end.
Returns:
the block object for the requested application block.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getCmpDlpHandler

public CMP_DLP getCmpDlpHandler()
Retreives the CMP_DLP handler in use by the protocol stack.
Returns:
the CMP_DLP handler in use by the protocol stack.

getDatabaseList

public DLPDatabaseListGroup getDatabaseList(byte searchFlags,
                                            byte cardNumber,
                                            char startIndex)
            throws DLPFunctionCallException,
                   NotConnectedException
Gets the list of information on the databases stored on the remote Palm Computing Platform device.
Parameters:
searchFlags - the search flags to use for reading the database info (ie: DLPDatabase.RAM_BASED and DLPDatabase.ROM_BASED)
cardNumber - the card number to read database information objects from.
startIndex - the start index for reading database information objects.
Returns:
the DLPDatabaseListGroup object containing the read database information objects.
Throws:
DLPFunctionCallException - thrown if there is an error in processing the request.
NotConnectedException - thrown if the connection is lost while processing this command.

getExpansionCardInfo

public DLPExpansionCardInfo getExpansionCardInfo(SlotReference slotRef)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads the expansion card information for the given slot ID.
Parameters:
slotRef - the expansion slot reference to test.
Returns:
the expansion card information for the given slot ID.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getOpenDatabaseInfo

public int getOpenDatabaseInfo(byte dbID)
            throws DLPFunctionCallException,
                   NotConnectedException
Gets the number of records/resources in an open database.
Parameters:
dbID - the database identification handle.
Returns:
the number of records or resources in the specified database.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getPADPHandler

public PADP getPADPHandler()
Gets the PADP protocol in use by the active protocol stack.
Returns:
the PADP protocol in use by the active protocol stack.

getSLPHandler

public SLP getSLPHandler()
Gets the SLP protocol in use by the active protocol stack.
Returns:
the SLP protocol in use by the active protocol stack.

getSlotEnumeration

public SlotReference[] getSlotEnumeration()
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves a list of the slot reference numbers available on the device. To discover how many slots are available on the device, query the length of the array calls to this method return.
Returns:
a list of the slot reference numbers available on the device.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getSlotMediaType

public int getSlotMediaType(SlotReference slotRef)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the media type for the given slot identifier.
Parameters:
slotRef - the slot reference to query.
Returns:
the slot reference ID.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.
See Also:
SlotReference

getSortBlock

public DLPBlock getSortBlock(byte dbID,
                             char offset,
                             char length)
            throws DLPFunctionCallException,
                   NotConnectedException
Gets the sort block for the specified database.
Parameters:
dbID - the database identification handle.
offset - the offset into the data to start reading from.
length - the number of bytes to read, or 0xFFFF to read to the end.
Returns:
the requested sort block.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getSpeed

public int getSpeed()
Retreives the speed of the synchronization. Note that this value will only be valid for serial based synchronizations.
Returns:
the speed of the serial connection.

getStorageInfo

public DLPStorageInfo getStorageInfo(byte card)
            throws DLPFunctionCallException,
                   NotConnectedException
Retreives the storage information for the specified card.
Parameters:
card - the card number to read the storage info from.
Returns:
the storage information for the specified card.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getSystemInfo

public DLPSystemInfo getSystemInfo()
            throws DLPFunctionCallException,
                   NotConnectedException
Retreives the handhelds system information.
Returns:
the handhelds system information.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getTime

public Calendar getTime()
            throws DLPFunctionCallException,
                   NotConnectedException
Retreives the date and time reported by the handheld.
Returns:
the date and time reported by the handheld.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getUserInfo

public DLPUserInfo getUserInfo()
            throws DLPFunctionCallException,
                   NotConnectedException
Retreives the user information for the handheld.
Returns:
the user information for the handheld.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getVFSDefaultDirectory

public String getVFSDefaultDirectory(VolumeReference volRef,
                                     String fileType)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the VFS Default Directory.
Parameters:
volRef - the volume reference number of the volume to query.
fileType - a String containing the file type information.
Returns:
the default directory for the specified volume and filetype.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getVFSFileDate

public long getVFSFileDate(FileReference file,
                           char dateType)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves 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 date constants in the FileReference class.
Parameters:
file - the file reference of the file to query.
dateType - the date type to return.
Returns:
a long containing the requested date.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.
See Also:
FileReference

getVFSFileSize

public int getVFSFileSize(FileReference file)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the size of the specified file.
Parameters:
file - the file reference of the file to query.
Returns:
an integer containing the requested file size.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getVFSVolumeInfo

public VolumeInfo getVFSVolumeInfo(VolumeReference volRef)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the volume information for the specified volume.
Parameters:
volRef - the volume reference to query.
Returns:
the VolumeInfo object for this volume.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getVFSVolumeLabel

public String getVFSVolumeLabel(VolumeReference volRef)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the VFS Volume label.
Parameters:
volRef - the volume reference number of the volume to query.
Returns:
the volume label for the specified VFS volume.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

getVFSVolumeSize

public VolumeSize getVFSVolumeSize(VolumeReference volRef)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the volume size information for the specified volume.
Parameters:
volRef - the volume reference to query.
Returns:
the VolumeSize object for this volume.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

importDatabaseFromVFSFile

public ImportDBFromVFSFileResponse importDatabaseFromVFSFile(VolumeReference volRef,
                                                             String filename)
            throws DLPFunctionCallException,
                   NotConnectedException
Imports 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.
Parameters:
volRef - the volume reference number of the volume to query.
filename - a String containing the files path and filename.
Returns:
the ImportDBFromVFSFileResponse object containing the operations results.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

isConnected

public boolean isConnected()
Checks to see if the protocol stack is currently connected and active.
Returns:
true if the protocol stack is connected, false otherwise.

isExpansionCardPresent

public boolean isExpansionCardPresent(SlotReference slotRef)
            throws DLPFunctionCallException,
                   NotConnectedException
Tests to see whether a card is present in the specified expansion slot.
Parameters:
slotRef - the expansion slot reference to test.
Returns:
true if a card is present, false otherwise.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

isVFSFileAtEOF

public boolean isVFSFileAtEOF(FileReference file)
            throws DLPFunctionCallException,
                   NotConnectedException
Determines wether or not the given file reference's pointer is at the End Of File (EOF).
Parameters:
file - the file reference of the file to query.
Returns:
true if we're at the end-of-file, false otherwise.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

makeVFSCustomControlRequest

public char[] makeVFSCustomControlRequest(int fsCreator,
                                          int apiCreator,
                                          char apiSelector,
                                          char[] buffer)
            throws DLPFunctionCallException,
                   NotConnectedException
VFS File custom control method. Calls to this method will make the corresponding custom control calls to the handhelds VFS Manager filesystem API.
Parameters:
fsCreator - the fsCreator value.
apiCreator - the apiCreator value.
apiSelector - the API Selector
buffer - the data to transmit with this request.
Returns:
an array of char containing the returned data.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

moveCategory

public void moveCategory(byte dbID,
                         byte from,
                         byte to)
            throws DLPFunctionCallException,
                   NotConnectedException
Moves the specified category from one ID to another.
Parameters:
dbID - the database identification handle.
from - the category ID to move from.
to - the category ID to move to.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

openConduit

public void openConduit()
            throws DLPFunctionCallException,
                   NotConnectedException
Informs the handheld that a conduit is about to be opened. Calling this function allows the handheld to update it display, and do a bit of cleanup.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

openDatabase

public byte openDatabase(byte card,
                         byte mode,
                         String dbName)
            throws DLPFunctionCallException,
                   NotConnectedException
Open the specified database using the specified I/O mode.
Parameters:
card - the card number holding the database to be opened.
mode - the I/O mode for the database.
dbName - the name of the database.
Returns:
the database ID handle for further database I/O.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

openVFSFile

public FileReference openVFSFile(VolumeReference volRef,
                                 char openMode,
                                 String pathString)
            throws DLPFunctionCallException,
                   NotConnectedException
Opens a VFS file. See the FileReference class for a set of static members that can be passed in for the openMode parameter.
Parameters:
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.
Returns:
the file reference to the opened file.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.
See Also:
FileReference

processRPC

public byte[] processRPC(byte[] data)
            throws DLPFunctionCallException,
                   NotConnectedException
Process a Remote Procedure Call request.
Parameters:
data - the RPC request to transmit.
Returns:
the result of the RPC request.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

processRPC

public RPCPacket processRPC(RPCPacket pkt)
            throws DLPFunctionCallException,
                   NotConnectedException
Process a Remote Procedure Call request.
Parameters:
pkt - the RPC Packet object to transmit.
Returns:
the result of the RPC request.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

queryVFSFileAttributes

public int queryVFSFileAttributes(FileReference file)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the file attributes for the specified file.
Parameters:
file - the file reference of the file to query.
Returns:
an integer containing the files attributes bitmap.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

queryVFSFilePosition

public int queryVFSFilePosition(FileReference file)
            throws DLPFunctionCallException,
                   NotConnectedException
Retrieves the location of the file pointer in the specified VFS file.
Parameters:
file - the file reference of the file to query.
Returns:
an integer containing the value for the specified files current I/O position pointer.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readAppPreference

public DLPAppPreference readAppPreference(int creatorID,
                                          char prefID,
                                          char size,
                                          byte flags)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads an application preference from the handheld.
Parameters:
creatorID - the preference creator.
prefID - the preference ID.
size - the number of bytes to be read.
flags - the preference read flags.
Returns:
the requested preference data.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readFeature

public int readFeature(int creator,
                       char featureNum)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads a Feature from the handheld.
Parameters:
creator - an integer containing the creator ID of the feature to be read.
featureNum - the feature number to read.
Returns:
the feature information requested.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readNetSyncInfo

public DLPNetSyncInfo readNetSyncInfo()
            throws DLPFunctionCallException,
                   NotConnectedException
Reads the network synchronization information from the handheld.
Returns:
the DLPNetSyncInfo object for the synchronizing device.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readNextModifiedRecord

public DLPRecord readNextModifiedRecord(byte dbID)
            throws DLPFunctionCallException,
                   NotConnectedException
Read the next modified record from the specified database.
Parameters:
dbID - the database identification handle.
Returns:
the next modified record in the database.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readNextModifiedRecordInCategory

public DLPRecord readNextModifiedRecordInCategory(byte dbID,
                                                  byte category)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads the next modified record in the specified category.
Parameters:
dbID - the database identification handle.
category - the category to read from.
Returns:
the next modified record in the specified category.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readNextRecordInCategory

public DLPRecord readNextRecordInCategory(byte dbID,
                                          byte category)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads the next record in the specified category.
Parameters:
dbID - the database identification handle.
category - the category to read from.
Returns:
the next record in the specified category.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readRecord

public DLPRecord readRecord(byte dbID,
                            char index,
                            char offset,
                            char length)
            throws DLPFunctionCallException,
                   NotConnectedException
Read a record from the specified database.
Parameters:
dbID - the database identification handle.
index - the record index to be read.
offset - the offset into the data to start reading from.
length - the number of bytes to read, or 0xFFFF to read to the end.
Returns:
the request record object.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readRecord

public DLPRecord readRecord(byte dbID,
                            int id,
                            char offset,
                            char length)
            throws DLPFunctionCallException,
                   NotConnectedException
Read a record from the specified database.
Parameters:
dbID - the database identification handle.
id - the ID number for the record to be read.
offset - the offset into the data to start reading from.
length - the number of bytes to read, or 0xFFFF to read to the end.
Returns:
the requested record object.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readRecordIDList

public int[] readRecordIDList(byte dbID,
                              byte flags,
                              char start,
                              char maxEntries)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads the list of record IDs from the specified database.
Parameters:
dbID - the database identification handle.
flags - the read flags to be used.
start - the first entry to start reading from.
maxEntries - the maximum number of entries to return.
Returns:
an int array containing all of the requested record ID numbers.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readResource

public DLPResource readResource(byte dbID,
                                char index,
                                char offset,
                                char length)
            throws DLPFunctionCallException,
                   NotConnectedException
Read a resource from the specified database by index.
Parameters:
dbID - the database identification handle.
index - the record index to be read.
offset - the offset into the data to start reading from.
length - the number of bytes to read, or 0xFFFF to read to the end.
Returns:
the requested resource.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readResource

public DLPResource readResource(byte dbID,
                                int type,
                                char id,
                                char offset,
                                char length)
            throws DLPFunctionCallException,
                   NotConnectedException
Read a resource from the specified database by resource ID.
Parameters:
dbID - the database identification handle.
type - the resource type information.
id - the ID number for the record to be read.
offset - the offset into the data to start reading from.
length - the number of bytes to read, or 0xFFFF to read to the end.
Returns:
the requested resource.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readVFSFile

public byte[] readVFSFile(FileReference file,
                          int numBytes)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads the specified number of bytes from a VFS file.
Parameters:
file - the file reference to read from.
numBytes - the number of bytes to be read.
Returns:
an array of bytes containing the read data.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

readVFSFileToStream

public int readVFSFileToStream(FileReference file,
                               int numBytes,
                               OutputStream out)
            throws DLPFunctionCallException,
                   NotConnectedException
Reads 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.
Parameters:
file - the file reference to read from.
numBytes - the number of bytes to be read.
out - the OutputStream object to write the data to.
Returns:
the number of bytes written to the stream.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

renameVFSFile

public void renameVFSFile(VolumeReference volRef,
                          String oldFilename,
                          String newFilename)
            throws DLPFunctionCallException,
                   NotConnectedException
Renames the specified VFS file to the newly specified name.
Parameters:
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.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

resetRecordIndex

public void resetRecordIndex(byte dbID)
            throws DLPFunctionCallException,
                   NotConnectedException
Reset the record index. This is used when calling one of the "readNext..." methods to reset the record index back to the beginning.
Parameters:
dbID - the database identification handle.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

resetSyncFlags

public void resetSyncFlags(byte dbID)
            throws DLPFunctionCallException,
                   NotConnectedException
Reset the synchronization flags for the given database.
Parameters:
dbID - the database identification handle.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

resetSystem

public void resetSystem()
            throws DLPFunctionCallException,
                   NotConnectedException
Request that the handheld reset itself at the end of synchronization.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

resizeVFSFile

public void resizeVFSFile(FileReference file,
                          int newSize)
            throws DLPFunctionCallException,
                   NotConnectedException
Resizes the specified file to the specified new size in bytes.
Parameters:
file - the file reference of the file to resize.
newSize - the new size of the file.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

seekVFSFile

public void seekVFSFile(FileReference file,
                        char origin,
                        int offset)
            throws DLPFunctionCallException,
                   NotConnectedException
Seeks to the specified position in the specified VFS file.
Parameters:
file - the file reference to seek in.
origin - the location to seek from.
offset - the offset to seek to (may be negative).
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

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 DLPFunctionCallException,
                   NotConnectedException
Sets the specified information for a database.
Parameters:
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.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

setTime

public void setTime(Calendar time)
            throws DLPFunctionCallException,
                   NotConnectedException
Sets the date and time on the handheld.
Parameters:
time - the date/time to set the handheld to.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

setTransport

public void setTransport(SLPTransportInterface t)
Set the transport for the protocol stack to use.
Parameters:
t - the transport for the protocol stack to use.

setUserInfo

public void setUserInfo(DLPUserInfo userInfo)
            throws DLPFunctionCallException,
                   NotConnectedException
Set the user information for the handheld.
Parameters:
userInfo - the user information object to write to the handheld.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

setVFSFileAttributes

public void setVFSFileAttributes(FileReference file,
                                 int attributes)
            throws DLPFunctionCallException,
                   NotConnectedException
Sets the atttributes for the specified file
Parameters:
file - the file reference of the file to set the attributes for.
attributes - the new file attributes bitmap.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

setVFSFileDate

public void setVFSFileDate(FileReference file,
                           char dateType,
                           long newValue)
            throws DLPFunctionCallException,
                   NotConnectedException
Sets 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 date constants in the FileReference class.
Parameters:
file - the file reference of the file to query.
dateType - the date type to be set.
newValue - the new value for the specified date.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.
See Also:
FileReference

setVFSVolumeLabel

public void setVFSVolumeLabel(VolumeReference volRef,
                              String newLabel)
            throws DLPFunctionCallException,
                   NotConnectedException
Sets the volume label for the specified VFS Volume.
Parameters:
volRef - the volume reference number of the volume to query.
newLabel - the new label to use on the specified volume.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

startTickles

public void startTickles()
Start sending tickle packets.

stopTickles

public void stopTickles()
Stop sending tickle packets.

suspend

public void suspend()
            throws NotConnectedException
Put the protocol stack into suspended mode. Suspending the protocol stack causes its state to be reset to the beginning, and for it to start listening for the next synchronization request. This is more efficient then disconnecting the protocol stack and reconnecting it.
Throws:
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeAppPreference

public void writeAppPreference(int creatorID,
                               char prefID,
                               byte flags,
                               DLPAppPreference preference)
            throws DLPFunctionCallException,
                   NotConnectedException
Write an application preference.
Parameters:
creatorID - the preference creator.
prefID - the preference ID.
flags - the preference flags.
preference - the application preference to be written.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeApplicationBlock

public void writeApplicationBlock(byte dbID,
                                  data[] )
            throws DLPFunctionCallException,
                   NotConnectedException
Write the specified application block to the specified database.
Parameters:
dbID - the database identification handle.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeApplicationBlock

public void writeApplicationBlock(byte dbID,
                                  DLPBlock appBlock)
            throws DLPFunctionCallException,
                   NotConnectedException
Write an application block to the specified database.
Parameters:
dbID - the database identification handle.
appBlock - the application block to be written.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeNetSyncInfo

public void writeNetSyncInfo(DLPNetSyncInfo netSyncInfo)
            throws DLPFunctionCallException,
                   NotConnectedException
Writes the network synchronization information to the handheld.
Parameters:
netSyncInfo - the DLPNetSyncInfo object to write.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeRecord

public int writeRecord(byte dbID,
                       byte flags,
                       int id,
                       byte attributes,
                       byte category,
                       data[] )
            throws DLPFunctionCallException,
                   NotConnectedException
Write a record to the specified database.
Parameters:
dbID - the database identification handle.
flags - the record write flags.
id - the ID number for the record to be written.
attributes - the record attributes.
category - the category to read from.
Returns:
the records ID number.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeRecord

public int writeRecord(byte dbID,
                       byte flags,
                       DLPRecord record)
            throws DLPFunctionCallException,
                   NotConnectedException
Write a record to the specified database.
Parameters:
dbID - the database identification handle.
flags -
record - the recond object to be written.
Returns:
the records ID number.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeResource

public void writeResource(byte dbID,
                          int type,
                          char id,
                          data[] )
            throws DLPFunctionCallException,
                   NotConnectedException
Write a resource to the specified database
Parameters:
dbID - the database identification handle.
type - the resource type.
id - the ID number for the resource to be written.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeResource

public void writeResource(byte dbID,
                          DLPResource res)
            throws DLPFunctionCallException,
                   NotConnectedException
Write a resource to the specified database
Parameters:
dbID - the database identification handle.
res - the resource data to be written.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeSortBlock

public void writeSortBlock(byte dbID,
                           data[] )
            throws DLPFunctionCallException,
                   NotConnectedException
Writes a sort block to the specified database.
Parameters:
dbID - the database identification handle.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeSortBlock

public void writeSortBlock(byte dbID,
                           DLPBlock sortBlock)
            throws DLPFunctionCallException,
                   NotConnectedException
Writes a sort block to the specified database.
Parameters:
dbID - the database identification handle.
sortBlock - the block object to be written.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeVFSFile

public int writeVFSFile(FileReference file,
                        byte[] data)
            throws DLPFunctionCallException,
                   NotConnectedException
Write the specified data to a VFS file.
Parameters:
file - the file reference to write to.
data - the data to be written.
Returns:
the response from the handheld write proccess.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeVFSFile

public int writeVFSFile(FileReference file,
                        byte[] data,
                        int dataLen)
            throws DLPFunctionCallException,
                   NotConnectedException
Write the specified data of specified length to a VFS file.
Parameters:
file - the file reference to write to.
data - the data to be written.
dataLen - the number of bytes in the buffer to be written.
Returns:
the response from the handheld write proccess.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.

writeVFSFileFromStream

public int writeVFSFileFromStream(FileReference file,
                                  InputStream stream,
                                  int length)
            throws DLPFunctionCallException,
                   NotConnectedException
Write the specified data stream to a VFS file.
Parameters:
file - the file reference to write to.
stream - the data stream to be written from.
length - the number of bytes to be written.
Returns:
the response from the handheld write proccess.
Throws:
DLPFunctionCallException - thrown if a DLP error results from this request.
NotConnectedException - if we're not connected, or the connection is lost during processing.