+// $Id$\r
/**\r
* Copyright (C) 2007 EDIT\r
* European Distributed Institute of Taxonomy \r
\r
package eu.etaxonomy.cdm.api.service;\r
\r
-import java.util.Collection;\r
import java.util.List;\r
-import java.util.Map;\r
-import java.util.UUID;\r
\r
-import eu.etaxonomy.cdm.model.agent.Agent;\r
+import eu.etaxonomy.cdm.api.service.pager.Pager;\r
+import eu.etaxonomy.cdm.model.agent.Address;\r
+import eu.etaxonomy.cdm.model.agent.AgentBase;\r
import eu.etaxonomy.cdm.model.agent.Institution;\r
+import eu.etaxonomy.cdm.model.agent.InstitutionalMembership;\r
+import eu.etaxonomy.cdm.model.agent.Person;\r
+import eu.etaxonomy.cdm.model.agent.Team;\r
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;\r
+import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
\r
-public interface IAgentService<T extends Agent> extends IIdentifiableEntityService<T> {\r
+public interface IAgentService extends IIdentifiableEntityService<AgentBase> {\r
+ \r
+ public List<Institution> searchInstitutionByCode(String code);\r
\r
- public abstract T getAgentByUuid(UUID uuid);\r
-\r
- public abstract UUID saveAgent(T agent);\r
+ /**\r
+ * Return a paged list of the institutional memberships held by a person\r
+ * \r
+ * @param person the person\r
+ * @param pageSize The maximum number of memberships returned (can be null for all memberships)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * @return a Pager containing InstitutionalMembership instances\r
+ */\r
+ public Pager<InstitutionalMembership> getInstitutionalMemberships(Person person, Integer pageSize, Integer pageNumber);\r
\r
- public abstract Map<UUID, T> saveAgentAll(Collection<T> agentCollection);\r
+ /**\r
+ * Return a paged list of the members of a team\r
+ * \r
+ * @param team the team\r
+ * @param pageSize The maximum number of members returned (can be null for all members)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * @return a Pager containing Person instances\r
+ */\r
+ public Pager<Person> getMembers(Team team, Integer pageSize, Integer pageNumber);\r
\r
- public abstract List<T> findAgentsByTitle(String title);\r
-\r
- public abstract List<? extends Agent> getAllAgents(int limit, int start);\r
+ /**\r
+ * Return a paged list of the addresses of an agent\r
+ * \r
+ * @param agent the agent\r
+ * @param pageSize The maximum number of addresses returned (can be null for all members)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * @return a Pager containing Address instances\r
+ */\r
+ public Pager<Address> getAddresses(AgentBase agent, Integer pageSize, Integer pageNumber);\r
+ \r
+ /**\r
+ * Returns a Paged List of AgentBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)\r
+ * \r
+ * @param clazz filter the results by class (or pass null to return all AgentBase instances)\r
+ * @param queryString\r
+ * @param pageSize The maximum number of agents returned (can be null for all matching agents)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * @param orderHints\r
+ * Supports path like <code>orderHints.propertyNames</code> which\r
+ * include *-to-one properties like createdBy.username or\r
+ * authorTeam.persistentTitleCache\r
+ * @param propertyPaths properties to be initialized\r
+ * @return a Pager Agent instances\r
+ * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>\r
+ */\r
+ public Pager<AgentBase> search(Class<? extends AgentBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+ \r
+ /**\r
+ * Returns a list of <code>UuidAndTitleCache</code> containing all <code>Person</code>s\r
+ * \r
+ * @return a list of <code>UuidAndTitleCache</code> instances\r
+ */\r
+ public List<UuidAndTitleCache<Person>> getPersonUuidAndTitleCache();\r
+ \r
+ /**\r
+ * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> objects\r
+ * with their respective titleCache\r
+ * \r
+ * @return a list of <code>UuidAndTitleCache</code> instances\r
+ */\r
+ public List<UuidAndTitleCache<Team>> getTeamUuidAndTitleCache();\r
+ \r
+ /**\r
+ * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> objects\r
+ * with their respective nomenclaturalTitle instead of regular titleCache\r
+ * \r
+ * @return a list of <code>UuidAndTitleCache</code> instances\r
+ */\r
+ public List<UuidAndTitleCache<Team>> getTeamUuidAndNomenclaturalTitle();\r
+ \r
+ /**\r
+ * Returns a list of <code>UuidAndTitleCache</code> containing all {@link Institution} objects\r
+ * with their respective titleCache\r
+ * \r
+ * @return a list of <code>UuidAndTitleCache</code> instances\r
+ */\r
+ public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache();\r
\r
- public abstract List<Institution> searchInstitutionByCode(String code);\r
-\r
-\r
}\r