3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.api
.service
;
13 import java
.util
.List
;
15 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
16 import eu
.etaxonomy
.cdm
.model
.agent
.Address
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.InstitutionalMembership
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
21 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
22 import eu
.etaxonomy
.cdm
.model
.common
.UuidAndTitleCache
;
23 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
25 public interface IAgentService
extends IIdentifiableEntityService
<AgentBase
> {
27 public List
<Institution
> searchInstitutionByCode(String code
);
30 * Return a paged list of the institutional memberships held by a person
32 * @param person the person
33 * @param pageSize The maximum number of memberships returned (can be null for all memberships)
34 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
35 * @return a Pager containing InstitutionalMembership instances
37 public Pager
<InstitutionalMembership
> getInstitutionalMemberships(Person person
, Integer pageSize
, Integer pageNumber
);
40 * Return a paged list of the members of a team
42 * @param team the team
43 * @param pageSize The maximum number of members returned (can be null for all members)
44 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
45 * @return a Pager containing Person instances
47 public Pager
<Person
> getMembers(Team team
, Integer pageSize
, Integer pageNumber
);
50 * Return a paged list of the addresses of an agent
52 * @param agent the agent
53 * @param pageSize The maximum number of addresses returned (can be null for all members)
54 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
55 * @return a Pager containing Address instances
57 public Pager
<Address
> getAddresses(AgentBase agent
, Integer pageSize
, Integer pageNumber
);
60 * Returns a Paged List of AgentBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
62 * @param clazz filter the results by class (or pass null to return all AgentBase instances)
64 * @param pageSize The maximum number of agents returned (can be null for all matching agents)
65 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
67 * Supports path like <code>orderHints.propertyNames</code> which
68 * include *-to-one properties like createdBy.username or
69 * authorTeam.persistentTitleCache
70 * @param propertyPaths properties to be initialized
71 * @return a Pager Agent instances
72 * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
74 public Pager
<AgentBase
> search(Class
<?
extends AgentBase
> clazz
, String queryString
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
77 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>Person</code>s
79 * @return a list of <code>UuidAndTitleCache</code> instances
81 public List
<UuidAndTitleCache
<Person
>> getPersonUuidAndTitleCache();
84 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> obejcts
85 * with their respective titleCache
87 * @return a list of <code>UuidAndTitleCache</code> instances
89 public List
<UuidAndTitleCache
<Team
>> getTeamUuidAndTitleCache();
92 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> obejcts
93 * with their respective nomenclaturalTitle instead of regular titleCache
95 * @return a list of <code>UuidAndTitleCache</code> instances
97 public List
<UuidAndTitleCache
<Team
>> getTeamUuidAndNomenclaturalTitle();