1 package be.dvw.administration.services.scores;
2
3 import be.dvw.administration.model.Score;
4
5 import java.util.List;
6
7 /***
8 * Service interface allowing to retrieve and manipulate scores in the persistence store
9 * (depending on the implementation used).
10 */
11 public interface ScoreService
12 {
13 /***
14 * Method returning the complete list of scores.
15 * @return List of scores
16 * @throws Exception
17 */
18 public List getAll() throws Exception;
19
20 /***
21 * Method allowing to store a score (both update and create)
22 * @param score: the score to be saved
23 * @param newScore: boolean indicating wheter it is an update or a create
24 * @return the score as stored in the database
25 * @throws Exception
26 */
27 public Score save(Score score, boolean newScore) throws Exception;
28
29 /***
30 * Method allowing to delete a score
31 * @param id the identifier of the score
32 * @throws Exception
33 */
34 public void delete(int id) throws Exception;
35
36 /***
37 * Method returning a score corresponding to the id
38 * @param id
39 * @return the score corresponding to the id
40 * @throws Exception
41 */
42 public Score load(int id) throws Exception;
43
44 /***
45 * Method allowing to search for scores based on an search string suc as:
46 * 'name' = $name AND 'composer' = $composer OR 'arranger' = $arranger
47 * @todo define the format of the search string (SQL, HQL, ...)
48 * @param searchString
49 * @return List of scores containing the search result
50 * @throws Exception
51 */
52 public List search(String searchString) throws Exception;
53
54 /***
55 * Method returning the current value of the inventory
56 * @return the current value of the inventory (all scores) being the purchase value
57 * less the depreciation
58 */
59 public float getCurrentValue();
60
61 /***
62 * Method returning the purchase value of the inventory
63 * @return the purchase value
64 */
65 public float getPurchaseValue();
66
67 /***
68 * Method counting the total number of scores in the inventory
69 * @return number of scores in the inventory
70 */
71 public int getTotalNumber();
72
73 }