View Javadoc
1   /*
2    * Licensed to The Apereo Foundation under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional
4    * information regarding copyright ownership.
5    *
6    *
7    * The Apereo Foundation licenses this file to you under the Educational
8    * Community License, Version 2.0 (the "License"); you may not use this file
9    * except in compliance with the License. You may obtain a copy of the License
10   * at:
11   *
12   *   http://opensource.org/licenses/ecl2.txt
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   *
20   */
21  package org.opencastproject.oaipmh.persistence;
22  
23  import org.opencastproject.mediapackage.MediaPackage;
24  import org.opencastproject.metadata.dublincore.DublinCoreCatalog;
25  
26  import java.util.Date;
27  import java.util.List;
28  
29  /**
30   * An item that was found as part of a search. Typically a {@link SearchResultItem} will be included in a
31   * {@link SearchResult}
32   */
33  public interface SearchResultItem {
34  
35    /** @return the media package id */
36    String getId();
37  
38    /** @return the media package */
39    MediaPackage getMediaPackage();
40  
41    /** @return the serialized media package */
42    String getMediaPackageXml();
43  
44    /** @return the organization id */
45    String getOrganization();
46  
47    /** @return the repository id */
48    String getRepository();
49  
50    /** @return the last modification date */
51    Date getModificationDate();
52  
53    /** Return <code>true</code> if the mediapackage has been deleted. */
54    boolean isDeleted();
55  
56    /** @return the list of media package search result elements belongs to this media package */
57    List<SearchResultElementItem> getElements();
58  
59    /**
60     * @return the episode dublincore catalog if it was published with this media package
61     * @throws OaiPmhDatabaseException if the episode dublincore catalog wasn't published with this media package
62     *            or if the dublincore catalog can not be parsed
63     */
64    DublinCoreCatalog getEpisodeDublinCore() throws OaiPmhDatabaseException;
65  
66    /**
67     * @return the series dublincore catalog if it was published with this media package
68     * @throws OaiPmhDatabaseException if the series dublincore catalog wasn't published with this media package
69     *            or if the dublincore catalog can not be parsed
70     */
71    DublinCoreCatalog getSeriesDublinCore() throws OaiPmhDatabaseException;
72  
73    List<String> getSetSpecs();
74  
75    void addSetSpec(String setSpec);
76  }