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 basic object information. This is unversioned information. 036 */ 037 public ObjectInfo getObjectInfo(); 038 039 /** 040 * @return all the object properties. This is unversioned information. 041 */ 042 public ObjectProperties getObjectProperties(); 043 044 /** 045 * @return the lastModifiedDate proeperty for this version. This is formatted as 046 * all Fedora 3 dates are formatted. 047 */ 048 public String getVersionDate(); 049 050 /** 051 * Lists the current version of all datastreams changed from the pervious version 052 * to this one. 053 * @return a List containing a DatastreamVersion for each datastream that changed 054 * from the last version to this one. 055 */ 056 public List<DatastreamVersion> listChangedDatastreams(); 057 058 /** 059 * @return true if this is the first version. 060 */ 061 public boolean isLastVersion(); 062 063 /** 064 * @return true if this is the last version. 065 */ 066 public boolean isFirstVersion(); 067 068 /** 069 * @return the version index (0 for first, 1 for second, etc.) in chronological 070 * order from oldest to newest. 071 */ 072 public int getVersionIndex(); 073 074 /** 075 * @param dsId of datastream to be tested for change. 076 * 077 * @return true if datastream with the given DSID changed as part of the 078 * update that contributed to this version. 079 */ 080 public boolean wasDatastreamChanged(String dsId); 081}