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 */ 006package org.fcrepo.kernel.api.models; 007 008import org.fcrepo.kernel.api.identifiers.FedoraId; 009 010import java.net.URI; 011import java.time.Instant; 012import java.util.Collection; 013 014/** 015 * Header information for fedora resources. 016 * 017 * @author bbpennel 018 */ 019public interface ResourceHeaders { 020 021 String V1_0 = "1.0"; 022 023 /** 024 * Get the identifier for the described resource. 025 * 026 * @return identifier for the resource. 027 */ 028 FedoraId getId(); 029 030 /** 031 * Get the identifier of the parent of the resource 032 * 033 * @return identifier of the parent 034 */ 035 FedoraId getParent(); 036 037 /** 038 * Get the identifier of the archival group resource that contains this resource, or null if the resource is not 039 * an archival part resource 040 * 041 * @return identifier of the containing archival group resource or null 042 */ 043 FedoraId getArchivalGroupId(); 044 045 /** 046 * Get the State Token value for the resource. 047 * 048 * @return state-token value 049 */ 050 String getStateToken(); 051 052 /** 053 * Get the interaction model for the resource 054 * 055 * @return interaction model URI 056 */ 057 String getInteractionModel(); 058 059 /** 060 * Get the mimetype describing the content contained by this resource 061 * 062 * @return mimetype 063 */ 064 String getMimeType(); 065 066 /** 067 * Get the filename for the content of this resource 068 * 069 * @return filename 070 */ 071 String getFilename(); 072 073 /** 074 * Get the size in bytes of the content of this resource. May be -1 if the size is unknown or there is no content. 075 * 076 * @return size 077 */ 078 long getContentSize(); 079 080 /** 081 * Get the list of all digest URIs recorded for this resource 082 * 083 * @return digest URIs 084 */ 085 Collection<URI> getDigests(); 086 087 /** 088 * Get the url of external content associated with this resource. 089 * 090 * @return external url 091 */ 092 String getExternalUrl(); 093 094 /** 095 * Get the handling type for external content associated with this resource. 096 * 097 * @return external handling value 098 */ 099 String getExternalHandling(); 100 101 /** 102 * Get the date this resource was created 103 * 104 * @return created date 105 */ 106 Instant getCreatedDate(); 107 108 /** 109 * Get the created by for the resource 110 * 111 * @return created by 112 */ 113 String getCreatedBy(); 114 115 /** 116 * Get the date this resource was last modified 117 * 118 * @return last modified date 119 */ 120 Instant getLastModifiedDate(); 121 122 /** 123 * Get the last modified by value for the resource 124 * 125 * @return last modified by 126 */ 127 String getLastModifiedBy(); 128 129 /** 130 * Get the date a memento for this resource was created. This field should generally be kept in sync with the 131 * last modified date, but they may not be the same, in the case that a memento was created as a result of an 132 * update to a different resource. Additionally, this date is NOT the same as the actual memento timestamp, which 133 * is determined by the timestamp on the OCFL version. 134 * 135 * @return memento created date 136 */ 137 Instant getMementoCreatedDate(); 138 139 /** 140 * Determine whether a resource is an Archival Group 141 * @return Archival Group status 142 */ 143 boolean isArchivalGroup(); 144 145 /** 146 * Determine whether a resource is the object root 147 * @return true if the resource is at the root of a persistence object 148 */ 149 boolean isObjectRoot(); 150 151 /** 152 * Determine if the resource is now a tombstone. 153 * @return Deleted status. 154 */ 155 boolean isDeleted(); 156 157 /** 158 * Returns the path to the content file the resource headers are associated with 159 * @return path the content file 160 */ 161 String getContentPath(); 162 163 /** 164 * @return the header version 165 */ 166 String getHeadersVersion(); 167 168}