fixing for compatibility with merged cdmlib
[taxeditor.git] / eu.etaxonomy.taxeditor.cdmlib / src / main / java / eu / etaxonomy / cdm / api / cache / CdmServiceCacher.java
1 package eu.etaxonomy.cdm.api.cache;
2
3 import java.util.UUID;
4
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Component;
7
8 import eu.etaxonomy.cdm.api.service.ITermService;
9 import eu.etaxonomy.cdm.model.common.CdmBase;
10
11 /**
12 * Class which uses CDM services to cache cdm entities
13 *
14 * FIXME: Currently only handles terms entities. It would be
15 * interesting to have a generic method which finds the
16 * correct service to load / cache the entity.
17 *
18 * @author cmathew
19 *
20 * @param <T>
21 */
22 @Component
23 public class CdmServiceCacher<T extends CdmBase> extends CdmCacher {
24
25 @Autowired
26 ITermService termService;
27
28 @Override
29 protected T findByUuid(UUID uuid) {
30 return (T)termService.findWithoutFlush(uuid);
31 }
32
33 /* (non-Javadoc)
34 * @see eu.etaxonomy.cdm.api.cache.CdmCacher#setup()
35 */
36 @Override
37 protected void setup() {
38 // TODO Auto-generated method stub
39
40 }
41
42 /* (non-Javadoc)
43 * @see eu.etaxonomy.cdm.model.ICdmCacher#isCachable(eu.etaxonomy.cdm.model.common.CdmBase)
44 */
45 @Override
46 public boolean isCachable(CdmBase arg0) {
47 // TODO Auto-generated method stub
48 return false;
49 }
50
51 /* (non-Javadoc)
52 * @see eu.etaxonomy.cdm.api.cache.CdmCacher#load(eu.etaxonomy.cdm.model.common.CdmBase)
53 */
54 @Override
55 public CdmBase load(CdmBase arg0) {
56 // TODO Auto-generated method stub
57 return null;
58 }
59
60 }