SmartSync 1.1

li.netcat.smartsync
Interface EventMonitor

All Superinterfaces:
java.util.EventListener

public interface EventMonitor
extends java.util.EventListener

The EventMonitor is the interface to a plugable mechanism to monitor all the events that occur during the synchronization process. The methods get called in the following sequence:

   onStart
   onTaskAnnounce
   ...
   onTaskAnnounce[n]
   onTaskStart
   onTaskCompletion
   ...
   onTaskStart[n]
   onTaskCompletion[n]
   onSuccess
 
The calls to onProgress and onAbortCheck may occur several times between onStart and onSuccess.
A call to onIOException may occur once after onStart. After this call, the synchronization process is aborted and the sequence of calls is terminated.

Author:
Arthur Marxer

Method Summary
 void onAbortCheck()
          Checks for abortion of the operation.
 void onIOException(java.io.IOException iox, Task task)
          This callback is used to inform the target about an input/output problem.
 void onProgress(TransferProgress progress)
          This method gets called upon transfer progress.
 void onStart(java.net.URL remoteDirectory, java.io.File localDirectory)
          This method is called immediately after the start of the synchronization by SmartSyncClient.synchronize(...).
 void onSuccess(boolean updateDone)
          This callback is used the after successful completion of the synchronization process.
 void onTaskAnnounce(Task task)
          This method gets called when the header of the response has arrived from the server and when there are some tasks to do.
 void onTaskCompletion(Task task)
          This method gets called immediately after a task has comleted.
 void onTaskStart(Task task)
          This method gets called immediately before a task starts.
 

Method Detail

onStart

public void onStart(java.net.URL remoteDirectory,
                    java.io.File localDirectory)
This method is called immediately after the start of the synchronization by SmartSyncClient.synchronize(...).
Parameters:
remoteDirectory - The URL pointing to the SmartSyncServer.
localDirectory - The local directory that gets updated.

onTaskAnnounce

public void onTaskAnnounce(Task task)
This method gets called when the header of the response has arrived from the server and when there are some tasks to do. If there are no tasks to do because the directory is already in sync, the onSuccess(...) method is called directly.
The order of the task list is typically the same as the subsequent calls to onTaskStart(...), but it's not guaranteed.
Parameters:
task - The task that will be started later. This parameter is never null.

onTaskStart

public void onTaskStart(Task task)
This method gets called immediately before a task starts.
Parameters:
task - The task that gets started. This parameter is never null.

onTaskCompletion

public void onTaskCompletion(Task task)
This method gets called immediately after a task has comleted.
Parameters:
task - The task that has completed. This parameter is never null.

onProgress

public void onProgress(TransferProgress progress)
This method gets called upon transfer progress. The typical interval between calls is 300 ms (no guarantee).
Parameters:
progress - A progress object containing the current progress values. This parameter is never null.

onAbortCheck

public void onAbortCheck()
                  throws UserAbortIOException
Checks for abortion of the operation. It gets called on a frequent interval. This method should throw a UserAbortIOException when to terminate the synchroniztaion process.

onSuccess

public void onSuccess(boolean updateDone)
This callback is used the after successful completion of the synchronization process.
Parameters:
updateDone - true, if an update was available, false otherwise. In each case, the synchronization process is completed and the directory structures are in sync.

onIOException

public void onIOException(java.io.IOException iox,
                          Task task)
This callback is used to inform the target about an input/output problem. After this call, the synchronization process is aborted and the sequence of calls is terminated.
Parameters:
iox - The IOException that describes the problem in detail. This parameter is never null.

SmartSync 1.1

Copyright © 2003 NetCat AG. All rights reserved. Feedback

keywords:java, net, servlet, synchronize, file, files, synchronize data, synchronize directory, synchronize files, synchronize files over HTTP, synchronize tree, file synchronizer, directory synchronizer, directory, directory structure, network, download, package, equalize, equalize, server, synchronise, file, files, synchronise data, synchronise directory, synchronise files, synchronise files over HTTP, synchronise tree, file synchroniser, file synchronisation, directory synchroniser, directory synchronisation, java, net, servlet, synchronize, file, files, synchronize data, synchronize directory, synchronize files, synchronize files over HTTP, synchronize tree, file synchronizer, directory synchronizer, directory, directory structure, network, download, package, equalize, equalize, server, synchronise, file, files, synchronise data, synchronise directory, synchronise files, synchronise files over HTTP, synchronise tree, file synchroniser, file synchronisation, directory synchroniser, directory synchronisation, java, net, servlet, synchronize, file, files, synchronize data, synchronize directory, synchronize files, synchronize files over HTTP, synchronize tree, file synchronizer, directory synchronizer, directory, directory structure, network, download, package, equalize, equalize, server, synchronise, file, files, synchronise data, synchronise directory, synchronise files, synchronise files over HTTP, synchronise tree, file synchroniser, file synchronisation, directory synchroniser, directory synchronisation