PublisherService.java
2.92 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
75
76
77
78
79
80
81
82
83
84
85
86
87
package org.legrog.web.publisher;
import org.legrog.entities.*;
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 {
/**
* Creates Publisher, associates it with PublisherVersion and back.
* PublisherVersion is completed with author and date time.
* Both Publisher and PublisherVersion are persisted.
*
* @param publisherVersion for creation of new Publisher ; has no publisher, author or date time
* @return updated PublisherVersion
*/
PublisherVersion addNewPublisher(@NotNull PublisherVersion publisherVersion);
/**
* 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.
*
* @param publisher has at least one version
* @param publisherVersion has no publisher, author or date time
* @return updated PublisherVersion
*/
PublisherVersion addVersionToPublisher(@NotNull Publisher publisher, @NotNull PublisherVersion publisherVersion);
/**
* Sets PublisherVersion as its Publisher validated version.
* Creates the PublisherAction for the validation.
* Both Publisher and PublisherAction are persisted.
*
* @param publisherVersion
* @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);
/**
*
* @param string String searched indexed publishers
* @return indexed publishers that match the String
*/
List<PublisherVersion> search(@NotNull String string) throws SearchingException;
/**
*
* @param indexedPublishers to convert
* @return PublisherVersion List
*/
List<PublisherVersion> convertIndexedPublishersIntoPublisherVersions(List<IndexedPublisher> indexedPublishers);
}