public class IdentityServiceImpl extends ServiceImpl implements IdentityService
commandExecutor
Constructor and Description |
---|
IdentityServiceImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkPassword(String userId,
String password)
Checks if the password is valid for the given user.
|
void |
clearAuthentication()
Allows clearing the current authentication.
|
GroupQuery |
createGroupQuery()
Creates a
GroupQuery thats allows to programmatically query the groups. |
void |
createMembership(String userId,
String groupId) |
UserQuery |
createUserQuery()
Creates a
UserQuery that allows to programmatically query the users. |
void |
deleteGroup(String groupId)
Deletes the group.
|
void |
deleteMembership(String userId,
String groupId)
Delete the membership of the user in the group.
|
void |
deleteUser(String userId) |
void |
deleteUserAccount(String userId,
String accountName)
Delete an entry of the generic extensibility key-value pairs associated with a user
|
void |
deleteUserInfo(String userId,
String key)
Delete an entry of the generic extensibility key-value pairs associated with a user
|
void |
deleteUserPicture(String userId)
Deletes the picture for a given user.
|
Authentication |
getCurrentAuthentication() |
Account |
getUserAccount(String userId,
String userPassword,
String accountName)
Get account information associated with a user
|
List<String> |
getUserAccountNames(String userId)
Get account names associated with the given user
|
String |
getUserInfo(String userId,
String key)
Generic extensibility key-value pairs associated with a user
|
List<String> |
getUserInfoKeys(String userId)
Generic extensibility keys associated with a user
|
Picture |
getUserPicture(String userId)
Retrieves the picture for a given user.
|
boolean |
isReadOnly()
Allows to inquire whether this identity service implementation provides
read-only access to the user repository, false otherwise.
|
Group |
newGroup(String groupId)
Creates a new group.
|
User |
newUser(String userId)
Creates a new user.
|
void |
saveGroup(Group group)
Saves the group.
|
void |
saveUser(User user)
Saves the user.
|
void |
setAuthenticatedUserId(String authenticatedUserId)
Passes the authenticated user id for this thread.
|
void |
setAuthentication(Authentication auth) |
void |
setAuthentication(String userId,
List<String> groups)
Passes the authenticated user id and groupIds for this thread.
|
void |
setUserAccount(String userId,
String userPassword,
String accountName,
String accountUsername,
String accountPassword,
Map<String,String> accountDetails)
Store account information for a remote system
|
void |
setUserInfo(String userId,
String key,
String value)
Generic extensibility key-value pairs associated with a user
|
void |
setUserPicture(String userId,
Picture picture)
Sets the picture for a given user.
|
getCommandExecutor, setCommandExecutor
public boolean isReadOnly()
IdentityService
Allows to inquire whether this identity service implementation provides read-only access to the user repository, false otherwise.
Read only identity service implementations do not support the following methods:IdentityService.newUser(String)
IdentityService.saveUser(User)
IdentityService.deleteUser(String)
IdentityService.newGroup(String)
IdentityService.saveGroup(Group)
IdentityService.deleteGroup(String)
IdentityService.createMembership(String, String)
IdentityService.deleteMembership(String, String)
If these methods are invoked on a read-only identity service implementation,
the invocation will throw an UnsupportedOperationException
.
isReadOnly
in interface IdentityService
public Group newGroup(String groupId)
IdentityService
IdentityService.saveGroup(Group)
.newGroup
in interface IdentityService
groupId
- id for the new group, cannot be null.public User newUser(String userId)
IdentityService
IdentityService.saveUser(User)
.newUser
in interface IdentityService
userId
- id for the new user, cannot be null.public void saveGroup(Group group)
IdentityService
saveGroup
in interface IdentityService
group
- group to save. Cannot be null.public void saveUser(User user)
IdentityService
saveUser
in interface IdentityService
user
- user to save, cannot be null.public UserQuery createUserQuery()
IdentityService
UserQuery
that allows to programmatically query the users.createUserQuery
in interface IdentityService
public GroupQuery createGroupQuery()
IdentityService
GroupQuery
thats allows to programmatically query the groups.createGroupQuery
in interface IdentityService
public void createMembership(String userId, String groupId)
createMembership
in interface IdentityService
userId
- the userId, cannot be null.groupId
- the groupId, cannot be null.public void deleteGroup(String groupId)
IdentityService
deleteGroup
in interface IdentityService
groupId
- id of the group that should be deleted, cannot be null.public void deleteMembership(String userId, String groupId)
IdentityService
deleteMembership
in interface IdentityService
userId
- the user's id, cannot be null.groupId
- the group's id, cannot be null.public boolean checkPassword(String userId, String password)
IdentityService
checkPassword
in interface IdentityService
public void deleteUser(String userId)
deleteUser
in interface IdentityService
userId
- id of user to delete, cannot be null. When an id is passed
for an unexisting user, this operation is ignored.public void setUserPicture(String userId, Picture picture)
IdentityService
setUserPicture
in interface IdentityService
picture
- can be null to delete the picture.public Picture getUserPicture(String userId)
IdentityService
getUserPicture
in interface IdentityService
public void deleteUserPicture(String userId)
IdentityService
deleteUserPicture
in interface IdentityService
public void setAuthenticatedUserId(String authenticatedUserId)
IdentityService
IdentityService.clearAuthentication()
once the interaction is terminated.setAuthenticatedUserId
in interface IdentityService
authenticatedUserId
- the id of the current user.public void setAuthentication(Authentication auth)
setAuthentication
in interface IdentityService
public void setAuthentication(String userId, List<String> groups)
IdentityService
IdentityService.clearAuthentication()
once the interaction is terminated.setAuthentication
in interface IdentityService
groups
- the groups of the current user.public void clearAuthentication()
IdentityService
clearAuthentication
in interface IdentityService
public Authentication getCurrentAuthentication()
getCurrentAuthentication
in interface IdentityService
public String getUserInfo(String userId, String key)
IdentityService
getUserInfo
in interface IdentityService
public List<String> getUserInfoKeys(String userId)
IdentityService
getUserInfoKeys
in interface IdentityService
public List<String> getUserAccountNames(String userId)
IdentityService
getUserAccountNames
in interface IdentityService
public void setUserInfo(String userId, String key, String value)
IdentityService
setUserInfo
in interface IdentityService
public void deleteUserInfo(String userId, String key)
IdentityService
deleteUserInfo
in interface IdentityService
public void deleteUserAccount(String userId, String accountName)
IdentityService
deleteUserAccount
in interface IdentityService
public Account getUserAccount(String userId, String userPassword, String accountName)
IdentityService
getUserAccount
in interface IdentityService
public void setUserAccount(String userId, String userPassword, String accountName, String accountUsername, String accountPassword, Map<String,String> accountDetails)
IdentityService
setUserAccount
in interface IdentityService
Copyright © 2018. All rights reserved.