com.ibm.manplato
Class ConduitHandler

java.lang.Object
  |
  +--com.ibm.manplato.ConduitHandler

public final class ConduitHandler
extends java.lang.Object

The Conduit Handler class. This class provides high-level access to Palm data structures for synchronization logic classes conforming to the Conduit specification. Note that this class cannot be constructed outside its parent package. Conduits are passed an active instance of the ConduitHandler at sync time.

Version:
$Rev$-$Date: 2001/03/15 16:47:31 $$State: Exp $
Author:
File Created By: Brad BARCLAY <bbarclay@ca.ibm.com>, Last Modified By: $Author: Yaztromo $

Field Summary
static java.awt.Frame frame
           
static byte READ_ID_LIST_SORT_FLAG
           
static double version
           
static byte WRITE_APP_PREF_BACKUP
           
 
Constructor Summary
ConduitHandler(ConduitManager cmanager, MSyncProtocol mpsp)
          Constructs a new Conduit Handler object, using the specified ManplatoSync instance as its parent, and the specified MSyncProtocol instance for Palm communications.
 
Method Summary
 void addSyncLogEntry(java.lang.String text)
          Adds an entry to the Palm's synchronization log.
 void cleanupDatabase(byte dbID)
          Cleans-up the specified database.
 void closeAllDatabases()
          Closes all open databases.
 void closeDatabase(byte dbID)
          Closes a specified database.
 byte createDatabase(java.lang.String creator, java.lang.String type, java.lang.String dbName, char flags, char version)
          Creates a new database with the specified parameters.
 void deleteDatabase(java.lang.String dbName)
          Deletes the specified database.
 void deleteRecord(byte dbID, byte flags, int recordID)
          Deletes a record from the remote Palm.
 void deleteResource(byte dbID, byte flags, int type, char resourceID)
          Deletes the specified resource from the specified Palm database.
 DLPBlock getApplicationBlock(byte dbID)
          Retrieves the application block for the specified database.
 DLPDatabaseInfo getDatabaseInfo(java.lang.String dbName)
          Retrieves the Database Info object for a specified database.
 java.util.Vector getDatabaseInfoList()
          Retrieves a Vector containing the DLPDatabaseInfo objects for every database on the remote Palm.
 java.awt.Frame getFrameHandle()
          Returns a handle to the main ManplatoSync frame.
 int getOpenDatabaseInfo(byte dbID)
          Returns the number of resources or records in a currently open database.
 java.lang.Object getProperty(java.lang.Object key)
          Gets a named property from the ConduitHandler.
 int getRecordCount(byte dbID)
          Returns the number of records in the specified database.
 DLPBlock getSortBlock(byte dbID)
          Retrieves the Sort Block from the specified database, if one exists.
 DLPStorageInfo getStorageInfo(byte card)
          Gets the current storage info for the specified memory card.
 DLPSystemInfo getSystemInfo()
          Retrieves the Palm's system information object.
 DLPUserInfo getUserInfo()
          Retrieves the user information from the Palm.
