5.5 Updating the Target Digest
The target digest can be updated after every entry processed on the target side. The digest tick for the entry’s endpoint should be increased to the value just above the entry’s tick.
The following table shows how the target digest should be updated after processing the first and second entries of our example feed:
sageApp1 | sageApp2 | sageApp3 | |
---|---|---|---|
target digest before entry #1 | 5 | 11 | 8 |
feed entry #1 | 5 | ||
target digest before entry #2 | 6 | 11 | 8 |
feed entry #2 | 8 | ||
target digest after entry #2 | 6 | 11 | 9 |
If the feed’s <syncMode> element is set to catchUp, the target should perform an additional check on its digest at the end of the feed (end of last page). In this case, it should set the tick of all its digest entries to the maximum value of the source and target digest ticks, if necessary. Usually, this update will not be necessary because the tick updates performed after processing every entry (see table above) will have brought the target digest in the right state, but there are situations where some target ticks will be lower than the corresponding source ticks at the end of the feed, and they must be adjusted.
The following table shows an example of how the target digest should be updated at the end of the feed.
sageApp1 | sageApp2 | sageApp3 | |
---|---|---|---|
target digest before | 6 | 11 | 9 |
source digest | 6 | 10 | 10 |
target digest after | 6 | 11 | 10 |
A provider exposing a $syncTarget URL for resource kind MUST conform to the digest update mechanism described in this section.