1 | package fr.mael.jiwigo.service; |
---|
2 | |
---|
3 | import java.io.IOException; |
---|
4 | import java.security.NoSuchAlgorithmException; |
---|
5 | import java.util.List; |
---|
6 | |
---|
7 | import fr.mael.jiwigo.om.Image; |
---|
8 | import fr.mael.jiwigo.transverse.exception.FileAlreadyExistsException; |
---|
9 | import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; |
---|
10 | import fr.mael.jiwigo.transverse.exception.WrongChunkSizeException; |
---|
11 | |
---|
12 | public 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 | } |
---|