static double getVersion()
          Returns the version number for this ConduitHandler class.
 boolean hasDatabase(java.lang.String dbName)
          Checks to see if the Palm has the specified database.
 boolean isModemSync()
          This method is used to determine wether this is a modem or cradle synchronization.
 boolean isPopupAllowed()
          Used to query wether ManplatoSync has been set to supress popups or not.
 void moveCategory(byte dbID, byte to, byte from)
          Moves a category from one ID to another for the specified database.
 void openConduit()
          Informs the remote Palm that a new Conduit is being opened.
 byte openDatabase(java.lang.String dbName, byte mode)
          Opens the specified database in the specified mode.
 void postToLog(java.lang.String s)
          Adds a text message to the ManplatoSync's synchronization log.
 float queryDLPVersion()
          Queries the remote Palm's DLP version number.
 DLPAppPreference readAppPreference(int creatorID, char prefID, char size, byte flags)
          Reads the specified application preference.
 DLPDatabase readDatabase(java.lang.String dbName)
          Reads an entire database from the Palm.
 DLPRecord readNextModifiedRecord(byte dbID)
          Read the next record from the specified database which has it's Modified flag set.
 DLPRecord readNextModifiedRecordInCategory(byte dbID, byte category)
          Read the next record from the specified database and category which has it's Modified flag set.
 DLPRecord readNextRecordInCategory(byte dbID, byte category)
          Read the next record from the specified database and category.
 DLPRecord readRecordByID(byte dbID, int recordID)
          Reads the record from the specified database that has the specified record ID.
 DLPRecord readRecordByIndex(byte dbID, char recordIndex)
          Reads the record from the specified database that has the specified record index.
 int[] readRecordIDList(byte dbID, byte flags, char firstRecNum, char maximumEntries)
          Reads the ID list for the records contained within the specified database.
 DLPResource readResourceByID(byte dbID, int type, char resourceID)
          Reads the resource from the specified database that has the specified resource ID.
 DLPResource readResourceByIndex(byte dbID, char resourceIndex)
          Reads the resource from the specified database that has the specified resource index.
 void resetRecordIndex(byte dbID)
          Resets the readNextModifiedRecord counters back to the beginning of the database.
 void resetSyncFlags(byte dbID)
          Resets all dirty flags in the specified database, and sorts the last sync time to now.
 void resetSystem()
          Causes the Palm to require a reboot after synchronization completes.
static void setFrameHandle(java.awt.Frame f)
          Sets the Frame handle to use for dialogs.
 void setStatus(java.lang.String status)
          Displays a text string in the Sync Windows status line.
 void startTickles()
          Starts the sending of tickle packets.
 void stopTickles()
          Stops the transmission of tickle packets.
 void storeProperty(java.lang.Object key, java.lang.Object data)
          Stores a Conduit property.
 void writeApplicationBlock(byte dbID, byte[] appBlock)
          Writes an application block to the remote device.
 void writeApplicationBlock(byte dbID, DLPBlock appBlock)
          Writes an application block to the remote device.
 void writeAppPreference(int creatorID, char prefID, byte flags, DLPAppPreference preference)
          Writes an application preference to the remote device.
 void writeDatabase(DLPDatabase dbName)
          Write an entire database to the remote device.
 int writeRecord(byte dbID, byte flags, DLPRecord record)
          Writes a record to the remote device.
 int writeRecord(byte dbID, byte flags, int recordID, byte attributes, byte category, byte[] data)
          Writes a record to the remote device.
 void writeResource(byte dbID, DLPResource resource)
          Writes a resource to the remote device.
 void writeResource(byte dbID, int type, char resourceID, byte[] data)
          Writes a resource to the remote device.
 void writeSortBlock(byte dbID, byte[] sortBlock)
          Writes an sort block to the remote device.
 void writeSortBlock(byte dbID, DLPBlock sortBlock)
          Writes an sort block to the remote device.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final double version

frame

public static java.awt.Frame frame

READ_ID_LIST_SORT_FLAG

public static final byte READ_ID_LIST_SORT_FLAG

WRITE_APP_PREF_BACKUP

public static final byte WRITE_APP_PREF_BACKUP
Constructor Detail

ConduitHandler

public ConduitHandler(ConduitManager cmanager,
                      MSyncProtocol mpsp)
Constructs a new Conduit Handler object, using the specified ManplatoSync instance as its parent, and the specified MSyncProtocol instance for Palm communications.
Parameters:
cmanager - a handle to the active ConduitHandler class.
mpsp - a handle to the active MSyncProtocol object.
Method Detail

addSyncLogEntry

