UltraLite Static Java User's Guide
Adding Non Data Access Features to UltraLite Applications
Adding synchronization to your application
This section describes how to monitor and cancel synchronization from UltraLite applications.
An API for monitoring synchronization progress and for canceling synchronization.
A progress indicator component that implements the interface, which you can add to your application.
To monitor synchronization, write a class that implements the UlSynchObserver interface. This interface contains a single method:
void updateSynchronizationStatus( UlSynchStatus status )
Register your UlSynchObserver object using the UlSynchOptions class.
Call the synchronize() method to synchronize.
UltraLite calls the updateSynchronizationStatus method of your observer class whenever the synchronization state changes. The following section describes the synchronization state.
Here is a typical sequence of instructions for synchronization. In this example, the class MyObserver implements the UlSynchObserver interface:
UlSynchObserver observer = new MyObserver (); UlSynchOptions opts = new UlSynchOptions(); // set options opts.setUserName( "mluser" ); opts.setPassword( "mlpwd" ); opts.setStream( new UlSocketStream() ); opts.setStreamParms( "localhost" ); opts.setObserver( observer ); opts.setUserData( myDataObject ); // synchronize conn.synchronize( opts );
Handling synchronization status information
Using the progress viewer