@Requirement(reqId="DOI_INTER_050", reqName="Interface avec la base de donn\u00e9es de gestion des utilisateurs") public abstract class AbstractUserRoleDBHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ADD_USER_NOTIFICATION
Notification message when an user is added
"AddUserNotification".
|
private static MyMemoryRealm |
REALM
Realm.
|
static String |
REMOVE_USER_NOTIFICATION
Notification message when an user is deleted
"RemoveUserNotification".
|
Constructor and Description |
---|
AbstractUserRoleDBHelper() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
addDOIUser(String username,
Boolean admin)
Add a DOI user
|
abstract boolean |
addDOIUser(String username,
Boolean admin,
String email)
Add a DOI user
|
abstract boolean |
addUserToRole(String user,
int role)
Adds an user to a specific role.
|
MyMemoryRealm |
getRealm()
Returns the realm.
|
abstract List<DOIUser> |
getUsers()
Returns the allowed users for authentication.
|
abstract List<DOIUser> |
getUsersFromRole(int roleName)
Get users from a specific role.
|
abstract boolean |
isUserExist(String username)
Tests if the user exists.
|
abstract boolean |
removeDOIUser(String username)
Removes the user
|
abstract boolean |
removeUserToRole(String user,
int role)
Removes an user from a specific role.
|
abstract boolean |
setUserToAdminGroup(String admin)
Add user to Administrators group
|
abstract boolean |
unsetUserFromAdminGroup(String admin)
Remove user to Administrators group
|
public static final String ADD_USER_NOTIFICATION
public static final String REMOVE_USER_NOTIFICATION
private static final MyMemoryRealm REALM
public MyMemoryRealm getRealm()
public abstract List<DOIUser> getUsers() throws DOIDbException
DOIDbException
- When an error occurspublic abstract List<DOIUser> getUsersFromRole(int roleName) throws DOIDbException
roleName
- role nameDOIDbException
- When an error occurspublic abstract boolean addUserToRole(String user, int role)
user
- user to addrole
- rolepublic abstract boolean removeUserToRole(String user, int role)
user
- user to removerole
- rolepublic abstract boolean setUserToAdminGroup(String admin)
admin
- user to addpublic abstract boolean unsetUserFromAdminGroup(String admin)
admin
- user to addpublic abstract boolean addDOIUser(String username, Boolean admin)
username
- usernameadmin
- True when the user must be added in the admin group
otherwise Falsepublic abstract boolean addDOIUser(String username, Boolean admin, String email)
username
- usernameadmin
- True when the user must be added in the admin group
otherwise Falseemail
- emailpublic abstract boolean isUserExist(String username)
username
- the userpublic abstract boolean removeDOIUser(String username)
username
- userCopyright © 2017–2020 CNES. All rights reserved.