ewe.database
Class RemoteSynchronizer

java.lang.Object
  extended byewe.database.Synchronizer
      extended byewe.database.RemoteSynchronizer

public class RemoteSynchronizer
extends Synchronizer


Field Summary
 Handle handle
           
 
Fields inherited from class ewe.database.Synchronizer
ALWAYS, CANCELLED, dontSynchronizeDeletedItems, dontSyncJustDebug, lastConflictCommand, LOCAL_TO_REMOTE, REMOTE_TO_LOCAL, remoteToLocalOnly, RESOLVE_LATER, syncTime
 
Constructor Summary
RemoteSynchronizer(Database local, Stream connection)
           
 
Method Summary
 void acceptEntry(byte[] data)
           
 void close()
          This is called at the end of the syncrhonization.
 int countDeleted()
           
 int countRemoteDeletedEntries()
           
 int countRemoteUnsynchronizedEntries()
           
 int countUnsynced()
           
 void eraseDeleted(int index)
           
 void eraseDeletedOnRemote(int index)
           
 void eraseEntry(long oid)
           
 void eraseEntryOnRemote(long OID)
           
 long getDeleted(int index)
           
 long getRemoteDeletedEntry(int index)
           
 byte[] getRemoteUnsynchronizedEntry(int index)
           
 byte[] getUnsynced(int index)
           
 void markAsSynchronized(int index)
          This is called remotely by the controlling synchronizer.
 void markRemoteAsSynchronized(int index)
           
 void sendEntryToRemote(DatabaseEntry de)
           
 Handle synchronize(String desktopMessage, String mobileMessage)
           
static RemoteSynchronizer synchronizeOnRemoteConnection(String databaseName, String[] remoteEweApplications, TimeOut timeout, int makeOptions)
           
static RemoteSynchronizer synchronizeOnRemoteConnection(String databaseName, String remoteEweApplication, TimeOut timeout, int makeOptions)
           
 
Methods inherited from class ewe.database.Synchronizer
addOrReplace, checkSort, erase, eraseDeleted, findByOID, getByOID, getByOID, getDisplayString, getMatchingEntry, getOID, getResolveString, getUnsynchronized, getUnsynchronized, isSynchronized, markAsSynchronized, markAsSynchronized, resolveConflict, synchronize, synchronize, synchronize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

handle

public Handle handle
Constructor Detail

RemoteSynchronizer

public RemoteSynchronizer(Database local,
                          Stream connection)
Method Detail

close

public void close()
Description copied from class: Synchronizer
This is called at the end of the syncrhonization. Override if necessary.

Overrides:
close in class Synchronizer

countRemoteUnsynchronizedEntries

public int countRemoteUnsynchronizedEntries()
                                     throws IOException
Overrides:
countRemoteUnsynchronizedEntries in class Synchronizer
Throws:
IOException

getRemoteUnsynchronizedEntry

public byte[] getRemoteUnsynchronizedEntry(int index)
                                    throws IOException
Overrides:
getRemoteUnsynchronizedEntry in class Synchronizer
Throws:
IOException

markRemoteAsSynchronized

public void markRemoteAsSynchronized(int index)
                              throws IOException
Overrides:
markRemoteAsSynchronized in class Synchronizer
Throws:
IOException

sendEntryToRemote

public void sendEntryToRemote(DatabaseEntry de)
                       throws IOException
Overrides:
sendEntryToRemote in class Synchronizer
Throws:
IOException

countRemoteDeletedEntries

public int countRemoteDeletedEntries()
                              throws IOException
Overrides:
countRemoteDeletedEntries in class Synchronizer
Throws:
IOException

getRemoteDeletedEntry

public long getRemoteDeletedEntry(int index)
                           throws IOException
Overrides:
getRemoteDeletedEntry in class Synchronizer
Throws:
IOException

eraseDeletedOnRemote

public void eraseDeletedOnRemote(int index)
                          throws IOException
Overrides:
eraseDeletedOnRemote in class Synchronizer
Throws:
IOException

eraseEntryOnRemote

public void eraseEntryOnRemote(long OID)
                        throws IOException
Overrides:
eraseEntryOnRemote in class Synchronizer
Throws:
IOException

countDeleted

public int countDeleted()
                 throws IOException
Throws:
IOException

getDeleted

public long getDeleted(int index)
                throws IOException
Throws:
IOException

eraseDeleted

public void eraseDeleted(int index)
                  throws IOException
Throws:
IOException

eraseEntry

public void eraseEntry(long oid)
                throws IOException
Throws:
IOException

markAsSynchronized

public void markAsSynchronized(int index)
                        throws IOException
This is called remotely by the controlling synchronizer.

Throws:
IOException

countUnsynced

public int countUnsynced()
                  throws IOException
Throws:
IOException

getUnsynced

public byte[] getUnsynced(int index)
                   throws IOException
Throws:
IOException

acceptEntry

public void acceptEntry(byte[] data)
                 throws IOException
Throws:
IOException

synchronizeOnRemoteConnection

public static RemoteSynchronizer synchronizeOnRemoteConnection(String databaseName,
                                                               String[] remoteEweApplications,
                                                               TimeOut timeout,
                                                               int makeOptions)
                                                        throws IOException,
                                                               TimedOutException,
                                                               InterruptedException
Throws:
IOException
TimedOutException
InterruptedException

synchronizeOnRemoteConnection

public static RemoteSynchronizer synchronizeOnRemoteConnection(String databaseName,
                                                               String remoteEweApplication,
                                                               TimeOut timeout,
                                                               int makeOptions)
                                                        throws IOException,
                                                               TimedOutException,
                                                               InterruptedException
Throws:
IOException
TimedOutException
InterruptedException

synchronize

public Handle synchronize(String desktopMessage,
                          String mobileMessage)