Jean-Francois Leveque

Clarification PublisherService

...@@ -4,26 +4,71 @@ import org.legrog.entities.Publisher; ...@@ -4,26 +4,71 @@ import org.legrog.entities.Publisher;
4 import org.legrog.entities.PublisherAction; 4 import org.legrog.entities.PublisherAction;
5 import org.legrog.entities.PublisherVersion; 5 import org.legrog.entities.PublisherVersion;
6 6
7 +import javax.validation.constraints.NotNull;
7 import java.util.List; 8 import java.util.List;
8 9
9 /* 10 /*
10 - Interface correspondant à la gestion des éditeurs et de leurs versions. 11 + Interface correspondant à la gestion des éditeurs, de leurs versions et des actions correspondantes.
11 - Contient des signatures méthodes d'ajout, de modification et de validation de version ainsi que de restitution. 12 + Contient des signatures pour les méthodes d'ajout, de modification et de validation de version ainsi
13 + que de restitution.
12 */ 14 */
13 public interface PublisherService { 15 public interface PublisherService {
14 16
15 - PublisherVersion addNewPublisher(PublisherVersion publisherVersion); 17 + /*
18 + @param PublisherVersion for creation of new Publisher ; has no publisher, author or date time
16 19
17 - PublisherVersion addVersionToPublisher(Publisher publisher, PublisherVersion publisherVersion); 20 + Creates Publisher, associates it with PublisherVersion and back.
21 + PublisherVersion is completed with author and date time.
22 + Both Publisher and PublisherVersion are persisted.
18 23
19 - PublisherAction validatePublisherVersion(PublisherVersion publisherVersion); 24 + @return updated PublisherVersion
25 + */
26 + PublisherVersion addNewPublisher(@NotNull PublisherVersion publisherVersion);
20 27
28 + /*
29 + @param Publisher has at least one version
30 + @param PublisherVersion has no publisher, author or date time
31 +
32 + Updates Publisher's versions, adding PublisherVersion. Reverse association is also done.
33 + PublisherVersion is completed with author and date time.
34 + Both Publisher and PublisherVersion are persisted.
35 +
36 + @return updated PublisherVersion
37 + */
38 + PublisherVersion addVersionToPublisher(@NotNull Publisher publisher, @NotNull PublisherVersion publisherVersion);
39 +
40 + /*
41 + @param PublisherVersion
42 +
43 + Sets PublisherVersion as its Publisher validated version.
44 + Creates the PublisherAction for the validation.
45 + Both Publisher and PublisherAction are persisted.
46 +
47 + @return PublisherAction related to the validation
48 + */
49 + PublisherAction validatePublisherVersion(@NotNull PublisherVersion publisherVersion);
50 +
51 + /* @return all persisted PublisherVersions */
21 List<PublisherVersion> getAllPublisherVersions(); 52 List<PublisherVersion> getAllPublisherVersions();
22 53
23 - PublisherVersion getPublisherVersion(Integer publisherVersionId); 54 + /*
55 + @param publisherVersionId
56 + @return PublisherVersion with id publisherVersionId
57 + */
58 + PublisherVersion getPublisherVersion(@NotNull Integer publisherVersionId);
24 59
25 - PublisherAction getLastValidate(Publisher publisher); 60 + /*
61 + @param Publisher
62 + @return PublisherAction for Publisher's last validation
63 + */
64 + PublisherAction getLastValidate(@NotNull Publisher publisher);
26 65
66 + /* @return all persisted PublisherAction */
27 List<PublisherAction> getAllPublisherActions(); 67 List<PublisherAction> getAllPublisherActions();
28 - List<PublisherAction> getAllPublisherVersionActions(PublisherVersion publisherVersion); 68 +
69 + /*
70 + @param PublisherVersion
71 + @return all PublisherAction on that PublisherVersion
72 + */
73 + List<PublisherAction> getAllPublisherVersionActions(@NotNull PublisherVersion publisherVersion);
29 } 74 }
......