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 State Token value for the resource.
049     *
050     * @return state-token value
051     */
052    String getStateToken();
053
054    /**
055     * Get the interaction model for the resource
056     *
057     * @return interaction model URI
058     */
059    String getInteractionModel();
060
061    /**
062     * Get the mimetype describing the content contained by this resource
063     *
064     * @return mimetype
065     */
066    String getMimeType();
067
068    /**
069     * Get the filename for the content of this resource
070     *
071     * @return filename
072     */
073    String getFilename();
074
075    /**
076     * Get the size in bytes of the content of this resource. May be -1 if the size is unknown or there is no content.
077     *
078     * @return size
079     */
080    long getContentSize();
081
082    /**
083     * Get the list of all digest URIs recorded for this resource
084     *
085     * @return digest URIs
086     */
087    Collection<URI> getDigests();
088
089    /**
090     * Get the url of external content associated with this resource.
091     *
092     * @return external url
093     */
094    String getExternalUrl();
095
096    /**
097     * Get the handling type for external content associated with this resource.
098     *
099     * @return external handling value
100     */
101    String getExternalHandling();
102
103    /**
104     * Get the date this resource was created
105     *
106     * @return created date
107     */
108    Instant getCreatedDate();
109
110    /**
111     * Get the created by for the resource
112     *
113     * @return created by
114     */
115    String getCreatedBy();
116
117    /**
118     * Get the date this resource was last modified
119     *
120     * @return last modified date
121     */
122    Instant getLastModifiedDate();
123
124    /**
125     * Get the last modified by value for the resource
126     *
127     * @return last modified by
128     */
129    String getLastModifiedBy();
130
131    /**
132     * Determine whether a resource is an Archival Group
133     * @return Archival Group status
134     */
135    boolean isArchivalGroup();
136
137    /**
138     * Determine whether a resource is the object root
139     * @return
140     */
141    boolean isObjectRoot();
142
143    /**
144     * Determine if the resource is now a tombstone.
145     * @return Deleted status.
146     */
147    boolean isDeleted();
148
149    /**
150     * Returns the path to the content file the resource headers are associated with
151     * @return path the content file
152     */
153    String getContentPath();
154
155}