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