a800fde0
jcartign
First version, in...
|
1
2
3
4
|
package fr.plil.sio.persistence.api;
public interface GroupService {
|
5418cb05
jcartign
Javadoc of API is...
|
5
6
7
8
9
10
11
|
/**
* Create a group with a specific name in the database.
* There is no two groups with the same name in the database.
*
* @param name the name of the group
* @return an instance of the group
* @throws IllegalArgumentException if name is null
|
f2ed17f6
jcartign
upgrading Javadoc
|
12
|
* @throws IllegalStateException if a group with the same name is already present
|
5418cb05
jcartign
Javadoc of API is...
|
13
|
*/
|
a800fde0
jcartign
First version, in...
|
14
15
|
Group create(String name);
|
5418cb05
jcartign
Javadoc of API is...
|
16
17
18
19
20
21
22
23
|
/**
* Delete a group in the database. Remove all users in the group.
*
* @param name the name of the group to remove
* @return true if group has been deleted, false if group is not found in the database.
* @throws IllegalArgumentException if name is null
*/
boolean delete(String name);
|
a800fde0
jcartign
First version, in...
|
24
|
|
5418cb05
jcartign
Javadoc of API is...
|
25
26
27
28
29
30
31
|
/**
* Find a group in the database based on its name.
*
* @param name the name of the group to search for.
* @return an instance of the group if found, else null.
* @throws IllegalArgumentException if name is null
*/
|
a800fde0
jcartign
First version, in...
|
32
33
|
Group findByName(String name);
|
5418cb05
jcartign
Javadoc of API is...
|
34
|
/**
|
5418cb05
jcartign
Javadoc of API is...
|
35
36
37
38
39
|
* Add a right in the group. Right is inserted at the end of rights list of the group.
*
* @param groupName the name of the group.
* @param right the right to add
* @return true if right is added in the group, false if right was already present.
|
5418cb05
jcartign
Javadoc of API is...
|
40
41
42
|
* @throws IllegalArgumentException if groupName or right is null, or if group or right cannot be found.
*/
boolean addRight(String groupName, Right right);
|
a800fde0
jcartign
First version, in...
|
43
|
|
5418cb05
jcartign
Javadoc of API is...
|
44
45
46
47
48
49
50
51
52
|
/**
* Remove a right associated with a group.
*
* @param groupName the name of the group.
* @param right the right to remove
* @return true if right is removed from the group, false if teh right was not present in the group.
* @throws IllegalArgumentException if groupName or right is null, or if group or right cannot be found.
*/
boolean removeRight(String groupName, Right right);
|
a800fde0
jcartign
First version, in...
|
53
|
}
|