In order to understand Sync4J (also named Funambol), there are many hooks
to use. First of all, the funambol data service server developer book to
understand the architecture. After reading this paper, I needed to
completely dive into Sync4J code. Hopefully, they provide an email connector
to have an example.


From now and in the following Sync4J posts, I'll write some notes about
Sync4J development and difficulties I've met.




  • First problem was to find how to get the credentials specified in the
    SyncML specs to authenticate on the JCR. Here is an interesting piece of
    code inspired from the email connector source:




String username = ((Sync4jPrincipal)principal).getUsername();
String credentials = ((Sync4jPrincipal)principal).getEncodedCredentials();
String password = Helper.getPassword(username, credentials);


The credentials are formatted in the following way:
"username:password" and encrypted. To decrypt, there is only to use
the Base64.decode() method. The login to the repository will be done
during the synchronization initialisation (beginSync())



  • An other point to think about is to create a testing framework in order
    to test the connection between Sync4J and a JackRabbit implementation of
    JCR.



(Post originally written by Cedric Bosdonnat on the old Nuxeo blogs.)