public void addSyncLogEntry(java.lang.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.
Parameters:
text - the text string to write to the Palm's sync log.

cleanupDatabase

public void cleanupDatabase(byte dbID)
                     throws ConduitHandlerException,
                            NotConnectedException
Cleans-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.
Parameters:
dbID - the handle of an open database to be cleaned up.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

closeAllDatabases

public void closeAllDatabases()
                       throws ConduitHandlerException,
                              NotConnectedException
Closes all open databases. This method will close every open database on the Palm.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

closeDatabase

public void closeDatabase(byte dbID)
                   throws ConduitHandlerException,
                          NotConnectedException
Closes a specified database. This method will immediately close the speficied open database.
Parameters:
dbID - the handle of the open database to be closed.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

createDatabase

public byte createDatabase(java.lang.String creator,
                           java.lang.String type,
                           java.lang.String dbName,
                           char flags,
                           char version)
                    throws ConduitHandlerException,
                           NotConnectedException
Creates a new database with the specified parameters.
Parameters:
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.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

deleteDatabase

public void deleteDatabase(java.lang.String dbName)
                    throws ConduitHandlerException,
                           NotConnectedException
Deletes 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.
Parameters:
dbName - the name of the database to delete.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

deleteRecord

public void deleteRecord(byte dbID,
                         byte flags,
                         int recordID)
                  throws ConduitHandlerException,
                         NotConnectedException
Deletes a record from the remote Palm.
Parameters:
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.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

deleteResource

public void deleteResource(byte dbID,
                           byte flags,
                           int type,
                           char resourceID)
                    throws ConduitHandlerException,
                           NotConnectedException
Deletes the specified resource from the specified Palm database.
Parameters:
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.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

getApplicationBlock

public DLPBlock getApplicationBlock(byte dbID)
                             throws ConduitHandlerException,
                                    NotConnectedException
Retrieves the application block for the specified database.
Parameters:
dbID - the handle of the open database from which to retrieve the Application Block.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

getDatabaseInfo

public DLPDatabaseInfo getDatabaseInfo(java.lang.String dbName)
                                throws ConduitHandlerException
Retrieves the Database Info object for a specified database. Note that ManplatoSync 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.
Parameters:
dbName - the name of the database the retrieve information on.
Returns:
the DLPDatabaseInfo object for the requested database.
Throws:
ConduitHandlerException - thrown if the specified database did not exist at the start of sync.

getDatabaseInfoList

public java.util.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 Conduit.
Returns:
a Vector of DLPDatabaseInfo objects.
See Also:
DLPDatabaseInfo

getFrameHandle

public java.awt.Frame getFrameHandle()
Returns a handle to the main ManplatoSync frame. This method is suitable for grabbing the ManplatoSync as a Frame object for passing into a Dialog constructor for Conduits requiring GUI display. This method returns null if the Frame parent has not been set.
Returns:
the Frame handle to the ManplatoSyncFrame object.
See Also:
Frame, Dialog

getOpenDatabaseInfo

public int getOpenDatabaseInfo(byte dbID)
                        throws ConduitHandlerException,
                               NotConnectedException
Returns the number of resources or records in a currently open database.
Parameters:
dbID - the handle of the open database to query.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

getProperty

public java.lang.Object getProperty(java.lang.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 Conduit. Multiple Conduits 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 Conduit. All such keys and values are destroyed at the end of synchronization - Conduits which require persistent storage should use their own object variables (note that all Conduit object variables are serialized persistently across ManplatoSync invocations unless they are marked as being transient).
Parameters:
key - the key value to retrieve from the property hash.
Returns:
an Object corresponding to the associated key, or null if the specified key is not found.
See Also:
storeProperty

getRecordCount

public int getRecordCount(byte dbID)
                   throws ConduitHandlerException,
                          NotConnectedException
Returns the number of records in the specified database.
Parameters:
dbID - the handle of the open database to query.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
See Also:
getOpenDatabaseInfo

getSortBlock

public DLPBlock getSortBlock(byte dbID)
                      throws ConduitHandlerException,
                             NotConnectedException
Retrieves the Sort Block from the specified database, if one exists.
Parameters:
dbID - the handle of the open database from which to retrieve the sort block, if one exists.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

getStorageInfo

public DLPStorageInfo getStorageInfo(byte card)
                              throws ConduitHandlerException,
                                     NotConnectedException
Gets 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.
Parameters:
card - the card number to query (currently, this should always be set to 0).
Returns:
the DLPStorageInfo object for the specified memory card.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

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.
Returns:
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.
Returns:
a DLPUserInfo object containing the current Palm users information.

getVersion

public static final double getVersion()
Returns the version number for this ConduitHandler class. The version number should be queried by Conduit which require methods and features not found in previous versions of the ConduitHandler in order to verify that they will be available.
Returns:
the ConduitHandler version, as a double.

hasDatabase

public boolean hasDatabase(java.lang.String dbName)
                    throws NotConnectedException
Checks 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.
Parameters:
dbName - the name of the database to check for existance.
Throws:
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

isModemSync

public boolean isModemSync()
This method is used to determine wether this is a modem or cradle synchronization. This method is useful for Conduits which have different operations based on wether the synchronization type is via a local dock, or via a remote modem dialup.
Returns:
true if this is a modem synchronization, false otherwise.

isPopupAllowed

public boolean isPopupAllowed()
Used to query wether ManplatoSync has been set to supress popups or not. Conduits 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.
Returns:
boolean true if it's okay to display popups, false otherwise.

moveCategory

public void moveCategory(byte dbID,
                         byte to,
                         byte from)
                  throws ConduitHandlerException,
                         NotConnectedException
Moves a category from one ID to another for the specified database.
Parameters:
dbID - the handle of the open database in which to move the categories.
to - the category ID to move the records to.
the - category ID to move the records from.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

openConduit

public void openConduit()
                 throws ConduitHandlerException,
                        NotConnectedException
Informs the remote Palm that a new Conduit is being opened. Calls to this method update the Palm's display during the Sync to show that actions are being undertaken on the host side. Note that calling this method is not normally necessary, as ManplatoSync always makes this call prior to calling a Conduit's startSync(ConduitHandler) method. This method should only be used by Conduits which internally implement multiple conduits to multiple databases.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

openDatabase

public byte openDatabase(java.lang.String dbName,
                         byte mode)
                  throws ConduitHandlerException,
                         NotConnectedException
Opens the specified database in the specified mode.
Parameters:
dbName - the name of the database to open.
mode - the mode in which to open this database (see DLPDatabase for available modes).
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
See Also:
com.ibm.manplato.Protocol.Utils.DLPDatabase

postToLog

public void postToLog(java.lang.String s)
Adds a text message to the ManplatoSync'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).
Parameters:
s - a String to add to the ManplatoSync synchronization log.
See Also:
setStatus

queryDLPVersion

public float queryDLPVersion()
Queries the remote Palm's DLP version number. This method is useful for Conduit which may sync differently for different DLP versions. Note that if this information is not available, this method will return 1.0.
Returns:
the DLP version number as a float consisting if major revision.minor revision

readAppPreference

public DLPAppPreference readAppPreference(int creatorID,
                                          char prefID,
                                          char size,
                                          byte flags)
                                   throws ConduitHandlerException,
                                          NotConnectedException
Reads the specified application preference.
Parameters:
creatorID - the app preference creator ID.
prefID - the desired preference ID.
size - the size in bytes to read.
flags - Valid preference flags.
Returns:
The DLPAppPreference object representing the requested app preference.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
See Also:
DLPAppPreference

readDatabase

public DLPDatabase readDatabase(java.lang.String dbName)
                         throws ConduitHandlerException,
                                NotConnectedException
Reads 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.
Parameters:
dbName - the name of the Database to retrieve.
Returns:
a DLPDatabase object representing the desired database.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readNextModifiedRecord

public DLPRecord readNextModifiedRecord(byte dbID)
                                 throws ConduitHandlerException,
                                        NotConnectedException
Read 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.
Parameters:
dbID - the ID of the database to read the next modified record from.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readNextModifiedRecordInCategory

public DLPRecord readNextModifiedRecordInCategory(byte dbID,
                                                  byte category)
                                           throws ConduitHandlerException,
                                                  NotConnectedException
Read 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.
Parameters:
dbID - the ID of the database to read the next modified record from.
category - the category ID to read the record from.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readNextRecordInCategory

public DLPRecord readNextRecordInCategory(byte dbID,
                                          byte category)
                                   throws ConduitHandlerException,
                                          NotConnectedException
Read 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.
Parameters:
dbID - the ID of the database to read the next record from.
category - the category ID to read the record from.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readRecordByID

public DLPRecord readRecordByID(byte dbID,
                                int recordID)
                         throws ConduitHandlerException,
                                NotConnectedException
Reads the record from the specified database that has the specified record ID.
Parameters:
dbID - the ID of the database to read from.
the - ID number of the record to be read. Record ID nubmers are unique identifiers for each record.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readRecordByIndex

public DLPRecord readRecordByIndex(byte dbID,
                                   char recordIndex)
                            throws ConduitHandlerException,
                                   NotConnectedException
Reads the record from the specified database that has the specified record index.
Parameters:
dbID - the ID of the database to read from.
the - index of the record to be read. This index is a 1-based ordinal denoting the record order within the database.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readRecordIDList

public int[] readRecordIDList(byte dbID,
                              byte flags,
                              char firstRecNum,
                              char maximumEntries)
                       throws ConduitHandlerException,
                              NotConnectedException
Reads the ID list for the records contained within the specified database. This method returns a list of ID numbers contained within the selected database.
Parameters:
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.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readResourceByID

public DLPResource readResourceByID(byte dbID,
                                    int type,
                                    char resourceID)
                             throws ConduitHandlerException,
                                    NotConnectedException
Reads the resource from the specified database that has the specified resource ID.
Parameters:
dbID - the ID of the database to read from.
type - the resource type.
the - ID number of the resource to be read. Resource ID numbers are unique identifiers for each resource.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

readResourceByIndex

public DLPResource readResourceByIndex(byte dbID,
                                       char resourceIndex)
                                throws ConduitHandlerException,
                                       NotConnectedException
Reads the resource from the specified database that has the specified resource index.
Parameters:
dbID - the ID of the database to read from.
the - index of the resource to be read. This index is a 1-based ordinal denoting the resource order within the database.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

resetRecordIndex

public void resetRecordIndex(byte dbID)
                      throws ConduitHandlerException,
                             NotConnectedException
Resets 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.
Parameters:
dbID - the handle to the database to reset.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

resetSyncFlags

public void resetSyncFlags(byte dbID)
                    throws ConduitHandlerException,
                           NotConnectedException
Resets 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.
Parameters:
dbID - the handle to the database to reset.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

resetSystem

public void resetSystem()
                 throws ConduitHandlerException,
                        NotConnectedException
Causes 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.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

setFrameHandle

public static void setFrameHandle(java.awt.Frame f)
Sets the Frame handle to use for dialogs. Note that Conduits should not call this method.
Parameters:
f - the Frame object handle.

setStatus

public void setStatus(java.lang.String status)
Displays a text string in the Sync Windows status line. Calls to this method display the specified text in the ManplatoSync's Sync Window status line, and also adds the specified text to the ManplatoSync's synchronization log. To post just to the log, please use postToLog(String).
Parameters:
status - the status String to be displayed.
See Also:
postToLog

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 Conduit 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.
See Also:
stopTickles

stopTickles

public void stopTickles()
Stops the transmission of tickle packets.
See Also:
startTickles

storeProperty

public void storeProperty(java.lang.Object key,
                          java.lang.Object data)
Stores a Conduit property.
See Also:
getProperty

writeApplicationBlock

public void writeApplicationBlock(byte dbID,
                                  DLPBlock appBlock)
                           throws ConduitHandlerException,
                                  NotConnectedException
Writes an application block to the remote device. This method will write an application block to the specified database.
Parameters:
dbID - the handle to an open database to write the app block to.
appBlock - the application block (as a DLPBlock object) to write.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

writeApplicationBlock

public void writeApplicationBlock(byte dbID,
                                  byte[] appBlock)
                           throws ConduitHandlerException,
                                  NotConnectedException
Writes an application block to the remote device. This method will write an application block to the specified database.
Parameters:
dbID - the handle to an open database to write the app block to.
appBlock - the application block (as an array of bytes) to write.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

writeAppPreference

public void writeAppPreference(int creatorID,
                               char prefID,
                               byte flags,
                               DLPAppPreference preference)
                        throws ConduitHandlerException,
                               NotConnectedException
Writes an application preference to the remote device. This method allows for the writing aof application preferences to the remote device.
Parameters:
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.
Throws:
DLPFunctionCallException - The exception description.
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

writeDatabase

public void writeDatabase(DLPDatabase dbName)
                   throws ConduitHandlerException,
                          NotConnectedException
Write an entire database to the remote device. Calls to this method allow for the writing of an entire DLPDatabase object to the remote device.
Parameters:
dbName - the DLPDatabase object to write.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

writeRecord

public int writeRecord(byte dbID,
                       byte flags,
                       int recordID,
                       byte attributes,
                       byte category,
                       byte[] data)
                throws ConduitHandlerException,
                       NotConnectedException
Writes a record to the remote device. This method will write the specified record to the remote device.
Parameters:
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.
data - the record data to be written.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
See Also:
com.ibm.manplato.DLPRecord

writeRecord

public int writeRecord(byte dbID,
                       byte flags,
                       DLPRecord record)
                throws ConduitHandlerException,
                       NotConnectedException
Writes a record to the remote device. This method will write the specified record to the remote device.
Parameters:
dbID - the open database handle to write to.
flags - the record writing flags. See DLPRecord for valid flags.
record - the DLPRecord object to write.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
See Also:
com.ibm.manplato.DLPRecord

writeResource

public void writeResource(byte dbID,
                          int type,
                          char resourceID,
                          byte[] data)
                   throws ConduitHandlerException,
                          NotConnectedException
Writes a resource to the remote device. This method will write the specified resource to the remote device.
Parameters:
dbID - the open database handle to write to.
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.
data - the byte array containing the resource data to be written.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
See Also:
com.ibm.manplato.DLPResource

writeResource

public void writeResource(byte dbID,
                          DLPResource resource)
                   throws ConduitHandlerException,
                          NotConnectedException
Writes a resource to the remote device. This method will write the specified resource to the remote device.
Parameters:
dbID - the open database handle to write to.
resource - the DLPResource object to write.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.
See Also:
com.ibm.manplato.DLPResource

writeSortBlock

public void writeSortBlock(byte dbID,
                           DLPBlock sortBlock)
                    throws ConduitHandlerException,
                           NotConnectedException
Writes an sort block to the remote device. This method will write an sort block to the specified database.
Parameters:
dbID - the handle to an open database to write the sort block to.
appBlock - the sort block (as a DLPBlock object) to write.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.

writeSortBlock

public void writeSortBlock(byte dbID,
                           byte[] sortBlock)
                    throws ConduitHandlerException,
                           NotConnectedException
Writes an sort block to the remote device. This method will write an sort block to the specified database.
Parameters:
dbID - the handle to an open database to write the sort block to.
appBlock - the sort block (as an array of bytes) to write.
Throws:
ConduitHandlerException - thrown if the underlying DLP protocol layer reports an error.
NotConnectedException - thrown if the connection to the Palm has been or is lost during this method call.