2 * Copyright (C) 2017 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.cdm
.api
.service
;
11 import java
.io
.IOException
;
12 import java
.util
.Collection
;
13 import java
.util
.List
;
15 import java
.util
.Optional
;
17 import java
.util
.UUID
;
19 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
20 import eu
.etaxonomy
.cdm
.model
.common
.User
;
21 import eu
.etaxonomy
.cdm
.model
.name
.Registration
;
22 import eu
.etaxonomy
.cdm
.model
.name
.RegistrationStatus
;
23 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
24 import eu
.etaxonomy
.cdm
.model
.name
.TypeDesignationStatusBase
;
25 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
26 import eu
.etaxonomy
.cdm
.persistence
.query
.MatchMode
;
27 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
30 * @author a.kohlbecker
34 public interface IRegistrationService
extends IAnnotatableService
<Registration
> {
37 * Returns a sublist of Registration instances stored in the database. A
38 * maximum of 'limit' objects are returned, starting at object with index
39 * 'start'. The bean properties specified by the parameter
40 * <code>propertyPaths</code> and recursively initialized for each of the
41 * entities in the resultset
43 * For detailed description and examples regarding
44 * <code>propertyPaths</code> <b>please refer to:</b>
45 * {@link IBeanInitializer#initialize(Object, List)}
48 * The maximum number of objects returned (can be null for all
51 * The offset (in pageSize chunks) from the start of the result
52 * set (0 - based, can be null, equivalent of starting at the
53 * beginning of the recordset)
55 * filters the Registration by the reference of the nomenclatural
56 * act for which the Registration as been created. The name and
57 * all type designations associated with the Registration are
58 * sharing the same citation. If the Optional itself is
59 * <code>null</code> the parameter is neglected. If Optional
60 * contains the value <code>null</code> all registrations with a
61 * name or type designation that has no reference are returned.
62 * Also those registrations having no name and type designation
64 * @param includedStatus
65 * filters the Registration by the RegistrationStatus. Only
66 * Registration having one of the supplied status will included.
67 * // * @param orderHints // * Supports path like
68 * <code>orderHints.propertyNames</code> which // * include
69 * *-to-one properties like createdBy.username or // *
70 * authorTeam.persistentTitleCache
71 * @param propertyPaths
73 * @throws DataAccessException
75 public Pager
<Registration
> page(Optional
<Reference
> reference
, Collection
<RegistrationStatus
> includedStatus
,
76 Integer pageSize
, Integer pageIndex
, List
<String
> propertyPaths
);
79 * Returns a sublist of Registration instances stored in the database. A
80 * maximum of 'limit' objects are returned, starting at object with index
81 * 'start'. The bean properties specified by the parameter
82 * <code>propertyPaths</code> and recursively initialized for each of the
83 * entities in the resultset
85 * For detailed description and examples regarding
86 * <code>propertyPaths</code> <b>please refer to:</b>
87 * {@link IBeanInitializer#initialize(Object, List)}
90 * Limits the result set to Registrations having the given
91 * submitter. This filter is ignored if set to <code>null</code>.
92 * @param includedStatus
93 * filters the Registration by the RegistrationStatus. Only
94 * Registration having one of the supplied status will included.
95 * @param identifierFilterPattern
96 * filters the Registration by this pattern, The asterisk can be used
97 * * as wildcard in any position of the pattern string
98 * @param taxonNameFilterPattern
99 * filters the registered taxon name by this pattern, The asterisk can be used
100 * * as wildcard in any position of the pattern string
101 * @param typeDesignationStatus
103 * The maximum number of objects returned (can be null for all
106 * The offset (in pageSize chunks) from the start of the result
107 * set (0 - based, can be null, equivalent of starting at the
108 * beginning of the recordset)
110 * Supports path like <code>orderHints.propertyNames</code> which
111 * include *-to-one properties like createdBy.username or
112 * authorTeam.persistentTitleCache
113 * @param propertyPaths
115 * @throws DataAccessException
117 public Pager
<Registration
> page(User submitter
, Collection
<RegistrationStatus
> includedStatus
,
118 String identifierFilterPattern
, String taxonNameFilterPattern
, Set
<TypeDesignationStatusBase
> typeDesignationStatus
, Integer pageSize
,
119 Integer pageIndex
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
121 Pager
<Registration
> pageByIdentifier(String identifier
, Integer pageIndex
, Integer pageSize
, List
<String
> propertyPaths
) throws IOException
;
123 public Map
<UUID
, RegistrationStatus
> statusByIdentifier(String identifier
) throws IOException
;
126 * @param submitterUuid
127 * @param includedStatusUuids
128 * @param identifierFilterPattern
129 * @param taxonNameFilterPattern
130 * @param typeDesignationStatusUuids
134 * @param propertyPaths
137 Pager
<Registration
> page(UUID submitterUuid
, Collection
<RegistrationStatus
> includedStatus
, String identifierFilterPattern
,
138 String taxonNameFilterPattern
, Collection
<UUID
> typeDesignationStatusUuids
, Integer pageSize
,
139 Integer pageIndex
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
141 public Pager
<Registration
> page(UUID submitterUuid
, Collection
<RegistrationStatus
> includedStatus
,
142 Collection
<UUID
> taxonNameUUIDs
,
143 Integer pageSize
, Integer pageIndex
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
145 public Pager
<Registration
> pageTaxomicInclusion(UUID submitterUuid
, Collection
<RegistrationStatus
> includedStatus
,
146 String taxonNameFilterPattern
, MatchMode matchMode
,
147 Integer pageSize
, Integer pageIndex
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
149 // ============= functionality to be moved into a "RegistrationManagerBean" ==================
151 public Registration
newRegistration();
153 Registration
assureIsPersisted(Registration reg
);
156 * Create and persist a new Registration for the name having the supplied UUID.
158 * @param taxonNameUuid
161 Registration
createRegistrationForName(UUID taxonNameUuid
);
163 boolean checkRegistrationExistsFor(TaxonName name
);
165 public void addTypeDesignation(UUID registrationUUID
, UUID typeDesignationUuid
);
168 * @param registration
169 * @param typeDesignationUuid
171 public void addTypeDesignation(Registration registration
, UUID typeDesignationUuid
);
173 // ============================================================================================