Class BagItReplicateConsumer

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

    public class BagItReplicateConsumer
    extends Object
    implements org.dspace.event.Consumer
    BagItReplicateConsumer is an event consumer that tracks events relevant to replication synchronization. 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.
    Author:
    richardrodgers
    • Constructor Detail

      • BagItReplicateConsumer

        public BagItReplicateConsumer()
    • 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