001/** 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 * 006 */ 007package org.fcrepo.migration; 008 009/** 010 * An interface with methods that are meant to be invoked when processing 011 * a fedora 3 object such that every bit of information in that fedora 3 012 * object is exposed to the instance implementing this interface. 013 * 014 * Instances of this class are expected to be used for a single fedora 015 * object, and method calls should not require implementations to maintain 016 * state. 017 * @author mdurbin 018 */ 019public interface StreamingFedoraObjectHandler { 020 021 /** 022 * begin object. 023 * @param object the object info 024 */ 025 public void beginObject(ObjectInfo object); 026 027 /** 028 * Invoked to allow processing of properties by this StreamingFedoraObjectHandler. 029 * @param properties the properties for the object 030 */ 031 public void processObjectProperties(ObjectProperties properties); 032 033 /** 034 * Invoked to allow processing of a datastream by this StreamingFedoraObjectHandler. 035 * @param dsVersion an encapsulation of the datastream version. References to this object must 036 * not be used after completeObject() or abortObject() have completed as 037 * the resources exposed may no longer be available. 038 */ 039 public void processDatastreamVersion(DatastreamVersion dsVersion); 040 041 /** 042 * A hook called after the object has been completely processed. This may be useful for any cleanup or 043 * finalization routines. Furthermore, once this method invocation is complete, any references 044 * provided to prior calls will no longer be in scope. 045 * 046 * @param object to be completed. 047 */ 048 public void completeObject(ObjectInfo object); 049 050 /** 051 * Invoked if processing of the object failed for some reason. 052 * 053 * @param object to be aborted. 054 */ 055 public void abortObject(ObjectInfo object); 056}