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