SyncObserver interface

Receives synchronization progress information.

Syntax
public SyncObserver
Remarks

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());
Members

All members of SyncObserver, including all inherited members.


syncProgress function