Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Data Synchronization with SyncML * and sync4j Sean C.

Similar presentations


Presentation on theme: "Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Data Synchronization with SyncML * and sync4j Sean C."— Presentation transcript:

1 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Data Synchronization with SyncML * and sync4j Sean C. Sullivan at

2 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Agenda l Data synchronization l SyncML l sync4j l Q & A

3 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners What is data synchronization? Data synchronization “is the process of making two sets of data look identical” (syncml.org whitepaper)

4 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Data Synchronization l Conflict resolution Datastore1 l Data modifications Datastore2 ACBCABACB

5 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners What is a “data synchronization protocol”? l Communication syntax and semantics for a data synchronization session l Protocol includes: –naming and identification of records –common protocol commands –identification and resolution of synchronization conflicts

6 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML defined… “SyncML is a new industry initiative to develop and promote a single, common data synchronization protocol that can be used industry-wide.” (syncml.org) “SyncML is a specification for a common data synchronization framework and XML-based format […] for synchronizing data on networked devices.” (syncml.org) “SyncML is a […] protocol for conveying data synchronization operations.” (syncml.org)

7 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML sponsors

8 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML: clients & servers SyncML server server modifications client modifications

9 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML data identification LUIDData 23A 382B 61C GUIDData 189A 3982B 89C Client Server GUIDLUID 18923 3982382 8961

10 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML Synchronization Types l Two-way sync l Slow sync l One-way sync from client only l Refresh sync from client only

11 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML Synchronization Types (cont.) l One-way sync from server only l Refresh sync from server only l Server alerted sync

12 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML features l Synchronize any type of data l Multiple protocol bindings –HTTP, WSP, OBEX l Security l Interoperability

13 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML terminology l Message l Package l Command l Status code l Datastore l Device Info l Meta Info l Capabilities exchange

14 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML and XML l Abbreviated naming convention –Ex: ”protocol version” is l XML prolog is not required l WBXML – WAP Binary XML

15 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML documents l DTD l Meta info DTD l Device info DTD

16 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners document … … l “A SyncML Message is a well-formed, but not necessarily valid, XML document.” (syncml.org) l Contains data synchronization commands (operations)

17 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners element 1.0 session41 msg80386 …

18 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners element cmd80486 …

19 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Meta Info document l Contains sync session parameters … 586 …

20 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Device Info document l Describes device capabilities l For both client and server … 0.99 3.14 … pda …

21 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML commands l Add l Alert l Atomic l Copy l Delete l Exec l Get l Map l Put l Replace l Results l Search l Sequence l Status l Sync

22 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j l Java implementation of SyncML protocol l sync4j client & sync4j Server l open source l designed for J2SE platform l http://sync4j.sourceforge.net

23 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Open source licensing l Licensing options: –GPL? –LGPL? –BSD? –Apache Public License? –JDOM public license? –Mozilla Public License (MPL)? l sync4j license is virtually identical to JDOM license

24 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j audience l developers who know Java but don’t know SyncML l developers who know SyncML but may not know Java l commercial application developers & open source application developers

25 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners API design ideas l SAX API –standard set of interfaces –multiple implementations –usage model: callbacks l JDOM API –concrete classes; single implementation –root Document object contains Element objects

26 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners API design ideas (cont.) l Servlet API –usage model: developer builds a new servlet by subclassing HTTPServlet l Auto-generate classes from DTD using an XML data-binding tool?? –Sun’s JAXB –Enhydra’s Zeus

27 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Design goals l Hide complexity of the SyncML specification from Java programmers –XML documents, XML parsing –multiple transport protocols l A complete SyncML implementation l Interoperability –with existing SyncML clients & servers

28 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Design goals (cont.) l API should be natural and familiar to Java programmers –direct object instantiation –exceptions –use Collection API / arrays, where appropriate –event notification via event listeners –familiar naming conventions

29 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Design goals (cont.) l API must be familiar to developers who already know the SyncML DTD’s l API must enforce any restrictions that are defined in the SyncML specification l Target platform: J2SE

30 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Design goals (cont.) l Modular design: –“core” protocol support –transport protocol libraries –extensible client framework –extensible server framework –client application –server application

31 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j implementation l Immutable objects l Exception class for each SyncML “status code” l Declaration of constants –public final static variables l Command object hierarchy

32 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j command hierarchy AbstractCommand ResponseCommandRequestCommand AddCommand, DeleteCommand, ReplaceCommand, … ResultsCommand, StatusCommand,

33 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j toolset ToolURL Jakarta Antjakarta.apache.org JDOMwww.jdom.org Apache Xerces-Jxml.apache.org CVSwww.cygwin.com log4jwww.log4j.org JDK 1.3.1java.sun.com JUnitwww.junit.org SourceForgewww.sourceforge.net

34 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j packages l sync4j.core l sync4j.client l sync4j.server l sync4j.http l sync4j.wsp l sync4j.obex l sync4j.tests

35 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j key classes l SyncMLMessage l DeviceInfo l MetaInfo l Command classes: –AddCommand –DeleteCommand –ReplaceCommand

36 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j.core.SyncMLMessage l Two ways to construct: –from a String of XML –from more basic sync4j objects

37 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncMLMessage example 1 String strXML = “ … ”; SyncMLMessage msg; try { msg = new SyncMLMessage(strXML); } catch (InvalidSyncMLException ex) { } catch (XMLSyntaxException ex) { }

38 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncMLMessage example 2 SyncHeader header = new SyncHeader(...); SyncBody body = new SyncBody(...); SyncMLMessage msg; msg = new SyncMLMessage(header, body); String strXML = msg.toXML();

39 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Algorithms l Base64 –encode, decode l WBXML –encode, decode l MD5 –java.security.MessageDigest

40 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners sync4j future issues l Compliance testing, interoperability tests l move to JDK 1.4? –Assert facility –Java Logging API –New I/O classes: java.nio –SSL class library

41 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Summary l SyncML is both complex and powerful l sync4j hides the complexity of SyncML from Java programmers l The sync4j API is consistent with many familiar Java programming idioms l http://sync4j.sourceforge.net/

42 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Data Synchronization with SyncML * and sync4j Sean C. Sullivan at

43 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners The following slides are miscellaneous material.

44 Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners SyncML authentication l l Authentication types: –basic –MD5


Download ppt "Copyright © 2001 Sean C. Sullivan* Third party trademarks are property of their respective owners Data Synchronization with SyncML * and sync4j Sean C."

Similar presentations


Ads by Google