Resource Menu


The LibreSource Synchronizer provides the management of queues of patchfiles. The interface of a LibreSource Synchronizer is fairly simple:

package org.libresource.so6.core.client;

public interface ClientI { public long getLastTicket() throws Exception; public String getPatch(long ticket) throws Exception; public void sendPatch(long ticket, long lastticket, String patchfile) throws Exception; public long[][] listPatch() throws Exception;

public void addBinExt(String ext) throws Exception; public void removeBinExt(String ext) throws Exception; public String getBinExt() throws Exception; }

Each operation in a queue is globally ordered with a unique timestamp.

  • The getLastTicket() method return the last ticket delivered by the Synchronizer.
  • The getPatch(long ticket) methods return a XML file that contain the patch. ticket must correspond to a patch file beginning at this ticket.
  • The sendPatch(long ticket,long lastticket,String patchfile) method allow to send a patch file. The Patch file is accepted by the server if ticket corresponds to getLastTicket()+1.
  • The listPatch() method return an array containing the list of patches. If the Synchronizer contains two patches 1-200,201-300, then
long[0][0]=1
long[0][1]=200
long[1][0]=201
long[1][1]=300
  • the BinExt interface contain extension of files that must be considered as binary files. If you call addBinExt("exe"), then all files ending with ".exe" will be considered as binary. If "toto.exe" was detected before as a text files, then a type change is done (see section ////)
  • removeBinExt("exe") will remove it from list.
  • getBinExt() will give a String containing all the extensions.
If you implement this interface, then you will provide a new LibreSource Synchronizer. We did that what we call the "dummyClient", a LibreSource Synchronizer in a shared directory, and the "lsclient" a Synchronizer on LibreSource server.


Last edited by Root at Mar 25, 2007 12:03 AM - Edit content - View source