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    /**
034     * Get the identifier for the described resource.
035     *
036     * @return identifier for the resource.
037     */
038    FedoraId getId();
039
040    /**
041     * Get the identifier of the parent of the resource
042     *
043     * @return identifier of the parent
044     */
045    FedoraId getParent();
046
047    /**
048     * Get the identifier of the archival group resource that contains this resource, or null if the resource is not
049     * an archival part resource
050     *
051     * @return identifier of the containing archival group resource or null
052     */
053    FedoraId getArchivalGroupId();
054
055    /**
056     * Get the State Token value for the resource.
057     *
058     * @return state-token value
059     */
060    String getStateToken();
061
062    /**
063     * Get the interaction model for the resource
064     *
065     * @return interaction model URI
066     */
067    String getInteractionModel();
068
069    /**
070     * Get the mimetype describing the content contained by this resource
071     *
072     * @return mimetype
073     */
074    String getMimeType();
075
076    /**
077     * Get the filename for the content of this resource
078     *
079     * @return filename
080     */
081    String getFilename();
082
083    /**
084     * Get the size in bytes of the content of this resource. May be -1 if the size is unknown or there is no content.
085     *
086     * @return size
087     */
088    long getContentSize();
089
090    /**
091     * Get the list of all digest URIs recorded for this resource
092     *
093     * @return digest URIs
094     */
095    Collection<URI> getDigests();
096
097    /**
098     * Get the url of external content associated with this resource.
099     *
100     * @return external url
101     */
102    String getExternalUrl();
103
104    /**
105     * Get the handling type for external content associated with this resource.
106     *
107     * @return external handling value
108     */
109    String getExternalHandling();
110
111    /**
112     * Get the date this resource was created
113     *
114     * @return created date
115     */
116    Instant getCreatedDate();
117
118    /**
119     * Get the created by for the resource
120     *
121     * @return created by
122     */
123    String getCreatedBy();
124
125    /**
126     * Get the date this resource was last modified
127     *
128     * @return last modified date
129     */
130    Instant getLastModifiedDate();
131
132    /**
133     * Get the last modified by value for the resource
134     *
135     * @return last modified by
136     */
137    String getLastModifiedBy();
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}