Receives synchronization progress information.
public SyncObserver
To receive progress reports during synchronization, you must create a new class that performs the task, and implement it using the setSyncObserver function.
The following example illustrates a simple SyncObserver interface:
class MyObserver implements SyncObserver { public boolean syncProgress(int state, SyncResult result) { System.out.println( "sync progress state = " + state + " bytes sent = " + result.getSentByteCount() + " bytes received = " + result.getReceivedByteCount() ); return false; // Always continue synchronization. } public MyObserver() {} // The default constructor. } |
The observer class above is enabled as follows:
// J2ME Sample Connection conn; ConfigRecordStore config = DatabaseManager.createConfigurationRecordStore( "test.ulj" ); try { conn = DatabaseManager.connect(config); } catch(ULjException ex) { conn = DatabaseManager.createDatabase(config); // Create the schema here. } SyncParms.setSyncObserver(new MyObserver()); |
All members of SyncObserver, including all inherited members.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |