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
.Collection
;
14 import java
.util
.List
;
16 import java
.util
.UUID
;
18 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.Address
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
21 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
22 import eu
.etaxonomy
.cdm
.model
.agent
.InstitutionalMembership
;
23 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
24 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
25 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
26 import eu
.etaxonomy
.cdm
.model
.common
.UuidAndTitleCache
;
27 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
29 public interface IAgentService
extends IIdentifiableEntityService
<AgentBase
> {
31 // FIXME Candidate for harmonization
32 public abstract AgentBase
getAgentByUuid(UUID uuid
);
34 // FIXME Candidate for harmonization
35 public abstract UUID
saveAgent(AgentBase agent
);
37 // FIXME Candidate for harmonization
38 public abstract Map
<UUID
, AgentBase
> saveAgentAll(Collection
<?
extends AgentBase
> agentCollection
);
40 // FIXME Candidate for harmonization
41 public abstract List
<AgentBase
> findAgentsByTitle(String title
);
43 // FIXME Candidate for harmonization
44 public abstract List
<AgentBase
> getAllAgents(int limit
, int start
);
46 public abstract List
<Institution
> searchInstitutionByCode(String code
);
49 * Return a paged list of the institutional memberships held by a person
51 * @param person the person
52 * @param pageSize The maximum number of memberships returned (can be null for all memberships)
53 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
54 * @return a Pager containing InstitutionalMembership instances
56 public Pager
<InstitutionalMembership
> getInstitutionalMemberships(Person person
, Integer pageSize
, Integer pageNumber
);
59 * Return a paged list of the members of a team
61 * @param team the team
62 * @param pageSize The maximum number of members returned (can be null for all members)
63 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
64 * @return a Pager containing Person instances
66 public Pager
<Person
> getMembers(Team team
, Integer pageSize
, Integer pageNumber
);
69 * Return a paged list of the addresses of an agent
71 * @param agent the agent
72 * @param pageSize The maximum number of addresses returned (can be null for all members)
73 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
74 * @return a Pager containing Address instances
76 public Pager
<Address
> getAddresses(AgentBase agent
, Integer pageSize
, Integer pageNumber
);
79 * Returns a Paged List of AgentBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
81 * @param clazz filter the results by class (or pass null to return all AgentBase instances)
83 * @param pageSize The maximum number of agents returned (can be null for all matching agents)
84 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
86 * Supports path like <code>orderHints.propertyNames</code> which
87 * include *-to-one properties like createdBy.username or
88 * authorTeam.persistentTitleCache
89 * @param propertyPaths properties to be initialized
90 * @return a Pager Agent instances
91 * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
93 public Pager
<AgentBase
> search(Class
<?
extends AgentBase
> clazz
, String queryString
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
96 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>Person</code>s
98 * @return a list of <code>UuidAndTitleCache</code> instances
100 public List
<UuidAndTitleCache
<Person
>> getPersonUuidAndNomenclaturalTitle();
103 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> obejcts
104 * with their respective nomenclaturalTitle instead of regular titleCache
106 * @return a list of <code>UuidAndTitleCache</code> instances
108 public List
<UuidAndTitleCache
<TeamOrPersonBase
>> getTeamOrPersonBaseUuidAndNomenclaturalTitle();