2 * Copyright (C) 2007 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.
10 package eu
.etaxonomy
.cdm
.api
.service
;
12 import java
.util
.ArrayList
;
13 import java
.util
.Collection
;
14 import java
.util
.List
;
16 import java
.util
.UUID
;
18 import org
.apache
.log4j
.Logger
;
19 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
20 import org
.springframework
.stereotype
.Service
;
21 import org
.springframework
.transaction
.annotation
.Transactional
;
23 import eu
.etaxonomy
.cdm
.model
.agent
.Agent
;
24 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
25 import eu
.etaxonomy
.cdm
.persistence
.dao
.agent
.IAgentDao
;
26 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.ICdmEntityDao
;
36 public class AgentServiceImpl
<T
extends Agent
> extends IdentifiableServiceBase
<T
> implements IAgentService
<T
> {
37 private static final Logger logger
= Logger
.getLogger(AgentServiceImpl
.class);
39 private IAgentDao agentDao
;
41 protected void setDao(IAgentDao dao
) {
42 this.dao
= (ICdmEntityDao
)dao
;
46 public List
<T
> findAgentsByTitle(String title
) {
47 return super.findCdmObjectsByTitle(title
);
50 public T
getAgentByUuid(UUID uuid
) {
51 return super.getCdmObjectByUuid(uuid
);
54 public UUID
saveAgent(T agent
) {
55 return super.saveCdmObject(agent
);
58 @Transactional(readOnly
= false)
59 public Map
<UUID
, T
> saveAgentAll(Collection
<T
> agentCollection
){
60 return saveCdmObjectAll(agentCollection
);
64 public List
<?
extends Agent
> getAllAgents(int limit
, int start
){
65 return agentDao
.list(limit
, start
);
68 public List
<Institution
> searchInstitutionByCode(String code
) {
69 return agentDao
.getInstitutionByCode(code
);
72 public void generateTitleCache() {
73 // TODO Auto-generated method stub