Merge branch 'develop' into aggregation
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IRegistrationService.java
1 /**
2 * Copyright (C) 2017 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.api.service;
10
11 import java.util.Collection;
12 import java.util.List;
13 import java.util.Optional;
14 import java.util.Set;
15
16 import eu.etaxonomy.cdm.api.service.pager.Pager;
17 import eu.etaxonomy.cdm.model.common.User;
18 import eu.etaxonomy.cdm.model.name.Registration;
19 import eu.etaxonomy.cdm.model.name.RegistrationStatus;
20 import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase;
21 import eu.etaxonomy.cdm.model.reference.Reference;
22 import eu.etaxonomy.cdm.persistence.query.OrderHint;
23
24 /**
25 * @author a.kohlbecker
26 * @since May 2, 2017
27 *
28 */
29 public interface IRegistrationService extends IAnnotatableService<Registration> {
30
31 /**
32 * Returns a sublist of Registration instances stored in the database. A
33 * maximum of 'limit' objects are returned, starting at object with index
34 * 'start'. The bean properties specified by the parameter
35 * <code>propertyPaths</code> and recursively initialized for each of the
36 * entities in the resultset
37 *
38 * For detailed description and examples regarding
39 * <code>propertyPaths</code> <b>please refer to:</b>
40 * {@link IBeanInitializer#initialize(Object, List)}
41 *
42 * @param pageSize
43 * The maximum number of objects returned (can be null for all
44 * matching objects)
45 * @param pageNumber
46 * The offset (in pageSize chunks) from the start of the result
47 * set (0 - based, can be null, equivalent of starting at the
48 * beginning of the recordset)
49 * @param reference
50 * filters the Registration by the reference of the nomenclatural
51 * act for which the Registration as been created. The name and
52 * all type designations associated with the Registration are
53 * sharing the same citation. If the Optional itself is
54 * <code>null</code> the parameter is neglected. If Optional
55 * contains the value <code>null</code> all registrations with a
56 * name or type designation that has no reference are returned.
57 * Also those registrations having no name and type designation
58 * at all.
59 * @param includedStatus
60 * filters the Registration by the RegistrationStatus. Only
61 * Registration having one of the supplied status will included.
62 * // * @param orderHints // * Supports path like
63 * <code>orderHints.propertyNames</code> which // * include
64 * *-to-one properties like createdBy.username or // *
65 * authorTeam.persistentTitleCache
66 * @param propertyPaths
67 * @return
68 * @throws DataAccessException
69 */
70 public Pager<Registration> page(Optional<Reference> reference, Collection<RegistrationStatus> includedStatus,
71 Integer pageSize, Integer pageIndex, List<String> propertyPaths);
72
73 /**
74 * Returns a sublist of Registration instances stored in the database. A
75 * maximum of 'limit' objects are returned, starting at object with index
76 * 'start'. The bean properties specified by the parameter
77 * <code>propertyPaths</code> and recursively initialized for each of the
78 * entities in the resultset
79 *
80 * For detailed description and examples regarding
81 * <code>propertyPaths</code> <b>please refer to:</b>
82 * {@link IBeanInitializer#initialize(Object, List)}
83 *
84 * @param submitter
85 * Limits the result set to Registrations having the given
86 * submitter. This filter is ignored if set to <code>null</code>.
87 * @param includedStatus
88 * filters the Registration by the RegistrationStatus. Only
89 * Registration having one of the supplied status will included.
90 * @param identifierFilterPattern
91 * filters the Registration by this pattern, The asterisk can be used
92 * * as wildcard in any position of the pattern string
93 * @param taxonNameFilterPattern
94 * filters the registered taxon name by this pattern, The asterisk can be used
95 * * as wildcard in any position of the pattern string
96 * @param typeDesignationStatus
97 * @param pageSize
98 * The maximum number of objects returned (can be null for all
99 * matching objects)
100 * @param pageNumber
101 * The offset (in pageSize chunks) from the start of the result
102 * set (0 - based, can be null, equivalent of starting at the
103 * beginning of the recordset)
104 * @param orderHints
105 * Supports path like <code>orderHints.propertyNames</code> which
106 * include *-to-one properties like createdBy.username or
107 * authorTeam.persistentTitleCache
108 * @param propertyPaths
109 * @return
110 * @throws DataAccessException
111 */
112 public Pager<Registration> page(User submitter, Collection<RegistrationStatus> includedStatus,
113 String identifierFilterPattern, String taxonNameFilterPattern, Set<TypeDesignationStatusBase> typeDesignationStatus, Integer pageSize,
114 Integer pageIndex, List<OrderHint> orderHints, List<String> propertyPaths);
115
116 }