Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » UltraLiteJ » UltraLiteJ Reference » UltraLiteJ API reference


SyncObserver interface

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) {
            "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(
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.

syncProgress method