r10 - 13 Feb 2007 - 15:10:24 - BrianMoseleyYou are here: OSAF >  Journal Web  >  ContributorNotes > BrianMoseleyNotes > BrianMoseleyCosmoMorseCode

Cosmo 0.6 Morse Code

See CosmoMorseCode for the full protocol specification.

Code Design

MorseCodeServlet
handles network protocol, calls sync API methods on MorseCodeController
MorseCodeController
interface that provides sync API to fulfill fundamental operations - publish, update, subscribe, synchronize, delete
StandardMorseCodeController
implements MorseCodeController in terms of the Cosmo service and security APIs
ItemState and ItemStateSet
model the item states sent to and from the server; an item state is represented as one or more EIM records
SyncToken
model the sync token, which is the pair (timestamp in milliseconds , hash of aggregate collection state), serialized over the wire as <timestamp>-<hash>

Sync Algorithm

On a sync request, StandardMorseCodeController does the following:

  1. Check to see if the sync token is still valid for the collection by comparing the hash in the token to the hash of the collection's current state - if they are equal, then the token is still valid and no data is returned, but if not, the token is invalid and changes need to be sent back
  2. For the collection itself, and for each member item (excluding subcollections), check to see if the item has changed since the sync token was generated by comparing the timstamp in the token to the last modified timestamp on the item - if the item has changed, its current state is returned

Possible Performance Improvements

  • service method to calculate aggregate collection hash and implement with SQL
  • service method to retrieve all child items that have changed since some timestamp and implement with SQL
  • binary protocol
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r10 < r9 < r8 < r7 < r6 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.