source: extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/ImageService.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.1 KB
Line 
1package fr.mael.jiwigo.service;
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 ImageService {
13
14    /**
15     * Lists all images for a category
16     * @param categoryId the id of the category
17     * @return the list of images
18     * @throws IOException
19     * @throws ProxyAuthenticationException
20     */
21    public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException,
22            ProxyAuthenticationException;
23
24    /**
25     * Method called to send an image to the server.
26     * @param filePath
27     * @param idCategory
28     * @param originalWidth width for the original image
29     * @param originalHeight height for the original image
30     * @return true if the image is created
31     * @throws IOException
32     * @throws WrongChunkSizeException
33     * @throws ProxyAuthenticationException
34     * @throws FileAlreadyExistsException
35     * @throws NoSuchAlgorithmException
36     * @throws Exception
37     */
38    public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
39            Double chunckSize, Integer privacyLevel) throws IOException, NoSuchAlgorithmException,
40            FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException;
41
42    /**
43     * Add tags to an existing image
44     * @param image the image
45     * @param tagId the ids of the tags
46     * @return true if successful
47     * @throws IOException
48     * @throws ProxyAuthenticationException
49     */
50    public boolean addTags(Image image, String tagId) throws IOException, ProxyAuthenticationException;
51
52    /**
53     * Search images from a string
54     * @param queryString the string
55     * @return images matching the string
56     * @throws IOException
57     * @throws ProxyAuthenticationException
58     */
59    public List<Image> search(String queryString) throws IOException, ProxyAuthenticationException;
60
61}
Note: See TracBrowser for help on using the repository browser.