Major changes to the cdmlib default term loading and initialization, plus free-text...
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IOccurrenceService.java
1 /**
2 * Copyright (C) 2008 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 */
6
7 package eu.etaxonomy.cdm.api.service;
8
9 import java.util.List;
10 import java.util.Map;
11 import java.util.UUID;
12
13 import eu.etaxonomy.cdm.api.service.pager.Pager;
14 import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
15 import eu.etaxonomy.cdm.model.media.Media;
16 import eu.etaxonomy.cdm.model.occurrence.Collection;
17 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
18 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
19 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
20
21 /**
22 * @author a.babadshanjan
23 * @created 01.09.2008
24 */
25 public interface IOccurrenceService extends IIdentifiableEntityService<SpecimenOrObservationBase> {
26
27 /**
28 * FIXME candidate for harmonization?
29 * Computes all specimen or observation bases.
30 * @param limit
31 * @param start
32 * @return
33 */
34 public abstract List<SpecimenOrObservationBase> getAllSpecimenOrObservationBases(int limit, int start);
35
36 /**
37 * FIXME candidate for harmonization?
38 * Saves a collection of specimen or observation bases.
39 * @return Map with UUID as key and SpecimenOrObservationBase as value.
40 */
41 public abstract Map<UUID, ? extends SpecimenOrObservationBase>
42 saveSpecimenOrObservationBaseAll(java.util.Collection<? extends SpecimenOrObservationBase> specimenOrObservationBaseCollection);
43
44 /**
45 * FIXME candidate for harmonizaion?
46 * save a specimen or observation and return its UUID
47 */
48 public abstract UUID saveSpecimenOrObservationBase (SpecimenOrObservationBase specimenOrObservationBase);
49
50 public WaterbodyOrCountry getCountryByIso(String iso639);
51
52 public List<WaterbodyOrCountry> getWaterbodyOrCountryByName(String name);
53
54 /** */
55 public abstract List<Collection> searchCollectionByCode(String code);
56
57 /**
58 * Returns a List of Media that are associated with a given occurence
59 *
60 * @param occurence the occurence associated with these media
61 * @param pageSize The maximum number of media returned (can be null for all related media)
62 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
63 * @return a Pager of media instances
64 */
65 public Pager<Media> getMedia(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber);
66
67 /**
68 * Returns a List of determinations that have been made for a given occurence
69 *
70 * @param occurence the occurence associated with these determinations
71 * @param pageSize The maximum number of determinations returned (can be null for all related determinations)
72 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
73 * @return a Pager of determination instances
74 */
75 public Pager<DeterminationEvent> getDeterminations(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber);
76
77 /**
78 * Returns a list of derivation events that have involved creating new DerivedUnits from this occurence
79 *
80 * @param occurence the occurence that was a source of these derivation events
81 * @param pageSize The maximum number of derivation events returned (can be null for all related derivation events)
82 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
83 * @return a Pager of derivation events
84 */
85 public Pager<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber);
86 }