Handler - notifyOfChange

 

Description

Detects changes in the content of any product that is part of the input products.

 

Configuration Variables

somethingChangedMessage
A string used as the id of the outgoing product when change is detected. The default message is " New or updated content." When something has changed the product description identifies how many items and the time of the check.

nothingChangedMessage

A string used as the id of the outgoing product when no change is detected. By default no notification is given. When nothing has changed the product description identifies the time of the check.

Product

The NotifyOfChange juggler produces a product containing only the changed products of the merged input product. The default action is to prune the product and remove unchanged elements but specifying the variables above creates a product with the id and description as specified above.

 

How it works

The NotifyOfChange juggler visits a clone of the input product in order to delete all unchanged basic products, which have been previously seen in the same or an earlier composite product.

The juggler calculates a message digest or CRC using SHA1 (secure hash algorithm #1), which analyzes the content of the product one byte at a time, and compares it to the previously calculated CRC. The message digest is a digital fingerprint of a block of data and will be different if any one byte is changed. If the CRC's are different, or if the CRC is being calculated for the first time (meaning that there is no previously calculated CRC available for comparison), the product is kept, otherwise the product is removed.

The CRC is dependent on the bytes of the content and not the content type such that if the contents of a file (assuming no CR, LF or EOF) exactly matches a String or URL then it is regarded as a duplicate and removed in order of traversal.

Old CRCs are deleted from the table of known file CRCs if they refer to items that no longer exist. They are not deleted immediately, however, to tolerate potential communications problems. It takes several "miss" detections (4) before the product is forgotten.

Revised 12 January 1999