ref #10222 add agentlink to taxonNodeAgentRelDto
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IAgentService.java
index f17040d1a7114296f6041c0ce8d5b4e47b1fab7a..85e739f59b2fa3fbfbbf643907c38f44c2bdb39d 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2007 EDIT
 * European Distributed Institute of Taxonomy
@@ -13,6 +12,7 @@ package eu.etaxonomy.cdm.api.service;
 import java.util.List;
 import java.util.UUID;
 
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.pager.Pager;
 import eu.etaxonomy.cdm.model.agent.Address;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
@@ -20,6 +20,7 @@ import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.cdm.model.agent.InstitutionalMembership;
 import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.persistence.dto.TeamOrPersonUuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 import eu.etaxonomy.cdm.strategy.merge.MergeException;
@@ -76,21 +77,6 @@ public interface IAgentService extends IIdentifiableEntityService<AgentBase> {
        @Override
     public Pager<AgentBase> search(Class<? extends AgentBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
 
-       /**
-        * Returns a list of <code>UuidAndTitleCache</code> containing all <code>Person</code>s
-        *
-        * @return a list of <code>UuidAndTitleCache</code> instances
-        */
-       public List<UuidAndTitleCache<Person>> getPersonUuidAndTitleCache();
-
-       /**
-        * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> objects
-        * with their respective titleCache
-        *
-        * @return a list of <code>UuidAndTitleCache</code> instances
-        */
-       public List<UuidAndTitleCache<Team>> getTeamUuidAndTitleCache();
-
        /**
         * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> objects
         * with their respective nomenclaturalTitle instead of regular titleCache
@@ -99,28 +85,31 @@ public interface IAgentService extends IIdentifiableEntityService<AgentBase> {
         */
        public List<UuidAndTitleCache<Team>> getTeamUuidAndNomenclaturalTitle();
 
-       /**
-        * Returns a list of <code>UuidAndTitleCache</code> containing all {@link Institution} objects
-        * with their respective titleCache
-        *
-        * @return a list of <code>UuidAndTitleCache</code> instances
-        */
-       public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache();
-
-
        /**
      * Returns a list of <code>UuidAndTitleCache</code> containing all {@link Institution} objects
      * with their respective NomenclaturalTitleCache
      *
      * @return a list of <code>UuidAndTitleCache</code> instances
      */
-    public List<UuidAndTitleCache<AgentBase>> getUuidAndAbbrevTitleCache();
+    public <T extends AgentBase> List<TeamOrPersonUuidAndTitleCache<T>> getUuidAndAbbrevTitleCache(Class<T> clazz, Integer limit, String pattern);
 
     /**
-     * @param teamUuid
-     * @return
-     * @throws MergeException
+     * Returns a list of <code>UuidAndTitleCache</code> containing all {@link Institution} objects
+     * with their respectiveCollectorTitleCache
+     *
+     * @return a list of <code>UuidAndTitleCache</code> instances
+     */
+    public <T extends AgentBase> List<TeamOrPersonUuidAndTitleCache<T>> getUuidAndTitleCacheWithCollectorTitleCache(Class<T> clazz, Integer limit, String pattern);
+
+    /**
+     * Returns a list of <code>UuidAndTitleCache</code> containing all {@link Institution} objects
+     * with their respectiveCollectorTitleCache
+     *
+     * @return a list of <code>UuidAndTitleCache</code> instances
      */
+    public <T extends AgentBase> List<TeamOrPersonUuidAndTitleCache<T>> getTeamOrPersonUuidAndTitleCache(Class<T> clazz, Integer limit, String pattern);
+
+
     public UpdateResult convertTeam2Person(UUID teamUuid) throws MergeException;
 
        /**
@@ -155,10 +144,16 @@ public interface IAgentService extends IIdentifiableEntityService<AgentBase> {
         * <BR>
         * If the person can not be replaced a {@link MergeException} is thrown.
         *
+        * The new team is created by setting the titleCache and nomenclaturalTitle to protected
+        * and copy it. Also supplemental data is copied to the team.
+        * The old person is fully deleted, not added as member to the new team.
+        *
         * @param person the {@link Person} to be converted
         * @return the new team that replaces the given person
         * @throws MergeException if anything else goes wrong during merge
         */
        public UpdateResult convertPerson2Team(Person person) throws MergeException, IllegalArgumentException;
 
-}
+    public <T extends AgentBase<?>> List<T> findByTitleAndAbbrevTitle(IIdentifiableEntityServiceConfigurator<T> config);
+
+}
\ No newline at end of file