001/*
002 *    GeoAPI - Java interfaces for OGC/ISO standards
003 *    Copyright © 2004-2023 Open Geospatial Consortium, Inc.
004 *    http://www.geoapi.org
005 *
006 *    Licensed under the Apache License, Version 2.0 (the "License");
007 *    you may not use this file except in compliance with the License.
008 *    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.opengis.metadata.identification;
019
020import java.net.URI;
021import java.util.Collection;
022import java.util.Collections;
023import org.opengis.util.InternationalString;
024import org.opengis.metadata.citation.OnlineResource;
025import org.opengis.metadata.constraint.Constraints;
026import org.opengis.metadata.distribution.DataFile;
027import org.opengis.annotation.UML;
028
029import static org.opengis.annotation.Obligation.*;
030import static org.opengis.annotation.Specification.*;
031
032
033/**
034 * Graphic that provides an illustration of the dataset (including a legend for the graphic, if applicable).
035 * The graphic means a dataset, an organisation logo, security constraint or citation.
036 *
037 * @author  Martin Desruisseaux (IRD)
038 * @author  Rémi Maréchal (Geomatys)
039 * @version 3.1
040 * @since   2.0
041 */
042@UML(identifier="MD_BrowseGraphic", specification=ISO_19115)
043public interface BrowseGraphic {
044    /**
045     * Name of the file that contains a graphic that provides an illustration of the resource.
046     *
047     * @departure integration
048     *   ISO 19115 type is {@code CharacterString}. Since the specification clearly states that the
049     *   string shall be a filename, a more specific Java type like {@code URI} seem appropriate.
050     *
051     * @see DataFile#getFileName()
052     *
053     * @return file that contains a graphic that provides an illustration of the resource.
054     */
055    @UML(identifier="fileName", obligation=MANDATORY, specification=ISO_19115)
056    URI getFileName();
057
058    /**
059     * Text description of the illustration.
060     *
061     * @see DataFile#getFileDescription()
062     *
063     * @return text description of the illustration, or {@code null}.
064     */
065    @UML(identifier="fileDescription", obligation=OPTIONAL, specification=ISO_19115)
066    default InternationalString getFileDescription() {
067        return null;
068    }
069
070    /**
071     * Format in which the illustration is encoded.
072     * Raster formats are encouraged to use one of the names returned by
073     * {@link javax.imageio.ImageIO#getReaderFormatNames()}.
074     *
075     * <div class="note"><b>Example:</b>
076     * CGM, EPS, GIF, JPEG, PBM, PS, TIFF, XWD.
077     * </div>
078     *
079     * @return format in which the illustration is encoded, or {@code null}.
080     *
081     * @see DataFile#getFileType()
082     * @see javax.imageio.ImageIO#getReaderFormatNames()
083     */
084    @UML(identifier="fileType", obligation=OPTIONAL, specification=ISO_19115)
085    default String getFileType() {
086        return null;
087    }
088
089    /**
090     * Restriction on access and / or use of browse graphic.
091     * Returns an empty collection if none.
092     *
093     * @return restriction on access and / or use of browse graphic.
094     *
095     * @since 3.1
096     */
097    @UML(identifier="imageConstraints", obligation=OPTIONAL, specification=ISO_19115)
098    default Collection<? extends Constraints> getImageConstraints() {
099        return Collections.emptyList();
100    }
101
102    /**
103     * Links to browse graphic.
104     * Returns an empty collection if none.
105     *
106     * @return links to browse graphic.
107     *
108     * @since 3.1
109     */
110    @UML(identifier="linkage", obligation=OPTIONAL, specification=ISO_19115)
111    default Collection<? extends OnlineResource> getLinkages() {
112        return Collections.emptyList();
113    }
114}