001/*
002 * Copyright 2015 DuraSpace, Inc.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.fcrepo.migration;
017
018import java.util.List;
019
020/**
021 * Represents a version of a Fedora 3 object.
022 *
023 * TODO: perhaps the audit trail should be parsed and exposed here
024 * @author mdurbin
025 */
026public interface ObjectVersionReference {
027
028    /**
029     * @return the ObjectReference object that encapsulates everything about
030     * the underlying Fedora 3 object.
031     */
032    public ObjectReference getObject();
033
034    /**
035     * @return all the object properties.  This is unversioned information.
036     */
037    public ObjectProperties getObjectProperties();
038
039    /**
040     * @return the lastModifiedDate proeperty for this version.  This is formatted as
041     * all Fedora 3 dates are formatted.
042     */
043    public String getVersionDate();
044
045    /**
046     * Lists the current version of all datastreams changed from the pervious version
047     * to this one.
048     * @return a List containing a DatastreamVersion for each datastream that changed
049     * from the last version to this one.
050     */
051    public List<DatastreamVersion> listChangedDatastreams();
052
053    /**
054     * @return true if this is the first version.
055     */
056    public boolean isLastVersion();
057
058    /**
059     * @return true if this is the last version.
060     */
061    public boolean isFirstVersion();
062
063    /**
064     * @return the version index (0 for first, 1 for second, etc.) in chronological
065     * order from oldest to newest.
066     */
067    public int getVersionIndex();
068
069    /**
070     * @param dsId of datastream to be tested for change.
071     *
072     * @return true if datastream with the given DSID changed as part of the
073     * update that contributed to this version.
074     */
075    public boolean wasDatastreamChanged(String dsId);
076}