Class METSReplicateConsumer

  • All Implemented Interfaces:
    org.dspace.event.Consumer

    public class METSReplicateConsumer
    extends Object
    implements org.dspace.event.Consumer
    METSReplicateConsumer is an event consumer that tracks events relevant to replication synchronization when using METS AIPs. In response to deletions, it creates and transmits a catalog of deleted objects (so they may be restored if deletion was an error). For new or changed objects, it queues a request to perform the configured curation tasks, or directly performs the task if so indicated.

    This replicate consumer performs the following special actions:

    • If a Group/Eperson is changed/added/removed, this is considered a modification of the SITE object
    • When a child object is added/removed, this is also considered a modification of its parent object
    • Similar to other ReplicateConsumers, it also just performs the configured tasks on any object that is modified/added/removed

    This Consumer should be used with the settings similar to the following in your dspace.cfg file:

    # consumer to manage content replication (Replication Task Suite add-on) event.consumer.replicate.class = org.dspace.ctask.replicate.METSReplicateConsumer event.consumer.replicate.filters = Community|Collection|Item|Group|EPerson+All

    Author:
    tdonohue, richardrodgers
    • Constructor Detail

      • METSReplicateConsumer

        public METSReplicateConsumer()
    • Method Detail

      • initialize

        public void initialize()
                        throws Exception
        Specified by:
        initialize in interface org.dspace.event.Consumer
        Throws:
        Exception
      • consume

        public void consume​(org.dspace.core.Context ctx,
                            org.dspace.event.Event event)
                     throws Exception
        Consume a content event. At a high level, 2 sorts of actions are performed: first, for all new or modified objects, the object handle is added to a set of objects to be processed. When a Curator batch next runs, this list will be read and whatever tasks are configured to be performed will be. Typically, a new AIP will be generated and uploaded to the replication service. Second, for deletions, the event stream is parsed to construct a 'delete catalog' containing an enumeration of the objects that are being deleted. This also is uploaded to the replication service, and can be used either to recover from mistaken deletions, or purge the replica store when desired.
        Specified by:
        consume in interface org.dspace.event.Consumer
        Parameters:
        ctx - Context
        event - Event
        Throws:
        Exception - if error
      • end

        public void end​(org.dspace.core.Context ctx)
                 throws Exception
        Specified by:
        end in interface org.dspace.event.Consumer
        Throws:
        Exception
      • finish

        public void finish​(org.dspace.core.Context ctx)
                    throws Exception
        Specified by:
        finish in interface org.dspace.event.Consumer
        Throws:
        Exception