Contents Index Monitoring and canceling synchronization Using the progress viewer pdf/preface.pdf

UltraLite User's Guide
  Developing UltraLite Java Applications
    Monitoring and canceling synchronization

Implementing the UlSynchObserver interface


In the class that implements UlSynchObserver, the UlSynchStatus object holds synchronization information. This object is filled by UltraLite with synchronization status information each time your updateSynchronizationStatus method is called.

UlSynchStatus methods 

The UlSynchStatus object has the following methods:

int getState()
int getTableCount()
int getTableIndex()
Object getUserData()
UlSynchOptions getSynchOptions()
UlSqlStmt getStatement()
int getErrorCode()
boolean isOKToContinue()
void cancelSynchronization()

These methods have the following meanings:

Example 

The following code snippet illustrates a very simple observer:

void updateSynchronizationStatus( UlSynchStatus status )
{
    int state = status.getState();
    System.out.println( "Sync status: " + state );
    if( state == UlSynchStatus.SENDING_TABLE ||
       state == UlSynchStatus.RECEIVING_TABLE ){
          System.out.println( "send/receive table " +
          ( status.getTableIndex() + 1 ) +
            " of " + status.getTableCount() );
    }
}

Contents Index Monitoring and canceling synchronization Using the progress viewer pdf/preface.pdf