net.sf.jfilesync.sync2
Class SyncComparator

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.gnocchi.GWorker
          extended by net.sf.jfilesync.sync2.SyncComparator
All Implemented Interfaces:
java.lang.Runnable

public class SyncComparator
extends net.sf.gnocchi.GWorker


Nested Class Summary
(package private)  class SyncComparator.SyncFileQueue
           
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  AbstractConnectionProxy con1
           
private  AbstractConnectionProxy con2
           
private  int files1
           
private  int files2
           
private  int filesDone
           
private static java.util.logging.Logger LOGGER
           
private  AbstractSyncPathComparator pathComparator
           
private  TPathControlInterface pathControl1
           
private  TPathControlInterface pathControl2
           
private  SyncSettings settings
           
private  ISyncFileSorter sorter
           
private  SyncDiffTree[] syncDiffTrees
           
private  int syncID
           
private  SyncMethod syncMethod
           
private static int TAKE_BOTH
           
private static int TAKE_LEFT
           
private static int TAKE_RIGHT
           
private  SyncTree tree1
           
private  SyncTree tree2
           
 
Fields inherited from class net.sf.gnocchi.GWorker
STATE_DIED, STATE_DONE, STATE_INTERRUPTED, STATE_READY, STATE_RUNNING
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SyncComparator(int syncID, AbstractConnectionProxy con1, SyncTree tree1, AbstractConnectionProxy con2, SyncTree tree2, SyncMethod syncMethod)
           
 
Method Summary
protected  void compareFiles(SyncFile file1, java.util.List<SyncDiff> diffList1, SyncFile file2, java.util.List<SyncDiff> diffList2)
           
protected  SyncDiffTree[] comparePaths(SyncFile file1, SyncFile file2)
           
 net.sf.gnocchi.GWorkerEvent construct()
           
private  void fileDone()
           
private  int getProgress()
           
 int getSyncID()
           
private  void setFileUnique(SyncFile file, java.util.List<SyncDiff> diffList)
           
private  void setQueueUnique(SyncComparator.SyncFileQueue queue, java.util.List<SyncDiff> diffList)
           
private  void setSubDirsUnique(SyncDiff node)
           
 void task()
           
private  boolean validateData()
           
private  boolean validateTree(SyncTree tree12)
           
 
Methods inherited from class net.sf.gnocchi.GWorker
addObserver, cancel, customCancel, getException, getObserver, getWorkerState, hasDied, isCancelled, isDone, isFinished, isRunning, run, setDied
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

con1

private final AbstractConnectionProxy con1

con2

private final AbstractConnectionProxy con2

tree1

private final SyncTree tree1

tree2

private final SyncTree tree2

syncMethod

private final SyncMethod syncMethod

pathControl1

private final TPathControlInterface pathControl1

pathControl2

private final TPathControlInterface pathControl2

TAKE_LEFT

private static final int TAKE_LEFT
See Also:
Constant Field Values

TAKE_BOTH

private static final int TAKE_BOTH
See Also:
Constant Field Values

TAKE_RIGHT

private static final int TAKE_RIGHT
See Also:
Constant Field Values

syncID

private int syncID

pathComparator

private final AbstractSyncPathComparator pathComparator

sorter

private final ISyncFileSorter sorter

filesDone

private int filesDone

files1

private int files1

files2

private int files2

syncDiffTrees

private SyncDiffTree[] syncDiffTrees

settings

private final SyncSettings settings

LOGGER

private static final java.util.logging.Logger LOGGER
Constructor Detail

SyncComparator

public SyncComparator(int syncID,
                      AbstractConnectionProxy con1,
                      SyncTree tree1,
                      AbstractConnectionProxy con2,
                      SyncTree tree2,
                      SyncMethod syncMethod)
Method Detail

getSyncID

public int getSyncID()

task

public void task()
          throws java.lang.Exception
Specified by:
task in class net.sf.gnocchi.GWorker
Throws:
java.lang.Exception

validateData

private boolean validateData()

validateTree

private boolean validateTree(SyncTree tree12)

construct

public net.sf.gnocchi.GWorkerEvent construct()
Specified by:
construct in class net.sf.gnocchi.GWorker

comparePaths

protected SyncDiffTree[] comparePaths(SyncFile file1,
                                      SyncFile file2)
                               throws SyncException,
                                      java.io.IOException
Throws:
SyncException
java.io.IOException

setQueueUnique

private void setQueueUnique(SyncComparator.SyncFileQueue queue,
                            java.util.List<SyncDiff> diffList)

setFileUnique

private void setFileUnique(SyncFile file,
                           java.util.List<SyncDiff> diffList)

setSubDirsUnique

private void setSubDirsUnique(SyncDiff node)

fileDone

private void fileDone()

compareFiles

protected void compareFiles(SyncFile file1,
                            java.util.List<SyncDiff> diffList1,
                            SyncFile file2,
                            java.util.List<SyncDiff> diffList2)
                     throws java.io.IOException
Throws:
java.io.IOException

getProgress

private int getProgress()