Event Mechanism for Modifications to DSpace Object Model

lcs 23-May-06

This wiki page proposes a new piece of the DSpace core API to monitor all object model modification events.

Introduction: What is it?

The event mechanism is a means to to notify any designated "receiver" (i.e. run some code) whenever there is a change in the state of the DSpace archive's object model. "Change" means any addition, modification, or deletion of the content and metadata objects such as Items, Bitstreams, Collections, etc.

An "event" is a formal description of a change to the state of the archive; it has a precise and detailed description of what changed. Events can be categorized and filtered

Sketches of "use cases": Where does Event Mechanism fit in?

The first three of these (history, search, and browse) are the only ones planned to be implemented at first.
*New History system - The History recorder is a consumer of events. It only records changes to persistent objects (Item, Bitstream, etc) so it filters out events on e.g. `BitstreamFormat`s. Since the event itself contains all data needed for the History record, it does not need to look up anything in the database. History recording will probably run asynchronously.
*Search Index updating - Automatically update the search indexes when content and/or metadata changes. Driving this function with events gives us the option of making it asynchronous, so applications that make many changes (e.g. ingesting many packages or making several changes to an Item) can complete without waiting to rebuild indexes. It may also want to coalesce all the changes to an object that are close in time, so it can perform one update. The event model would also give us the option of doing index updates in a separate JVM or thread.
*Browse Index updating - just like search index updating, only maintaining the browse indexes. These are separate functional blocks with some subtle differences but their use of the event model is very similar.
*AIP updating - Rebuild AIP manifest after an Item (or Collection, Community) has been changed. Doing this in response to events rather than synchronously has several advantages:

Implementation Issues

Prototypes