KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > javacoding > jspider > core > storage > impl > EMailAddressDAOImpl


1 package net.javacoding.jspider.core.storage.impl;
2
3 import net.javacoding.jspider.core.storage.EMailAddressDAO;
4 import net.javacoding.jspider.core.storage.Storage;
5 import net.javacoding.jspider.core.storage.spi.EMailAddressDAOSPI;
6 import net.javacoding.jspider.core.storage.spi.StorageSPI;
7 import net.javacoding.jspider.core.logging.Log;
8 import net.javacoding.jspider.core.model.ResourceInternal;
9 import net.javacoding.jspider.core.model.EMailAddressInternal;
10 import net.javacoding.jspider.api.model.*;
11
12 /**
13  * $Id: EMailAddressDAOImpl.java,v 1.1 2003/04/11 16:37:05 vanrogu Exp $
14  */

15 class EMailAddressDAOImpl implements EMailAddressDAO {
16
17     protected Log log;
18     protected StorageSPI storage;
19     protected EMailAddressDAOSPI spi;
20
21     public EMailAddressDAOImpl ( Log log, StorageSPI storage, EMailAddressDAOSPI spi ) {
22         this.log = log;
23         this.storage = storage;
24         this.spi = spi;
25     }
26
27     public EMailAddress find(String JavaDoc address) {
28         return spi.find(address);
29     }
30
31     public void register(Resource resource, EMailAddress address) {
32         ResourceInternal ri = TypeTranslator.translate(resource);
33         EMailAddressInternal ai = TypeTranslator.translate(address);
34         spi.register(ri, ai);
35     }
36
37     public EMailAddress[] findByResource(Resource resource) {
38         ResourceInternal ri = TypeTranslator.translate(resource);
39         return spi.findByResource(ri);
40     }
41
42     public EMailAddressReference[] findReferencesByResource(Resource resource) {
43         ResourceInternal ri = TypeTranslator.translate(resource);
44         return spi.findReferencesByResource(ri);
45     }
46
47 }
48
Popular Tags