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
009import java.util.List;
010
011/**
012 * Represents a version of a Fedora 3 object.
013 *
014 * TODO: perhaps the audit trail should be parsed and exposed here
015 * @author mdurbin
016 */
017public interface ObjectVersionReference {
018
019    /**
020     * @return the ObjectReference object that encapsulates everything about
021     * the underlying Fedora 3 object.
022     */
023    public ObjectReference getObject();
024
025    /**
026     * @return all the object properties.  This is unversioned information.
027     */
028    public ObjectProperties getObjectProperties();
029
030    /**
031     * @return the lastModifiedDate proeperty for this version.  This is formatted as
032     * all Fedora 3 dates are formatted.
033     */
034    public String getVersionDate();
035
036    /**
037     * Lists the current version of all datastreams changed from the pervious version
038     * to this one.
039     * @return a List containing a DatastreamVersion for each datastream that changed
040     * from the last version to this one.
041     */
042    public List<DatastreamVersion> listChangedDatastreams();
043
044    /**
045     * @return true if this is the first version.
046     */
047    public boolean isLastVersion();
048
049    /**
050     * @return true if this is the last version.
051     */
052    public boolean isFirstVersion();
053
054    /**
055     * @return the version index (0 for first, 1 for second, etc.) in chronological
056     * order from oldest to newest.
057     */
058    public int getVersionIndex();
059
060    /**
061     * @param dsId of datastream to be tested for change.
062     *
063     * @return true if datastream with the given DSID changed as part of the
064     * update that contributed to this version.
065     */
066    public boolean wasDatastreamChanged(String dsId);
067}