source: extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/ImageDao.java @ 9919

Last change on this file since 9919 was 9919, checked in by mlg, 13 years ago

Complete rewriting of the api
The api now uses interfaces everywhere (for the dao, services and session manager). This allows the developer to use his own implementations if he wants.
Deletion of the singletons. There are now getters and setters. It allows to make dependency injection.
Use of sl4j in the api, instead of using log4j.

File size: 2.4 KB
Line 
1package fr.mael.jiwigo.dao;
2
3import java.io.IOException;
4import java.security.NoSuchAlgorithmException;
5import java.util.List;
6
7import fr.mael.jiwigo.om.Image;
8import fr.mael.jiwigo.transverse.exception.FileAlreadyExistsException;
9import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
10import fr.mael.jiwigo.transverse.exception.WrongChunkSizeException;
11
12public interface ImageDao {
13    /**
14     * Lists all images
15     * @return the list of images
16     * @throws IOException
17     * @throws ProxyAuthenticationException
18     */
19    public List<Image> list(boolean refresh) throws IOException, ProxyAuthenticationException;
20
21    /**
22     * Listing of the images for a category
23     * @param categoryId the id of the category
24     * @return the list of images
25     * @throws IOException
26     * @throws ProxyAuthenticationException
27     */
28    public List<Image> listByCategory(Integer categoryId, boolean refresh) throws IOException,
29            ProxyAuthenticationException;
30
31    /**
32     * Creation of an image<br/>
33     * Sequence : <br/>
34     * <li>
35     * <ul>sending of the thumbnail in base64, thanks to the method addchunk.</ul>
36     * <ul>sending of the image in base64, thanks to the method addchunk</ul>
37     * <ul>using of the add method to add the image to the database<ul>
38     * </li>
39     * Finally, the response of the webservice is checked
40     *
41     * @param image the image to create
42     * @return true if the creation of the image was the successful
43     * @throws IOException
44     * @throws NoSuchAlgorithmException
45     * @throws WrongChunkSizeException
46     * @throws Exception
47     */
48    //TODO ne pas continuer si une des reponses precedentes est negative
49    public boolean create(Image image, Double chunkSize) throws FileAlreadyExistsException, IOException,
50            ProxyAuthenticationException, NoSuchAlgorithmException, WrongChunkSizeException;
51
52    /**
53     * Add tags to an image
54     * @param imageId id of the image
55     * @param tagId ids of the tags
56     * @throws IOException
57     * @throws ProxyAuthenticationException
58     */
59    public boolean addTags(Integer imageId, String tagId) throws IOException, ProxyAuthenticationException;
60
61    /**
62     * Search images
63     * @param searchString the string to search
64     * @return the list of images matching the string
65     * @throws IOException
66     * @throws ProxyAuthenticationException
67     */
68    public List<Image> search(String searchString) throws IOException, ProxyAuthenticationException;
69
70}
Note: See TracBrowser for help on using the repository browser.