SoC:RoamingSupport: Difference between revisions

Line 7: Line 7:


=== The Sync Service ===
=== The Sync Service ===
This service will be the control center for sync updates and notifications. Classes who are interested in syncing would implement an observer interface (ex. <code>|nsIObserver|</code>). An interface would register itself based on the type of data that it uses. The Sync Service would handle all of the transactions between the observed data objects and the delta update messages.
A new service will be introduced into the mailnews component, called <code>nsIMsgRoamingService</code>. This service will delegate notifications between the data classes and roaming update messages. There are two paths of data through the roaming service, as illustrated below:


This service would also handle the dispatching of update messages. Ideally, another class would handle the gory details for message creation and maintenance of the delta messages and the full sync message.
Here is a high-level flowchart for the application events from and to the Sync Service:
<div style="text-align: center">[[Image:Flow_dataObjects.png]]</div>
<div style="text-align: center">[[Image:Flow_dataObjects.png]]</div>
Note: A "data class" is a interface that controls anything that we want synced, like an <code>|nsIMsgFolder|</code>.
Note: A "data class" is a interface that controls anything that we want synced, like an <code>|nsIMsgFolder|</code>.
The roaming service uses the <code>nsIObserverService</code> to handle passing updates to the data classes. The designated topics for the roaming service can be found in <code>nsMsgRoamingConstants.h</code>.
The roaming service also maintains the list of update messages that are stored on either the IMAP folder or the POP3 inbox. A typical set of update messages consists of one full update message, followed by a preset number of delta update messages. This setup is illustrated below:
<div style="text-align: center">[[Image:update_messages.png]]</div>


=== Delta Update Messages ===
=== Delta Update Messages ===
26

edits