Package org.flowable.engine.impl
Class IdentityServiceImpl
- java.lang.Object
-
- org.flowable.common.engine.impl.service.CommonServiceImpl<C>
-
- org.flowable.common.engine.impl.service.CommonEngineServiceImpl<org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl>
-
- org.flowable.engine.impl.IdentityServiceImpl
-
- All Implemented Interfaces:
IdentityService
public class IdentityServiceImpl extends org.flowable.common.engine.impl.service.CommonEngineServiceImpl<org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl> implements IdentityService
- Author:
- Tom Baeyens
-
-
Constructor Summary
Constructors Constructor Description IdentityServiceImpl(org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl processEngineConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkPassword(String userId, String password)
Checks if the password is valid for the given user.org.flowable.idm.api.GroupQuery
createGroupQuery()
Creates aGroupQuery
that allows to programmatically query the groups.void
createMembership(String userId, String groupId)
org.flowable.idm.api.NativeGroupQuery
createNativeGroupQuery()
Returns a newNativeQuery
for tasks.org.flowable.idm.api.NativeUserQuery
createNativeUserQuery()
Returns a newNativeQuery
for tasks.org.flowable.idm.api.UserQuery
createUserQuery()
Creates aUserQuery
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
deleteUserInfo(String userId, String key)
Delete an entry of the generic extensibility key-value pairs associated with a userprotected org.flowable.idm.api.IdmIdentityService
getIdmIdentityService()
List<org.flowable.idm.api.Group>
getPotentialStarterGroups(String processDefinitionId)
Returns the potential starter groups for a given process definition.List<org.flowable.idm.api.User>
getPotentialStarterUsers(String processDefinitionId)
Returns the potential starter users for a given process definition.String
getUserInfo(String userId, String key)
Generic extensibility key-value pairs associated with a userList<String>
getUserInfoKeys(String userId)
Generic extensibility keys associated with a userorg.flowable.idm.api.Picture
getUserPicture(String userId)
Retrieves the picture for a given user.org.flowable.idm.api.Group
newGroup(String groupId)
Creates a new group.org.flowable.idm.api.User
newUser(String userId)
Creates a new user.void
saveGroup(org.flowable.idm.api.Group group)
Saves the group.void
saveUser(org.flowable.idm.api.User user)
Saves the user.void
setAuthenticatedUserId(String authenticatedUserId)
Passes the authenticated user id for this particular thread.void
setUserInfo(String userId, String key, String value)
Generic extensibility key-value pairs associated with a uservoid
setUserPicture(String userId, org.flowable.idm.api.Picture picture)
Sets the picture for a given user.void
updateUserPassword(org.flowable.idm.api.User user)
Update user password.-
Methods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutor
-
-
-
-
Method Detail
-
newGroup
public org.flowable.idm.api.Group newGroup(String groupId)
Description copied from interface:IdentityService
Creates a new group. The group is transient and must be saved usingIdentityService.saveGroup(Group)
.- Specified by:
newGroup
in interfaceIdentityService
- Parameters:
groupId
- id for the new group, cannot be null.
-
newUser
public org.flowable.idm.api.User newUser(String userId)
Description copied from interface:IdentityService
Creates a new user. The user is transient and must be saved usingIdentityService.saveUser(User)
.- Specified by:
newUser
in interfaceIdentityService
- Parameters:
userId
- id for the new user, cannot be null.
-
saveGroup
public void saveGroup(org.flowable.idm.api.Group group)
Description copied from interface:IdentityService
Saves the group. If the group already existed, the group is updated.- Specified by:
saveGroup
in interfaceIdentityService
- Parameters:
group
- group to save. Cannot be null.
-
saveUser
public void saveUser(org.flowable.idm.api.User user)
Description copied from interface:IdentityService
Saves the user. If the user already existed, the user is updated except user password. UseIdentityService.updateUserPassword(User)
to update existing user password.- Specified by:
saveUser
in interfaceIdentityService
- Parameters:
user
- user to save, cannot be null.- See Also:
IdentityService.updateUserPassword(User)
-
updateUserPassword
public void updateUserPassword(org.flowable.idm.api.User user)
Description copied from interface:IdentityService
Update user password. UseIdentityService.saveUser(User)
for new user.- Specified by:
updateUserPassword
in interfaceIdentityService
- Parameters:
user
- user password to change, cannot be null.- See Also:
IdentityService.saveUser(User)
-
createUserQuery
public org.flowable.idm.api.UserQuery createUserQuery()
Description copied from interface:IdentityService
Creates aUserQuery
that allows to programmatically query the users.- Specified by:
createUserQuery
in interfaceIdentityService
-
createNativeUserQuery
public org.flowable.idm.api.NativeUserQuery createNativeUserQuery()
Description copied from interface:IdentityService
Returns a newNativeQuery
for tasks.- Specified by:
createNativeUserQuery
in interfaceIdentityService
-
createGroupQuery
public org.flowable.idm.api.GroupQuery createGroupQuery()
Description copied from interface:IdentityService
Creates aGroupQuery
that allows to programmatically query the groups.- Specified by:
createGroupQuery
in interfaceIdentityService
-
createNativeGroupQuery
public org.flowable.idm.api.NativeGroupQuery createNativeGroupQuery()
Description copied from interface:IdentityService
Returns a newNativeQuery
for tasks.- Specified by:
createNativeGroupQuery
in interfaceIdentityService
-
getPotentialStarterGroups
public List<org.flowable.idm.api.Group> getPotentialStarterGroups(String processDefinitionId)
Description copied from interface:IdentityService
Returns the potential starter groups for a given process definition.- Specified by:
getPotentialStarterGroups
in interfaceIdentityService
- Parameters:
processDefinitionId
- process definition identifier- Returns:
- list of potential starter groups
-
getPotentialStarterUsers
public List<org.flowable.idm.api.User> getPotentialStarterUsers(String processDefinitionId)
Description copied from interface:IdentityService
Returns the potential starter users for a given process definition.- Specified by:
getPotentialStarterUsers
in interfaceIdentityService
- Parameters:
processDefinitionId
- process definition identifier- Returns:
- list of potential starter users
-
createMembership
public void createMembership(String userId, String groupId)
- Specified by:
createMembership
in interfaceIdentityService
- Parameters:
userId
- the userId, cannot be null.groupId
- the groupId, cannot be null.
-
deleteGroup
public void deleteGroup(String groupId)
Description copied from interface:IdentityService
Deletes the group. When no group exists with the given id, this operation is ignored.- Specified by:
deleteGroup
in interfaceIdentityService
- Parameters:
groupId
- id of the group that should be deleted, cannot be null.
-
deleteMembership
public void deleteMembership(String userId, String groupId)
Description copied from interface:IdentityService
Delete the membership of the user in the group. When the group or user don't exist or when the user is not a member of the group, this operation is ignored.- Specified by:
deleteMembership
in interfaceIdentityService
- Parameters:
userId
- the user's id, cannot be null.groupId
- the group's id, cannot be null.
-
checkPassword
public boolean checkPassword(String userId, String password)
Description copied from interface:IdentityService
Checks if the password is valid for the given user. Arguments userId and password are nullsafe.- Specified by:
checkPassword
in interfaceIdentityService
-
deleteUser
public void deleteUser(String userId)
- Specified by:
deleteUser
in interfaceIdentityService
- Parameters:
userId
- id of user to delete, cannot be null. When an id is passed for a non-existent user, this operation is ignored.
-
setUserPicture
public void setUserPicture(String userId, org.flowable.idm.api.Picture picture)
Description copied from interface:IdentityService
Sets the picture for a given user.- Specified by:
setUserPicture
in interfaceIdentityService
picture
- can be null to delete the picture.
-
getUserPicture
public org.flowable.idm.api.Picture getUserPicture(String userId)
Description copied from interface:IdentityService
Retrieves the picture for a given user.- Specified by:
getUserPicture
in interfaceIdentityService
- Returns:
- null if the user doesn't have a picture.
-
setAuthenticatedUserId
public void setAuthenticatedUserId(String authenticatedUserId)
Description copied from interface:IdentityService
Passes the authenticated user id for this particular thread. All service method (from any service) invocations done by the same thread will have access to this authenticatedUserId.- Specified by:
setAuthenticatedUserId
in interfaceIdentityService
-
getUserInfo
public String getUserInfo(String userId, String key)
Description copied from interface:IdentityService
Generic extensibility key-value pairs associated with a user- Specified by:
getUserInfo
in interfaceIdentityService
-
getUserInfoKeys
public List<String> getUserInfoKeys(String userId)
Description copied from interface:IdentityService
Generic extensibility keys associated with a user- Specified by:
getUserInfoKeys
in interfaceIdentityService
-
setUserInfo
public void setUserInfo(String userId, String key, String value)
Description copied from interface:IdentityService
Generic extensibility key-value pairs associated with a user- Specified by:
setUserInfo
in interfaceIdentityService
-
deleteUserInfo
public void deleteUserInfo(String userId, String key)
Description copied from interface:IdentityService
Delete an entry of the generic extensibility key-value pairs associated with a user- Specified by:
deleteUserInfo
in interfaceIdentityService
-
getIdmIdentityService
protected org.flowable.idm.api.IdmIdentityService getIdmIdentityService()
-
-