Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
WebGetter |
|
| 1.0;1 |
1 | package org.jtheque.films.services.impl.utils.web; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.jtheque.films.persistence.od.able.Film; | |
20 | import org.jtheque.films.services.impl.utils.EditArguments; | |
21 | import org.jtheque.films.services.impl.utils.web.analyzers.AbstractFilmAnalyzer; | |
22 | import org.jtheque.films.services.impl.utils.web.analyzers.AbstractFilmResultAnalyzer; | |
23 | import org.jtheque.films.utils.Constants.Site; | |
24 | ||
25 | import java.util.Collection; | |
26 | ||
27 | /** | |
28 | * A web getter. It seems an object who can search informations about a film on a specific film. | |
29 | * | |
30 | * @author Baptiste Wicht | |
31 | */ | |
32 | public interface WebGetter { | |
33 | /** | |
34 | * Indicate if the web getter can get informations on the site. | |
35 | * | |
36 | * @param site The site we must test if the getter can get on. | |
37 | * @return <code>true</code> if the getter can search on the site else <code>false</code>. | |
38 | */ | |
39 | boolean canGetOn(Site site); | |
40 | ||
41 | /** | |
42 | * Set the analyzer. | |
43 | * | |
44 | * @param analyzer The analyzer. | |
45 | */ | |
46 | void setAnalyzer(AbstractFilmAnalyzer analyzer); | |
47 | ||
48 | /** | |
49 | * Return the analyzer of the getter. | |
50 | * | |
51 | * @return The film analyzer. | |
52 | */ | |
53 | AbstractFilmAnalyzer getAnalyzer(); | |
54 | ||
55 | /** | |
56 | * Set the result analyzer. | |
57 | * | |
58 | * @param analyzer The result analyzer. | |
59 | */ | |
60 | void setResultAnalyzer(AbstractFilmResultAnalyzer analyzer); | |
61 | ||
62 | /** | |
63 | * Return the result analyzer of the getter. | |
64 | * | |
65 | * @return The film result analyzer. | |
66 | */ | |
67 | AbstractFilmResultAnalyzer getResultAnalyzer(); | |
68 | ||
69 | /** | |
70 | * Return all the films on the site for the search. | |
71 | * | |
72 | * @param search The research. | |
73 | * @return A list containing all the films on the site corresponding to the search. | |
74 | */ | |
75 | Collection<FilmResult> getFilms(String search); | |
76 | ||
77 | /** | |
78 | * Return the film modified if there is a film or a new film filled with the informations found on the site. | |
79 | * | |
80 | * @param search The search for the film. | |
81 | * @param film The film to modify or <code>null</code> if this is only a get. | |
82 | * @param args The arguments to specify what we must modify or only null if this only a get. | |
83 | * @return The film modified or a new film if there is no film to modify. . | |
84 | */ | |
85 | Film getFilm(FilmResult search, Film film, EditArguments args); | |
86 | } |