adding @Transient
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IMediaService.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.cdm.api.service;
12
13 import java.io.IOException;
14 import java.net.URI;
15 import java.util.List;
16 import java.util.Map;
17 import java.util.Set;
18
19 import org.apache.http.HttpException;
20
21 import eu.etaxonomy.cdm.api.service.pager.Pager;
22 import eu.etaxonomy.cdm.common.mediaMetaData.ImageMetaData;
23 import eu.etaxonomy.cdm.model.description.MediaKey;
24 import eu.etaxonomy.cdm.model.location.NamedArea;
25 import eu.etaxonomy.cdm.model.media.Media;
26 import eu.etaxonomy.cdm.model.media.Rights;
27 import eu.etaxonomy.cdm.model.taxon.Taxon;
28 import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
29 import eu.etaxonomy.cdm.persistence.query.OrderHint;
30
31 public interface IMediaService extends IIdentifiableEntityService<Media> {
32
33 /**
34 * Return a List of MediaKeys, optionally filtered by the parameters passed.
35 *
36 * @param taxonomicScope a Set of Taxon instances that define the taxonomic scope of the key (can be null)
37 * @param geoScopes a Set of NamedArea instances that define the geospatial scope of the key (can be null)
38 * @param pageSize The maximum number of keys returned (can be null for all keys)
39 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
40 * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}
41 * @return a Pager containing MediaKey instances
42 */
43 public Pager<MediaKey> getMediaKeys(Set<Taxon> taxonomicScope, Set<NamedArea> geoScopes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
44
45 /**
46 * Return a Pager of rights belonging to this object
47 *
48 * @param t The media object
49 * @param pageSize The maximum number of rights returned (can be null for all rights)
50 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
51 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
52 * @return a Pager of Rights entities
53 */
54 public Pager<Rights> getRights(Media t, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
55
56 /**
57 * Returns a Paged List of Media instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
58 *
59 * @param clazz filter the results by class (or pass null to return all Media instances)
60 * @param queryString
61 * @param pageSize The maximum number of media returned (can be null for all matching media)
62 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
63 * @param orderHints
64 * Supports path like <code>orderHints.propertyNames</code> which
65 * include *-to-one properties like createdBy.username or
66 * authorTeam.persistentTitleCache
67 * @param propertyPaths properties to be initialized
68 * @return a Pager Media instances
69 * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
70 */
71 public Pager<Media> search(Class<? extends Media> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
72
73 /**
74 *
75 *
76 * @param imageUri
77 * @param timeOut
78 * @return
79 */
80 public Integer getImageSize(URI imageUri, Integer timeOut);
81
82 /**
83 *
84 * @param imageUri
85 * @param timeOut
86 * @return
87 * @throws IOException
88 */
89 public ImageMetaData getImageInfo(URI imageUri, Integer timeOut) throws IOException, HttpException;
90
91 /**
92 *
93 * @param imageUri
94 * @param timeOut
95 * @return
96 * @throws IOException
97 */
98 public Map<String,String> getImageMetaData(URI imageUri, Integer timeOut) throws IOException, HttpException;
99 }