|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.manplato.ConduitHandler
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.
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 |
|
Field Detail |
public static final double version
public static java.awt.Frame frame
public static final byte READ_ID_LIST_SORT_FLAG
public static final byte WRITE_APP_PREF_BACKUP
Constructor Detail |
public ConduitHandler(ConduitManager cmanager, MSyncProtocol mpsp)
cmanager
- a handle to the active ConduitHandler class.mpsp
- a handle to the active MSyncProtocol object.Method Detail |
public void addSyncLogEntry(java.lang.String text)
text
- the text string to write to the Palm's sync log.public void cleanupDatabase(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle of an open database to be cleaned up.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.public void closeAllDatabases() throws ConduitHandlerException, NotConnectedException
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.public void closeDatabase(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle of the open database to be closed.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.public byte createDatabase(java.lang.String creator, java.lang.String type, java.lang.String dbName, char flags, char version) throws ConduitHandlerException, NotConnectedException
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.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.public void deleteDatabase(java.lang.String dbName) throws ConduitHandlerException, NotConnectedException
dbName
- the name of the database to delete.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.public void deleteRecord(byte dbID, byte flags, int recordID) throws ConduitHandlerException, NotConnectedException
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.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.public void deleteResource(byte dbID, byte flags, int type, char resourceID) throws ConduitHandlerException, NotConnectedException
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.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.public DLPBlock getApplicationBlock(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle of the open database from which to retrieve the Application Block.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.public DLPDatabaseInfo getDatabaseInfo(java.lang.String dbName) throws ConduitHandlerException
dbName
- the name of the database the retrieve information on.ConduitHandlerException
- thrown if the specified database did not exist at the start of sync.public java.util.Vector getDatabaseInfoList()
DLPDatabaseInfo
public java.awt.Frame getFrameHandle()
Frame
,
Dialog
public int getOpenDatabaseInfo(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle of the open database to query.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.public java.lang.Object getProperty(java.lang.Object key)
key
- the key value to retrieve from the property hash.storeProperty
public int getRecordCount(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle of the open database to query.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.getOpenDatabaseInfo
public DLPBlock getSortBlock(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle of the open database from which to retrieve the sort block, if one exists.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.public DLPStorageInfo getStorageInfo(byte card) throws ConduitHandlerException, NotConnectedException
card
- the card number to query (currently, this should always be set to 0).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.public DLPSystemInfo getSystemInfo()
public DLPUserInfo getUserInfo()
public static final double getVersion()
public boolean hasDatabase(java.lang.String dbName) throws NotConnectedException
dbName
- the name of the database to check for existance.NotConnectedException
- thrown if the connection to the Palm has been or is lost during this method call.public boolean isModemSync()
public boolean isPopupAllowed()
public void moveCategory(byte dbID, byte to, byte from) throws ConduitHandlerException, NotConnectedException
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.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.public void openConduit() throws ConduitHandlerException, NotConnectedException
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.public byte openDatabase(java.lang.String dbName, byte mode) throws ConduitHandlerException, NotConnectedException
dbName
- the name of the database to open.mode
- the mode in which to open this database (see DLPDatabase for available modes).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.com.ibm.manplato.Protocol.Utils.DLPDatabase
public void postToLog(java.lang.String s)
s
- a String to add to the ManplatoSync synchronization log.setStatus
public float queryDLPVersion()
public DLPAppPreference readAppPreference(int creatorID, char prefID, char size, byte flags) throws ConduitHandlerException, NotConnectedException
creatorID
- the app preference creator ID.prefID
- the desired preference ID.size
- the size in bytes to read.flags
- Valid preference flags.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.DLPAppPreference
public DLPDatabase readDatabase(java.lang.String dbName) throws ConduitHandlerException, NotConnectedException
dbName
- the name of the Database to retrieve.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.public DLPRecord readNextModifiedRecord(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the ID of the database to read the next modified record from.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.public DLPRecord readNextModifiedRecordInCategory(byte dbID, byte category) throws ConduitHandlerException, NotConnectedException
dbID
- the ID of the database to read the next modified record from.category
- the category ID to read the record from.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.public DLPRecord readNextRecordInCategory(byte dbID, byte category) throws ConduitHandlerException, NotConnectedException
dbID
- the ID of the database to read the next record from.category
- the category ID to read the record from.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.public DLPRecord readRecordByID(byte dbID, int recordID) throws ConduitHandlerException, NotConnectedException
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.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.public DLPRecord readRecordByIndex(byte dbID, char recordIndex) throws ConduitHandlerException, NotConnectedException
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.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.public int[] readRecordIDList(byte dbID, byte flags, char firstRecNum, char maximumEntries) throws ConduitHandlerException, NotConnectedException
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.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.public DLPResource readResourceByID(byte dbID, int type, char resourceID) throws ConduitHandlerException, NotConnectedException
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.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.public DLPResource readResourceByIndex(byte dbID, char resourceIndex) throws ConduitHandlerException, NotConnectedException
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.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.public void resetRecordIndex(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle to the database to reset.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.public void resetSyncFlags(byte dbID) throws ConduitHandlerException, NotConnectedException
dbID
- the handle to the database to reset.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.public void resetSystem() throws ConduitHandlerException, NotConnectedException
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.public static void setFrameHandle(java.awt.Frame f)
f
- the Frame object handle.public void setStatus(java.lang.String status)
status
- the status String to be displayed.postToLog
public void startTickles()
stopTickles
public void stopTickles()
startTickles
public void storeProperty(java.lang.Object key, java.lang.Object data)
getProperty
public void writeApplicationBlock(byte dbID, DLPBlock appBlock) throws ConduitHandlerException, NotConnectedException
dbID
- the handle to an open database to write the app block to.appBlock
- the application block (as a DLPBlock object) to write.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.public void writeApplicationBlock(byte dbID, byte[] appBlock) throws ConduitHandlerException, NotConnectedException
dbID
- the handle to an open database to write the app block to.appBlock
- the application block (as an array of bytes) to write.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.public void writeAppPreference(int creatorID, char prefID, byte flags, DLPAppPreference preference) throws ConduitHandlerException, NotConnectedException
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.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.public void writeDatabase(DLPDatabase dbName) throws ConduitHandlerException, NotConnectedException
dbName
- the DLPDatabase object to write.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.public int writeRecord(byte dbID, byte flags, int recordID, byte attributes, byte category, byte[] data) throws ConduitHandlerException, NotConnectedException
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.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.com.ibm.manplato.DLPRecord
public int writeRecord(byte dbID, byte flags, DLPRecord record) throws ConduitHandlerException, NotConnectedException
dbID
- the open database handle to write to.flags
- the record writing flags. See DLPRecord for valid flags.record
- the DLPRecord object to write.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.com.ibm.manplato.DLPRecord
public void writeResource(byte dbID, int type, char resourceID, byte[] data) throws ConduitHandlerException, NotConnectedException
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.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.com.ibm.manplato.DLPResource
public void writeResource(byte dbID, DLPResource resource) throws ConduitHandlerException, NotConnectedException
dbID
- the open database handle to write to.resource
- the DLPResource object to write.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.com.ibm.manplato.DLPResource
public void writeSortBlock(byte dbID, DLPBlock sortBlock) throws ConduitHandlerException, NotConnectedException
dbID
- the handle to an open database to write the sort block to.appBlock
- the sort block (as a DLPBlock object) to write.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.public void writeSortBlock(byte dbID, byte[] sortBlock) throws ConduitHandlerException, NotConnectedException
dbID
- the handle to an open database to write the sort block to.appBlock
- the sort block (as an array of bytes) to write.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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |