Class IdentityServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.identity.impl.IdentityServiceImpl
-
- All Implemented Interfaces:
IdentityService
@Service("identityService") public class IdentityServiceImpl extends java.lang.Object implements IdentityService
Default implementation of the Identity service- Author:
- Baptiste Mesta, Matthieu Chaffotte, Bole Zhang, Hongwen Zang, Celine Souchet
-
-
Field Summary
-
Fields inherited from interface org.bonitasoft.engine.identity.IdentityService
CUSTOM_USER_INFO_DEFINITION, CUSTOM_USER_INFO_VALUE, GROUP, ICON, ROLE, USER, USER_CONTACT_INFO, USER_LOGIN, USERMEMBERSHIP
-
-
Constructor Summary
Constructors Constructor Description IdentityServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, CredentialsEncrypter encrypter, IconService iconService)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
checkCredentials(SUser user, java.lang.String password)
Checks whether the couple user/password is valid.SCustomUserInfoDefinition
createCustomUserInfoDefinition(SCustomUserInfoDefinition customUserInfo)
Create custom user info definition in DB for a server given custom user info definitionSCustomUserInfoValue
createCustomUserInfoValue(SCustomUserInfoValue customUserInfo)
Create profileMetadataValue in DB for give profileMetadataValue objectvoid
createGroup(SGroup group, java.lang.String iconFileName, byte[] iconContent)
Create group in DB for the given group objectvoid
createRole(SRole role, java.lang.String iconFilename, byte[] iconContent)
Create role in DB for the given roleSUser
createUser(SUser user)
CreateSUser
and store it to persistence layerSUser
createUser(SUser sUser, SContactInfo personalContactInfo, SContactInfo proContactInfo, java.lang.String iconFilename, byte[] iconContent)
create a new user in database along with its contact dataSContactInfo
createUserContactInfo(SContactInfo contactInfo)
Create user contact information for given datavoid
createUserMembership(SUserMembership userMembership)
Create userMembership in DB for the given userMembership objectSUser
createUserWithoutEncryptingPassword(SUser user)
Deprecated.void
deleteAllGroups()
Delete all groups for the connected tenantvoid
deleteAllRoles()
Delete all roles for the connected tenantvoid
deleteAllUserMemberships()
Delete all user memberships for the connected tenantvoid
deleteAllUsers()
Delete all users for the connected tenantjava.util.List<java.lang.Long>
deleteChildrenGroup(long groupId)
delete children groups of the given group if there is somevoid
deleteCustomUserInfoDefinition(long customUserInfoDefinitionId)
Delete the id specified custom user infovoid
deleteCustomUserInfoDefinition(SCustomUserInfoDefinition info)
Delete the specific custom user infovoid
deleteCustomUserInfoValue(long customUserInfoValueId)
Delete the id specified profileMetadataValuevoid
deleteCustomUserInfoValue(SCustomUserInfoValue customUserInfo)
Delete the specific profileMetadataValuevoid
deleteGroup(long groupId)
Delete the id specified groupvoid
deleteGroup(SGroup group)
Delete the specific groupvoid
deleteLightUserMembership(SUserMembership userMembership)
Delete the specific light userMembershipvoid
deleteRole(long roleId)
Delete the id specified rolevoid
deleteRole(SRole role)
Delete the specific rolevoid
deleteUser(long userId)
Delete user by its idvoid
deleteUser(SUser user)
Delete the specific uservoid
deleteUserMembership(long id)
Delete the id specified userMembershipvoid
deleteUserMembership(SUserMembership userMembership)
Delete the specific userMembershipjava.util.List<SUser>
getActiveUsersInGroup(long groupId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order)
Get aList
of ActiveSUser
for givenSGroup
from specific interval, sorted by field attribute in the givenOrderByType
order order.java.util.List<SUser>
getActiveUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, java.lang.String field, OrderByType order)
Get all active users managed by a specific manager from a specific interval.java.util.List<SUser>
getActiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers)
java.util.List<SUser>
getActiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order)
Get aList
of activeSUser
for givenSRole
from specific interval, sorted by field attribute in the givenOrderByType
order order.SCustomUserInfoDefinition
getCustomUserInfoDefinition(long customUserInfoDefinitionId)
GetSCustomUserInfoDefinition
by its idSCustomUserInfoDefinition
getCustomUserInfoDefinitionByName(java.lang.String name)
Get aSCustomUserInfoDefinition
by its namejava.util.List<SCustomUserInfoDefinition>
getCustomUserInfoDefinitions(int fromIndex, int maxResults)
Get aList
ofSCustomUserInfoDefinition
from specific intervaljava.util.List<SCustomUserInfoDefinition>
getCustomUserInfoDefinitions(java.util.List<java.lang.Long> customUserInfoDefinitionIds)
Get aList
ofSCustomUserInfoDefinition
of the given identifiersSCustomUserInfoValue
getCustomUserInfoValue(long customUserInfoValueId)
GetSCustomUserInfoValue
by its idjava.util.List<SCustomUserInfoValue>
getCustomUserInfoValueOfUserAndDefinitions(long userId, java.util.List<java.lang.Long> definitionsIds)
Get SCustomUserInfoValues of definitions for a userjava.util.List<SCustomUserInfoValue>
getCustomUserInfoValues(java.util.List<java.lang.Long> customUserInfoValueIds)
Get aList
ofSCustomUserInfoValue
of the given identifiersSGroup
getGroup(long groupId)
GetSGroup
by its identifierSGroup
getGroupByPath(java.lang.String groupPath)
Get theSGroup
by its pathjava.util.List<SGroup>
getGroupChildren(long groupId, int fromIndex, int numberOfGroups)
Get aList
childSGroup
in a specific interval for specific group.java.util.List<SGroup>
getGroupChildren(long groupId, int fromIndex, int numberOfGroups, java.lang.String field, OrderByType order)
Get aList
of childSGroup
in specific interval, sorted by field attribute in the givenOrderByType
order.java.util.List<SGroup>
getGroups(int fromIndex, int numberOfGroups)
Get aList
ofSGroup
in a specific interval, this is used for pagination If the number of existing results are lower than the number asked, all results from the given index are retrieved.java.util.List<SGroup>
getGroups(int fromIndex, int numberOfGroups, java.lang.String field, OrderByType order)
Get aList
ofSGroup
in specific interval, sorted by field attribute in the givenOrderByType
order.java.util.List<SGroup>
getGroups(java.util.List<java.lang.Long> groupIds)
Get aList
ofSGroup
for specific groupIdsjava.util.List<SUser>
getInactiveUsersInGroup(long groupId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order)
Get aList
of InactiveSUser
for givenSGroup
from specific interval, sorted by field attribute in the givenOrderByType
order order.java.util.List<SUser>
getInactiveUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, java.lang.String field, OrderByType order)
Get all inactive users managed by a specific manager from a specific interval.java.util.List<SUser>
getInactiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers)
java.util.List<SUser>
getInactiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order)
Get aList
of InactiveSUser
for givenSRole
from specific interval, sorted by field attribute in the givenOrderByType
order order.SUserMembership
getLightUserMembership(long userMembershipId)
Get light userMembership by its idSUserMembership
getLightUserMembership(long userId, long groupId, long roleId)
Get theSUserMembership
of the specific user, group and role without userName, groupName and roleName being set.java.util.List<SUserMembership>
getLightUserMemberships(int startIndex, int numberOfElements)
Get light userMembership in a specific interval, this is used for paginationlong
getNumberOfCustomUserInfoDefinition()
Get total number ofSCustomUserInfoDefinition
of the current tenantlong
getNumberOfCustomUserInfoValue(QueryOptions options)
Get total number ofSCustomUserInfoValue
of the current tenant matching the criterias of the givenQueryOptions
long
getNumberOfGroupChildren(long parentGroupId)
Get number of child groups for the group identified by the given idlong
getNumberOfGroups()
Get total number ofSGroup
in the current tenantlong
getNumberOfGroups(QueryOptions options)
Get total number of groups according to specific query optionslong
getNumberOfRoles()
Get total number ofSRole
for this tenantlong
getNumberOfRoles(QueryOptions options)
Get total number of roles according to specific query optionslong
getNumberOfUserMemberships()
Get total number of userMemberships of the current tenantlong
getNumberOfUserMembershipsOfUser(long userId)
Get total number ofSUserMembership
for a specific userlong
getNumberOfUsers()
Get total number ofSUser
on the current tenantlong
getNumberOfUsers(QueryOptions options)
Get total number of users according to specific query optionslong
getNumberOfUsersByGroup(long groupId)
Get total number of users for the givenSGroup
long
getNumberOfUsersByMembership(long groupId, long roleId)
Get total number of userMemberships contains specific group and rolelong
getNumberOfUsersByRole(long roleId)
Get total number of users for the given role on the current tenantSRole
getRole(long roleId)
Gets theSRole
given by its identifier.SRole
getRoleByName(java.lang.String roleName)
Get theSRole
given by its name.java.util.List<SRole>
getRoles(int fromIndex, int numberOfRoles)
Get aList
ofSRole
in specific interval If the number of existing results are lower than the number asked, all results from the given index are retrieved.java.util.List<SRole>
getRoles(int fromIndex, int numberOfRoles, java.lang.String field, OrderByType order)
java.util.List<SRole>
getRoles(java.util.List<java.lang.Long> roleIds)
Get aList
ofSRole
by their identifiersSUser
getUser(long userId)
GetSUser
by its idSUser
getUserByUserName(java.lang.String userName)
GetSUser
by its nameSContactInfo
getUserContactInfo(long userId, boolean isPersonal)
Return the user contact info for a specific user.java.util.List<java.lang.Long>
getUserIdsWithCustomUserInfo(java.lang.String userInfoName, java.lang.String userInfoValue, boolean usePartialMatch, int fromIndex, int maxResults)
Retrieve aList
of user identifiers from specific interval.SUserMembership
getUserMembership(long userMembershipId)
GetSUserMembership
by given idSUserMembership
getUserMembership(long userId, long groupId, long roleId)
java.util.List<SUserMembership>
getUserMemberships(int fromIndex, int numberOfUserMemberships)
Get aList
ofSUserMembership
from specific intervaljava.util.List<SUserMembership>
getUserMemberships(int fromIndex, int numberOfResult, OrderByOption orderByOption)
Get aList
ofSUserMembership
from specific interval, sorted by field attribute in the givenOrderByType
order order.java.util.List<SUserMembership>
getUserMemberships(java.util.List<java.lang.Long> userMembershipIds)
Get aList
ofSUserMembership
of the given identifiers if they existsjava.util.List<SUserMembership>
getUserMembershipsOfGroup(long groupId, int startIndex, int maxResults)
Get aList
ofSUserMembership
for given group from specific intervaljava.util.List<SUserMembership>
getUserMembershipsOfRole(long roleId, int startIndex, int maxResults)
Get aList
ofSUserMembership
for given role from specific intervaljava.util.List<SUserMembership>
getUserMembershipsOfUser(long userId, int fromIndex, int numberOfUsers)
GetSUserMembership
for a specific interval for a given userjava.util.List<SUserMembership>
getUserMembershipsOfUser(long userId, int fromIndex, int numberOfMemberships, java.lang.String field, OrderByType order)
Get aList
ofSUserMembership
of a given user from specific interval, sorted by field attribute in the givenOrderByType
sortOrder order.java.util.List<SUserMembership>
getUserMembershipsOfUser(long userId, int fromIndex, int numberPerPage, OrderByOption orderByOption)
Get aList
ofSUserMembership
of a given user from specific interval, sorted by default field in the givenOrderByType
sortOrder order.java.util.List<SUser>
getUsers(int fromIndex, int numberOfUsers)
Get aList
ofSUser
from a specific interval.java.util.List<SUser>
getUsers(int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order)
Get aList
of childSUser
from specific interval, sorted by field attribute in the givenOrderByType
order order.java.util.List<SUser>
getUsers(java.util.List<java.lang.Long> userIds)
GetSUser
by their userIdsjava.util.List<SUser>
getUsersByUsername(java.util.List<java.lang.String> userNames)
retrieve aList
ofSUser
from their names.java.util.List<SUser>
getUsersInGroup(long groupId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order)
Get aList
ofSUser
for givenSGroup
from specific interval, sorted by field attribute in the givenOrderByType
order order.java.util.List<SUser>
getUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, java.lang.String field, OrderByType order)
Get all users (both active and inactive) managed by a specific manager from a specific interval.java.util.List<SUser>
getUsersWithRole(long roleId, int fromIndex, int numberOfUsers)
java.util.List<SUser>
getUsersWithRole(long roleId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order)
Get aList
ofSUser
for givenSRole
from specific interval, sorted by field attribute in the givenOrderByType
order order.boolean
hasCustomUserInfoDefinition(java.lang.String name)
Verify if there is aSCustomUserInfoDefinition
of the given namejava.util.List<SCustomUserInfoValue>
searchCustomUserInfoValue(QueryOptions options)
SearchSCustomUserInfoValue
matching the criterias of the givenQueryOptions
java.util.List<SGroup>
searchGroups(QueryOptions options)
Search groups according to specific query optionsjava.util.List<SRole>
searchRoles(QueryOptions options)
Search roles according to specific query optionsjava.util.List<SUser>
searchUsers(QueryOptions options)
Search users according to specific query optionsvoid
updateCustomUserInfoDefinition(SCustomUserInfoDefinition customUserInfo, EntityUpdateDescriptor descriptor)
Update customUserInfoDefinition according to the descriptorvoid
updateCustomUserInfoValue(SCustomUserInfoValue customUserInfo, EntityUpdateDescriptor descriptor)
Update profileMetadataValue according to the descriptorvoid
updateGroup(SGroup group, EntityUpdateDescriptor descriptor, EntityUpdateDescriptor iconUpdater)
Update group according to the descriptorSRole
updateRole(SRole role, EntityUpdateDescriptor descriptor, EntityUpdateDescriptor iconUpdater)
Update role according to the descriptorSUser
updateUser(long userId, EntityUpdateDescriptor userUpdateDescriptor, EntityUpdateDescriptor personalDataUpdateDescriptor, EntityUpdateDescriptor professionalDataUpdateDescriptor, EntityUpdateDescriptor iconUpdater)
Update the user having id userId according to the entity update descriptors in parametersvoid
updateUser(SUser user, EntityUpdateDescriptor descriptor)
UpdateSUser
according to theEntityUpdateDescriptor
void
updateUser(SUser user, EntityUpdateDescriptor descriptor, boolean isPasswordEncrypted)
Deprecated.void
updateUserContactInfo(SContactInfo contactInfo, EntityUpdateDescriptor descriptor)
Update user contact information according to the descriptorvoid
updateUserMembership(SUserMembership userMembership, EntityUpdateDescriptor descriptor)
Update userMembership according to the descriptor
-
-
-
Constructor Detail
-
IdentityServiceImpl
public IdentityServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, CredentialsEncrypter encrypter, IconService iconService)
-
-
Method Detail
-
createGroup
public void createGroup(SGroup group, java.lang.String iconFileName, byte[] iconContent) throws SGroupCreationException
Description copied from interface:IdentityService
Create group in DB for the given group object- Specified by:
createGroup
in interfaceIdentityService
- Parameters:
group
- A group object- Throws:
SGroupCreationException
-
createCustomUserInfoDefinition
public SCustomUserInfoDefinition createCustomUserInfoDefinition(SCustomUserInfoDefinition customUserInfo) throws SCustomUserInfoDefinitionAlreadyExistsException, SCustomUserInfoDefinitionCreationException
Description copied from interface:IdentityService
Create custom user info definition in DB for a server given custom user info definition- Specified by:
createCustomUserInfoDefinition
in interfaceIdentityService
- Parameters:
customUserInfo
- SCustomUserInfoDefinition object- Throws:
SCustomUserInfoDefinitionAlreadyExistsException
- TODOSCustomUserInfoDefinitionCreationException
- TODO
-
createCustomUserInfoValue
public SCustomUserInfoValue createCustomUserInfoValue(SCustomUserInfoValue customUserInfo) throws SIdentityException
Description copied from interface:IdentityService
Create profileMetadataValue in DB for give profileMetadataValue object- Specified by:
createCustomUserInfoValue
in interfaceIdentityService
- Parameters:
customUserInfo
- A profileMetadataValue object- Throws:
SIdentityException
-
createRole
public void createRole(SRole role, java.lang.String iconFilename, byte[] iconContent) throws SIdentityException
Description copied from interface:IdentityService
Create role in DB for the given role- Specified by:
createRole
in interfaceIdentityService
- Parameters:
role
- A role object- Throws:
SIdentityException
-
createUser
public SUser createUser(SUser user) throws SUserCreationException
Description copied from interface:IdentityService
CreateSUser
and store it to persistence layer- Specified by:
createUser
in interfaceIdentityService
- Parameters:
user
- The user to create and store- Returns:
- the created user with its identifier set
- Throws:
SUserCreationException
- occurs on persistence layer access problem
-
createUserWithoutEncryptingPassword
@Deprecated public SUser createUserWithoutEncryptingPassword(SUser user) throws SUserCreationException
Deprecated.Description copied from interface:IdentityService
Create user in DB for given user and- Specified by:
createUserWithoutEncryptingPassword
in interfaceIdentityService
- Parameters:
user
- The user object- Throws:
SUserCreationException
-
createUserContactInfo
public SContactInfo createUserContactInfo(SContactInfo contactInfo) throws SUserCreationException
Description copied from interface:IdentityService
Create user contact information for given data- Specified by:
createUserContactInfo
in interfaceIdentityService
- Parameters:
contactInfo
- The user contact information object- Returns:
- The contact info created
- Throws:
SUserCreationException
-
createUserMembership
public void createUserMembership(SUserMembership userMembership) throws SUserMembershipCreationException
Description copied from interface:IdentityService
Create userMembership in DB for the given userMembership object- Specified by:
createUserMembership
in interfaceIdentityService
- Parameters:
userMembership
- A userMembership object- Throws:
SUserMembershipCreationException
-
deleteGroup
public void deleteGroup(long groupId) throws SGroupNotFoundException, SGroupDeletionException
Description copied from interface:IdentityService
Delete the id specified group- Specified by:
deleteGroup
in interfaceIdentityService
- Parameters:
groupId
- The identifier of group- Throws:
SGroupNotFoundException
- Error occurs when no group found with the specific groupIdSGroupDeletionException
-
deleteGroup
public void deleteGroup(SGroup group) throws SGroupDeletionException
Description copied from interface:IdentityService
Delete the specific group- Specified by:
deleteGroup
in interfaceIdentityService
- Parameters:
group
- The group will be deleted- Throws:
SGroupDeletionException
-
deleteAllGroups
public void deleteAllGroups() throws SGroupDeletionException
Description copied from interface:IdentityService
Delete all groups for the connected tenant- Specified by:
deleteAllGroups
in interfaceIdentityService
- Throws:
SGroupDeletionException
-
deleteChildrenGroup
public java.util.List<java.lang.Long> deleteChildrenGroup(long groupId) throws SGroupDeletionException, SGroupNotFoundException
Description copied from interface:IdentityService
delete children groups of the given group if there is some- Specified by:
deleteChildrenGroup
in interfaceIdentityService
- Parameters:
groupId
- The index of the group to delete- Throws:
SGroupDeletionException
SGroupNotFoundException
-
deleteCustomUserInfoDefinition
public void deleteCustomUserInfoDefinition(long customUserInfoDefinitionId) throws SIdentityException
Description copied from interface:IdentityService
Delete the id specified custom user info- Specified by:
deleteCustomUserInfoDefinition
in interfaceIdentityService
- Parameters:
customUserInfoDefinitionId
- The identifier of custom user info- Throws:
SIdentityException
-
deleteCustomUserInfoDefinition
public void deleteCustomUserInfoDefinition(SCustomUserInfoDefinition info) throws SIdentityException
Description copied from interface:IdentityService
Delete the specific custom user info- Specified by:
deleteCustomUserInfoDefinition
in interfaceIdentityService
- Parameters:
info
- The custom user info object will be deleted- Throws:
SIdentityException
-
deleteCustomUserInfoValue
public void deleteCustomUserInfoValue(long customUserInfoValueId) throws SIdentityException
Description copied from interface:IdentityService
Delete the id specified profileMetadataValue- Specified by:
deleteCustomUserInfoValue
in interfaceIdentityService
- Parameters:
customUserInfoValueId
- The identifier of profileMetadataValue- Throws:
SIdentityException
-
deleteCustomUserInfoValue
public void deleteCustomUserInfoValue(SCustomUserInfoValue customUserInfo) throws SIdentityException
Description copied from interface:IdentityService
Delete the specific profileMetadataValue- Specified by:
deleteCustomUserInfoValue
in interfaceIdentityService
- Parameters:
customUserInfo
- The profileMetadataValue object will be deleted- Throws:
SIdentityException
-
deleteRole
public void deleteRole(long roleId) throws SRoleNotFoundException, SRoleDeletionException
Description copied from interface:IdentityService
Delete the id specified role- Specified by:
deleteRole
in interfaceIdentityService
- Parameters:
roleId
- The role identifier- Throws:
SRoleNotFoundException
- Error occurs when no role found with the specific roleIdSRoleDeletionException
-
deleteRole
public void deleteRole(SRole role) throws SRoleDeletionException
Description copied from interface:IdentityService
Delete the specific role- Specified by:
deleteRole
in interfaceIdentityService
- Parameters:
role
- The role will be deleted- Throws:
SRoleDeletionException
-
deleteAllRoles
public void deleteAllRoles() throws SRoleDeletionException
Description copied from interface:IdentityService
Delete all roles for the connected tenant- Specified by:
deleteAllRoles
in interfaceIdentityService
- Throws:
SRoleDeletionException
-
deleteUser
public void deleteUser(long userId) throws SUserDeletionException
Description copied from interface:IdentityService
Delete user by its id- Specified by:
deleteUser
in interfaceIdentityService
- Parameters:
userId
- The identifier of user- Throws:
SUserDeletionException
-
deleteUser
public void deleteUser(SUser user) throws SUserDeletionException
Description copied from interface:IdentityService
Delete the specific user- Specified by:
deleteUser
in interfaceIdentityService
- Parameters:
user
- The user will be deleted- Throws:
SUserDeletionException
-
deleteAllUsers
public void deleteAllUsers() throws SUserDeletionException
Description copied from interface:IdentityService
Delete all users for the connected tenant- Specified by:
deleteAllUsers
in interfaceIdentityService
- Throws:
SUserDeletionException
-
getLightUserMembership
public SUserMembership getLightUserMembership(long userMembershipId) throws SIdentityException
Description copied from interface:IdentityService
Get light userMembership by its id- Specified by:
getLightUserMembership
in interfaceIdentityService
- Parameters:
userMembershipId
- The identifier of userMembership- Returns:
- a SUserMembership object without userName, groupName and roleName
- Throws:
SIdentityException
-
deleteUserMembership
public void deleteUserMembership(SUserMembership userMembership) throws SMembershipDeletionException
Description copied from interface:IdentityService
Delete the specific userMembership- Specified by:
deleteUserMembership
in interfaceIdentityService
- Parameters:
userMembership
- The userMembership will be deleted- Throws:
SMembershipDeletionException
-
deleteUserMembership
public void deleteUserMembership(long id) throws SMembershipDeletionException
Description copied from interface:IdentityService
Delete the id specified userMembership- Specified by:
deleteUserMembership
in interfaceIdentityService
- Parameters:
id
- The identifier of userMembership- Throws:
SMembershipDeletionException
-
deleteLightUserMembership
public void deleteLightUserMembership(SUserMembership userMembership) throws SMembershipDeletionException
Description copied from interface:IdentityService
Delete the specific light userMembership- Specified by:
deleteLightUserMembership
in interfaceIdentityService
- Throws:
SMembershipDeletionException
-
deleteAllUserMemberships
public void deleteAllUserMemberships() throws SMembershipDeletionException
Description copied from interface:IdentityService
Delete all user memberships for the connected tenant- Specified by:
deleteAllUserMemberships
in interfaceIdentityService
- Throws:
SMembershipDeletionException
-
getGroup
public SGroup getGroup(long groupId) throws SGroupNotFoundException
Description copied from interface:IdentityService
GetSGroup
by its identifier- Specified by:
getGroup
in interfaceIdentityService
- Parameters:
groupId
- The group identifier- Returns:
- the group
- Throws:
SGroupNotFoundException
- occurs when the groupId does not refer to any group.
-
getGroupChildren
public java.util.List<SGroup> getGroupChildren(long groupId, int fromIndex, int numberOfGroups) throws SIdentityException
Description copied from interface:IdentityService
Get aList
childSGroup
in a specific interval for specific group. This is used for pagination If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getGroupChildren
in interfaceIdentityService
- Parameters:
groupId
- The parent group identifierfromIndex
- Index of the record to be retrieved from. First record has index 0numberOfGroups
- Number of result to retrieve- Returns:
- a
List
of childSGroup
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getGroupChildren
public java.util.List<SGroup> getGroupChildren(long groupId, int fromIndex, int numberOfGroups, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of childSGroup
in specific interval, sorted by field attribute in the givenOrderByType
order.For instance, getGroupChildren(0,10,"displayName", OrderByType.DESC) returns the 10 first child
SGroup
of the parentSGroup
identified by parentGroupId sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SGroupBuilderFactory
to get a list of available field keys to sort- Specified by:
getGroupChildren
in interfaceIdentityService
- Parameters:
groupId
- The parent group identifierfromIndex
- Index of the record to be retrieved from. First record has index 0numberOfGroups
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
of childSGroup
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getGroups
public java.util.List<SGroup> getGroups(int fromIndex, int numberOfGroups) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSGroup
in a specific interval, this is used for pagination If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getGroups
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfGroups
- Number of result to retrieve- Returns:
- a
List
ofSGroup
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getGroups
public java.util.List<SGroup> getGroups(int fromIndex, int numberOfGroups, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSGroup
in specific interval, sorted by field attribute in the givenOrderByType
order.For instance, getGroups(0,10,"displayName", OrderByType.DESC) returns the 10 first
SGroup
sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SGroupBuilderFactory
to get a list of available field keys to sort- Specified by:
getGroups
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfGroups
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
of paginatedSGroup
objects - Throws:
SIdentityException
- occurs on persistence layer access problem- See Also:
SGroupBuilderFactory
-
getGroups
public java.util.List<SGroup> getGroups(java.util.List<java.lang.Long> groupIds) throws SGroupNotFoundException
Description copied from interface:IdentityService
Get aList
ofSGroup
for specific groupIds- Specified by:
getGroups
in interfaceIdentityService
- Parameters:
groupIds
- The group identifiers- Returns:
- a
List
ofSGroup
object - Throws:
SGroupNotFoundException
- occurs when no given group identifiers refer to any group.
-
getUserMemberships
public java.util.List<SUserMembership> getUserMemberships(int fromIndex, int numberOfResult, OrderByOption orderByOption) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUserMembership
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getUserMemberships(0,10,"id", OrderByType.DESC) returns the 10 first
SUserMembership
sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUserMembershipBuilderFactory
to check available field keys to sort- Specified by:
getUserMemberships
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfResult
- Number of result to retrieve- Returns:
- a
List
ofSUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem- See Also:
SUserMembershipBuilderFactory
-
getUserMembershipsOfGroup
public java.util.List<SUserMembership> getUserMembershipsOfGroup(long groupId, int startIndex, int maxResults) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUserMembership
for given group from specific intervalIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
- Specified by:
getUserMembershipsOfGroup
in interfaceIdentityService
- Parameters:
groupId
- Identifier of the groupstartIndex
- Index of the record to be retrieved from. First record has index 0maxResults
- Number of result to retrieve- Returns:
- a
List
ofSUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUserMembershipsOfRole
public java.util.List<SUserMembership> getUserMembershipsOfRole(long roleId, int startIndex, int maxResults) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUserMembership
for given role from specific intervalIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
- Specified by:
getUserMembershipsOfRole
in interfaceIdentityService
- Parameters:
roleId
- Identifier of the rolestartIndex
- Index of the record to be retrieved from. First record has index 0maxResults
- Number of result to retrieve- Returns:
- a
List
ofSUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfGroupChildren
public long getNumberOfGroupChildren(long parentGroupId) throws SIdentityException
Description copied from interface:IdentityService
Get number of child groups for the group identified by the given id- Specified by:
getNumberOfGroupChildren
in interfaceIdentityService
- Parameters:
parentGroupId
- The parent group identifier- Returns:
- the number of child groups
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfGroups
public long getNumberOfGroups() throws SIdentityException
Description copied from interface:IdentityService
Get total number ofSGroup
in the current tenant- Specified by:
getNumberOfGroups
in interfaceIdentityService
- Returns:
- the total number of
SGroup
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfCustomUserInfoDefinition
public long getNumberOfCustomUserInfoDefinition() throws SIdentityException
Description copied from interface:IdentityService
Get total number ofSCustomUserInfoDefinition
of the current tenant- Specified by:
getNumberOfCustomUserInfoDefinition
in interfaceIdentityService
- Returns:
- the total number of
SCustomUserInfoDefinition
of the current tenant - Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfCustomUserInfoValue
public long getNumberOfCustomUserInfoValue(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
Get total number ofSCustomUserInfoValue
of the current tenant matching the criterias of the givenQueryOptions
- Specified by:
getNumberOfCustomUserInfoValue
in interfaceIdentityService
- Parameters:
options
- TheQueryOptions
containing filtering conditions- Returns:
- the total number of custom user info value
- Throws:
SBonitaReadException
-
getNumberOfRoles
public long getNumberOfRoles() throws SIdentityException
Description copied from interface:IdentityService
Get total number ofSRole
for this tenant- Specified by:
getNumberOfRoles
in interfaceIdentityService
- Returns:
- the total number of roles for this tenant
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfUsers
public long getNumberOfUsers() throws SIdentityException
Description copied from interface:IdentityService
Get total number ofSUser
on the current tenant- Specified by:
getNumberOfUsers
in interfaceIdentityService
- Returns:
- the total number of users
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfUserMembershipsOfUser
public long getNumberOfUserMembershipsOfUser(long userId) throws SIdentityException
Description copied from interface:IdentityService
Get total number ofSUserMembership
for a specific user- Specified by:
getNumberOfUserMembershipsOfUser
in interfaceIdentityService
- Parameters:
userId
- The user's identifier- Returns:
- total number of userMemberships for the specific user
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfUsersByGroup
public long getNumberOfUsersByGroup(long groupId) throws SIdentityException
Description copied from interface:IdentityService
Get total number of users for the givenSGroup
- Specified by:
getNumberOfUsersByGroup
in interfaceIdentityService
- Parameters:
groupId
- The identifier of theSGroup
- Returns:
- total number of users in the given group
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfUsersByRole
public long getNumberOfUsersByRole(long roleId) throws SIdentityException
Description copied from interface:IdentityService
Get total number of users for the given role on the current tenant- Specified by:
getNumberOfUsersByRole
in interfaceIdentityService
- Parameters:
roleId
- The identifier of role- Returns:
- total number of users related to the given role
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getNumberOfUsersByMembership
public long getNumberOfUsersByMembership(long groupId, long roleId) throws SIdentityException
Description copied from interface:IdentityService
Get total number of userMemberships contains specific group and role- Specified by:
getNumberOfUsersByMembership
in interfaceIdentityService
- Parameters:
groupId
- The identifier of grouproleId
- The identifier of role- Returns:
- the number of userMemberships
- Throws:
SIdentityException
-
getCustomUserInfoDefinitionByName
public SCustomUserInfoDefinition getCustomUserInfoDefinitionByName(java.lang.String name) throws SCustomUserInfoDefinitionNotFoundException, SCustomUserInfoDefinitionReadException
Description copied from interface:IdentityService
Get aSCustomUserInfoDefinition
by its name- Specified by:
getCustomUserInfoDefinitionByName
in interfaceIdentityService
- Parameters:
name
- The name of theSCustomUserInfoDefinition
to retrieve- Returns:
- the
SCustomUserInfoDefinition
identified by the given name - Throws:
SCustomUserInfoDefinitionNotFoundException
- if there is no custom user info definition for the given nameSCustomUserInfoDefinitionReadException
- if an exception occurs when trying to retrieve the custom user info definition
-
hasCustomUserInfoDefinition
public boolean hasCustomUserInfoDefinition(java.lang.String name) throws SCustomUserInfoDefinitionReadException
Description copied from interface:IdentityService
Verify if there is aSCustomUserInfoDefinition
of the given name- Specified by:
hasCustomUserInfoDefinition
in interfaceIdentityService
- Parameters:
name
- TheSCustomUserInfoDefinition
's name to check- Returns:
- the
SCustomUserInfoDefinition
of the given name - Throws:
SCustomUserInfoDefinitionReadException
- if an exception occurs when trying to retrieve the custom user info definition
-
getCustomUserInfoDefinitions
public java.util.List<SCustomUserInfoDefinition> getCustomUserInfoDefinitions(int fromIndex, int maxResults) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSCustomUserInfoDefinition
from specific intervalIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
- Specified by:
getCustomUserInfoDefinitions
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0maxResults
- Number of result to retrieve- Returns:
- a
List
ofSCustomUserInfoDefinition
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUserIdsWithCustomUserInfo
public java.util.List<java.lang.Long> getUserIdsWithCustomUserInfo(java.lang.String userInfoName, java.lang.String userInfoValue, boolean usePartialMatch, int fromIndex, int maxResults) throws SIdentityException
Description copied from interface:IdentityService
Retrieve aList
of user identifiers from specific interval. The returned user's ids have their associated user's userInfo of the given name userInfoName matches the given value userInfoValue partially or not depending on the usePartialMatch parameter.If the number of existing results are lower than the number asked, all results from the given index are retrieved.
- Specified by:
getUserIdsWithCustomUserInfo
in interfaceIdentityService
- Parameters:
userInfoName
- The user's information name.userInfoValue
- The user's information value.usePartialMatch
- Defines whether the custom user information value should use a partial match.fromIndex
- The index of the first record to be retrieved. First record has index 0.maxResults
- The max results to be retrieved.- Returns:
- the list identifiers of users matching the given user's information name & value.
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getCustomUserInfoDefinition
public SCustomUserInfoDefinition getCustomUserInfoDefinition(long customUserInfoDefinitionId) throws SIdentityException
Description copied from interface:IdentityService
GetSCustomUserInfoDefinition
by its id- Specified by:
getCustomUserInfoDefinition
in interfaceIdentityService
- Parameters:
customUserInfoDefinitionId
- TheSCustomUserInfoDefinition
's identifier- Returns:
- the customUserInfoDefinition
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getCustomUserInfoDefinitions
public java.util.List<SCustomUserInfoDefinition> getCustomUserInfoDefinitions(java.util.List<java.lang.Long> customUserInfoDefinitionIds) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSCustomUserInfoDefinition
of the given identifiers- Specified by:
getCustomUserInfoDefinitions
in interfaceIdentityService
- Parameters:
customUserInfoDefinitionIds
- AList
ofSCustomUserInfoDefinition
identifiers- Returns:
- a
List
ofSCustomUserInfoDefinition
- Throws:
SIdentityException
- occurs on persistence layer access problem or if none identifiers match an existingSCustomUserInfoDefinition
-
getCustomUserInfoValue
public SCustomUserInfoValue getCustomUserInfoValue(long customUserInfoValueId) throws SCustomUserInfoValueNotFoundException, SCustomUserInfoValueReadException
Description copied from interface:IdentityService
GetSCustomUserInfoValue
by its id- Specified by:
getCustomUserInfoValue
in interfaceIdentityService
- Parameters:
customUserInfoValueId
- The identifier of the custom user info value- Returns:
- the
SCustomUserInfoValue
- Throws:
SCustomUserInfoValueNotFoundException
- if no custom user info value is found for the given idSCustomUserInfoValueReadException
- if an exception occurs while trying to get the custom user info value
-
getCustomUserInfoValues
public java.util.List<SCustomUserInfoValue> getCustomUserInfoValues(java.util.List<java.lang.Long> customUserInfoValueIds) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSCustomUserInfoValue
of the given identifiers- Specified by:
getCustomUserInfoValues
in interfaceIdentityService
- Parameters:
customUserInfoValueIds
- AList
ofSCustomUserInfoValue
identifiers- Returns:
- A
List
ofSCustomUserInfoValue
- Throws:
SIdentityException
- occurs on persistence layer access problem or if none identifiers match an existingSCustomUserInfoDefinition
-
getRole
public SRole getRole(long roleId) throws SRoleNotFoundException
Description copied from interface:IdentityService
Gets theSRole
given by its identifier.- Specified by:
getRole
in interfaceIdentityService
- Parameters:
roleId
- the role identifier- Returns:
- the role of the given id
- Throws:
SRoleNotFoundException
- occurs when the roleId does not refer to any role.
-
getRoleByName
public SRole getRoleByName(java.lang.String roleName) throws SRoleNotFoundException
Description copied from interface:IdentityService
Get theSRole
given by its name.- Specified by:
getRoleByName
in interfaceIdentityService
- Parameters:
roleName
- The name of role- Returns:
- the role of the given name
- Throws:
SRoleNotFoundException
- occurs when the roleName does not refer to any role.
-
getGroupByPath
public SGroup getGroupByPath(java.lang.String groupPath) throws SGroupNotFoundException
Description copied from interface:IdentityService
Get theSGroup
by its path- Specified by:
getGroupByPath
in interfaceIdentityService
- Parameters:
groupPath
- The group path- Returns:
- the group
- Throws:
SGroupNotFoundException
- Occurs when the groupPath does not refer to any group.
-
getRoles
public java.util.List<SRole> getRoles(int fromIndex, int numberOfRoles) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSRole
in specific interval If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getRoles
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfRoles
- Number of result to retrieve- Returns:
- a list of SRole objects
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getRoles
public java.util.List<SRole> getRoles(int fromIndex, int numberOfRoles, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSRole
in specific interval, sorted by field attribute in the givenOrderByType
order.For instance, getRoles(0,10,"displayName", OrderByType.DESC) returns the 10 first roles sorted by "displayName" in desc order
If the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SRoleBuilderFactory
to get a list of available field keys to sort- Specified by:
getRoles
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfRoles
- Number of result to retrievefield
- The field used by the sortorder
- ASC or DESC- Returns:
- a list of paginated SRole objects
- Throws:
SIdentityException
- occurs on persistence layer access problem- See Also:
to get a list of available field keys to use
-
getRoles
public java.util.List<SRole> getRoles(java.util.List<java.lang.Long> roleIds) throws SRoleNotFoundException
Description copied from interface:IdentityService
Get aList
ofSRole
by their identifiers- Specified by:
getRoles
in interfaceIdentityService
- Parameters:
roleIds
- the role identifiers- Returns:
- a list of
SRole
objects - Throws:
SRoleNotFoundException
- Occurs when roleId does not refer to any role.
-
getUser
public SUser getUser(long userId) throws SUserNotFoundException
Description copied from interface:IdentityService
GetSUser
by its id- Specified by:
getUser
in interfaceIdentityService
- Parameters:
userId
- The user identifier- Returns:
- the user
- Throws:
SUserNotFoundException
- occurs when the userId does not refer to any user.
-
getUserContactInfo
public SContactInfo getUserContactInfo(long userId, boolean isPersonal) throws SIdentityException
Description copied from interface:IdentityService
Return the user contact info for a specific user.- Specified by:
getUserContactInfo
in interfaceIdentityService
- Parameters:
userId
- the ID of the user to retrieve the contact info fromisPersonal
- Do we want personal contact information (or professional) ?- Returns:
- the corresponding SContactInfo, if found
- Throws:
SIdentityException
- if a Read problem occurred
-
getUserByUserName
public SUser getUserByUserName(java.lang.String userName) throws SUserNotFoundException
Description copied from interface:IdentityService
GetSUser
by its name- Specified by:
getUserByUserName
in interfaceIdentityService
- Parameters:
userName
- The user name- Returns:
- the user
- Throws:
SUserNotFoundException
- occurs when the user name does not refer to any user.
-
getUserMembership
public SUserMembership getUserMembership(long userMembershipId) throws SIdentityException
Description copied from interface:IdentityService
GetSUserMembership
by given id- Specified by:
getUserMembership
in interfaceIdentityService
- Parameters:
userMembershipId
- The identifier of userMembership- Returns:
- the
SUserMembership
of the given id - Throws:
SIdentityException
- occurs on persistence layer access problem or if theSUserMembership
does not exists
-
getUserMemberships
public java.util.List<SUserMembership> getUserMemberships(java.util.List<java.lang.Long> userMembershipIds) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUserMembership
of the given identifiers if they exists- Specified by:
getUserMemberships
in interfaceIdentityService
- Parameters:
userMembershipIds
- TheSUserMembership
's identifiers- Returns:
- a
List
ofSUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem or if none identifiers match an existingSUserMembership
-
getUsers
public java.util.List<SUser> getUsers(int fromIndex, int numberOfUsers) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUser
from a specific interval. If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getUsers
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrieve- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUsers
public java.util.List<SUser> getUsers(int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of childSUser
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getUsers(0,10,"displayName", OrderByType.DESC) returns the 10 first
SUser
sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUser
to get a list of available field keys to sort- Specified by:
getUsers
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result we want to get. Maximum number of result returned.field
- The field used by the orderorder
- ASC or DESC- Returns:
- a
List
of paginatedSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUsers
public java.util.List<SUser> getUsers(java.util.List<java.lang.Long> userIds) throws SUserNotFoundException
Description copied from interface:IdentityService
GetSUser
by their userIds- Specified by:
getUsers
in interfaceIdentityService
- Parameters:
userIds
- AList
of user identifiers- Returns:
- a
List
ofSUser
- Throws:
SUserNotFoundException
- occurs when none of the given userIds refer to any user.
-
getUsersByUsername
public java.util.List<SUser> getUsersByUsername(java.util.List<java.lang.String> userNames) throws SIdentityException
Description copied from interface:IdentityService
retrieve aList
ofSUser
from their names.- Specified by:
getUsersByUsername
in interfaceIdentityService
- Parameters:
userNames
- the list of user names- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- If an exception occurs when retrieving the users
-
getUsersInGroup
public java.util.List<SUser> getUsersInGroup(long groupId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUser
for givenSGroup
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getUsersInGroup(1,0,10,"displayName", OrderByType.DESC) returns the 10 first
SUser
of theSGroup
with id '1' sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUser
to get a list of available field keys to sort- Specified by:
getUsersInGroup
in interfaceIdentityService
- Parameters:
groupId
- Identifier of theSGroup
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getActiveUsersInGroup
public java.util.List<SUser> getActiveUsersInGroup(long groupId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of ActiveSUser
for givenSGroup
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getActiveUsersInGroup(1,0,10,"displayName", OrderByType.DESC) returns the 10 first
SUser
of theSGroup
with id '1' sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUser
to get a list of available field keys to sort- Specified by:
getActiveUsersInGroup
in interfaceIdentityService
- Parameters:
groupId
- Identifier of theSGroup
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getInactiveUsersInGroup
public java.util.List<SUser> getInactiveUsersInGroup(long groupId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of InactiveSUser
for givenSGroup
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getInactiveUsersInGroup(1,0,10,"displayName", OrderByType.DESC) returns the 10 first
SUser
of theSGroup
with id '1' sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUser
to get a list of available field keys to sort- Specified by:
getInactiveUsersInGroup
in interfaceIdentityService
- Parameters:
groupId
- Identifier of theSGroup
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUsersWithManager
public java.util.List<SUser> getUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get all users (both active and inactive) managed by a specific manager from a specific interval. If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getUsersWithManager
in interfaceIdentityService
- Parameters:
managerId
- The manager identifier, actually it is user identifierfromIndex
- Index of the record to be retrieved from. First record has index 0numberMaxOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getActiveUsersWithManager
public java.util.List<SUser> getActiveUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get all active users managed by a specific manager from a specific interval. If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getActiveUsersWithManager
in interfaceIdentityService
- Parameters:
managerId
- The manager identifier, actually it is user identifierfromIndex
- Index of the record to be retrieved from. First record has index 0numberMaxOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getInactiveUsersWithManager
public java.util.List<SUser> getInactiveUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get all inactive users managed by a specific manager from a specific interval. If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getInactiveUsersWithManager
in interfaceIdentityService
- Parameters:
managerId
- The manager identifier, actually it is user identifierfromIndex
- Index of the record to be retrieved from. First record has index 0numberMaxOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUsersWithRole
public java.util.List<SUser> getUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUser
from a specific interval for the givenSRole
identifier. If the number of existing results are lower than the number asked, all results from the given index are retrieved. Note that this method returns both active and inactive users.- Specified by:
getUsersWithRole
in interfaceIdentityService
- Parameters:
roleId
- The identifier of theSRole
of theSUser
to retrievefromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrieve- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getActiveUsersWithRole
public java.util.List<SUser> getActiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of activeSUser
from a specific interval for the givenSRole
identifier. If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getActiveUsersWithRole
in interfaceIdentityService
- Parameters:
roleId
- The identifier of theSRole
of theSUser
to retrievefromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrieve- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getInactiveUsersWithRole
public java.util.List<SUser> getInactiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of inactiveSUser
from a specific interval for the givenSRole
identifier. If the number of existing results are lower than the number asked, all results from the given index are retrieved.- Specified by:
getInactiveUsersWithRole
in interfaceIdentityService
- Parameters:
roleId
- The identifier of theSRole
of theSUser
to retrievefromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrieve- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUsersWithRole
public java.util.List<SUser> getUsersWithRole(long roleId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUser
for givenSRole
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getUsersWithRole(1,0,10,"displayName", OrderByType.DESC) returns the 10 first
SUser
of theSRole
with id '1' sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUser
to get a list of available field keys to sort- Specified by:
getUsersWithRole
in interfaceIdentityService
- Parameters:
roleId
- The identifier of theSRole
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getActiveUsersWithRole
public java.util.List<SUser> getActiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of activeSUser
for givenSRole
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getActiveUsersWithRole(1,0,10,"displayName", OrderByType.DESC) returns the 10 first
SUser
of theSRole
with id '1' sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUser
to get a list of available field keys to sort- Specified by:
getActiveUsersWithRole
in interfaceIdentityService
- Parameters:
roleId
- The identifier of theSRole
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getInactiveUsersWithRole
public java.util.List<SUser> getInactiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
of InactiveSUser
for givenSRole
from specific interval, sorted by field attribute in the givenOrderByType
order order.For instance, getInactiveUsersWithRole(1,0,10,"displayName", OrderByType.DESC) returns the 10 first
SUser
of theSRole
with id '1' sorted by "displayName" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUser
to get a list of available field keys to sort- Specified by:
getInactiveUsersWithRole
in interfaceIdentityService
- Parameters:
roleId
- The identifier of theSRole
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrievefield
- The field used to sortorder
- ASC or DESC- Returns:
- a
List
ofSUser
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
updateGroup
public void updateGroup(SGroup group, EntityUpdateDescriptor descriptor, EntityUpdateDescriptor iconUpdater) throws SIdentityException
Description copied from interface:IdentityService
Update group according to the descriptor- Specified by:
updateGroup
in interfaceIdentityService
- Parameters:
group
- The group will be updateddescriptor
- The update description- Throws:
SIdentityException
-
updateCustomUserInfoDefinition
public void updateCustomUserInfoDefinition(SCustomUserInfoDefinition customUserInfo, EntityUpdateDescriptor descriptor) throws SIdentityException
Description copied from interface:IdentityService
Update customUserInfoDefinition according to the descriptor- Specified by:
updateCustomUserInfoDefinition
in interfaceIdentityService
- Parameters:
customUserInfo
- The customUserInfoDefinition will be updateddescriptor
- The update description- Throws:
SIdentityException
-
updateCustomUserInfoValue
public void updateCustomUserInfoValue(SCustomUserInfoValue customUserInfo, EntityUpdateDescriptor descriptor) throws SIdentityException
Description copied from interface:IdentityService
Update profileMetadataValue according to the descriptor- Specified by:
updateCustomUserInfoValue
in interfaceIdentityService
- Parameters:
customUserInfo
- The profileMetadataValue will be updateddescriptor
- The update description- Throws:
SIdentityException
-
updateRole
public SRole updateRole(SRole role, EntityUpdateDescriptor descriptor, EntityUpdateDescriptor iconUpdater) throws SIdentityException
Description copied from interface:IdentityService
Update role according to the descriptor- Specified by:
updateRole
in interfaceIdentityService
- Parameters:
role
- The role will be updateddescriptor
- The update description- Throws:
SIdentityException
-
updateUser
public void updateUser(SUser user, EntityUpdateDescriptor descriptor) throws SUserUpdateException
Description copied from interface:IdentityService
UpdateSUser
according to theEntityUpdateDescriptor
- Specified by:
updateUser
in interfaceIdentityService
- Parameters:
user
- TheSUser
to updatedescriptor
- TheSUser
contents to update- Throws:
SUserUpdateException
- occurs on persistence layer access problem
-
updateUser
@Deprecated public void updateUser(SUser user, EntityUpdateDescriptor descriptor, boolean isPasswordEncrypted) throws SUserUpdateException
Deprecated.Description copied from interface:IdentityService
UpdateSUser
according to theEntityUpdateDescriptor
- Specified by:
updateUser
in interfaceIdentityService
- Parameters:
user
- TheSUser
to updatedescriptor
- TheSUser
contents to updateisPasswordEncrypted
- allow to know if the password given in theEntityUpdateDescriptor
is encrypted or not- Throws:
SUserUpdateException
-
updateUserContactInfo
public void updateUserContactInfo(SContactInfo contactInfo, EntityUpdateDescriptor descriptor) throws SIdentityException
Description copied from interface:IdentityService
Update user contact information according to the descriptor- Specified by:
updateUserContactInfo
in interfaceIdentityService
- Parameters:
contactInfo
- The user contact information to be updateddescriptor
- The update description- Throws:
SUserUpdateException
SIdentityException
-
updateUserMembership
public void updateUserMembership(SUserMembership userMembership, EntityUpdateDescriptor descriptor) throws SIdentityException
Description copied from interface:IdentityService
Update userMembership according to the descriptor- Specified by:
updateUserMembership
in interfaceIdentityService
- Parameters:
userMembership
- The userMembership will be updateddescriptor
- The update description- Throws:
SIdentityException
-
getUserMemberships
public java.util.List<SUserMembership> getUserMemberships(int fromIndex, int numberOfUserMemberships) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUserMembership
from specific intervalIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
- Specified by:
getUserMemberships
in interfaceIdentityService
- Parameters:
fromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUserMemberships
- Number of result to retrieve- Returns:
- a
List
ofSUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUserMembershipsOfUser
public java.util.List<SUserMembership> getUserMembershipsOfUser(long userId, int fromIndex, int numberOfUsers) throws SIdentityException
Description copied from interface:IdentityService
GetSUserMembership
for a specific interval for a given user- Specified by:
getUserMembershipsOfUser
in interfaceIdentityService
- Parameters:
userId
- The user's identifierfromIndex
- Index of the record to be retrieved from. First record has index 0numberOfUsers
- Number of result to retrieve- Returns:
- a
List
ofSUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUserMembershipsOfUser
public java.util.List<SUserMembership> getUserMembershipsOfUser(long userId, int fromIndex, int numberOfMemberships, java.lang.String field, OrderByType order) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUserMembership
of a given user from specific interval, sorted by field attribute in the givenOrderByType
sortOrder order.For instance, getUserMembershipsOfUser(1,0,10,"id", OrderByType.DESC) returns the 10 first
SUserMembership
of the given user sorted by "id" in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
check
SUserMembershipBuilderFactory
to check available field keys to sort- Specified by:
getUserMembershipsOfUser
in interfaceIdentityService
- Parameters:
userId
- The identifier of userfromIndex
- Index of the record to be retrieved from. First record has index 0numberOfMemberships
- Number of result to retrievefield
- The field user to do orderorder
- ASC or DESC- Returns:
- a
List
ofSUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem- See Also:
SUserMembershipBuilderFactory
-
getUserMembershipsOfUser
public java.util.List<SUserMembership> getUserMembershipsOfUser(long userId, int fromIndex, int numberPerPage, OrderByOption orderByOption) throws SIdentityException
Description copied from interface:IdentityService
Get aList
ofSUserMembership
of a given user from specific interval, sorted by default field in the givenOrderByType
sortOrder order.For instance, getUserMembershipsOfUser(1,0,10, OrderByType.DESC) returns the 10 first
SUserMembership
of the given user sorted by the default field in desc orderIf the number of existing results are lower than the number asked, all results from the given index are retrieved.
- Specified by:
getUserMembershipsOfUser
in interfaceIdentityService
- Parameters:
userId
- The identifier of userfromIndex
- Index of the record to be retrieved from. First record has index 0numberPerPage
- Number of result o retrieveorderByOption
- OrderByOption object containing order information- Returns:
- a list of SUserMembership objects
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getUserMembership
public SUserMembership getUserMembership(long userId, long groupId, long roleId) throws SIdentityException
Description copied from interface:IdentityService
- Specified by:
getUserMembership
in interfaceIdentityService
- Parameters:
userId
- The user's identifiergroupId
- The group's identifierroleId
- The role's identifier- Returns:
- the
SUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem or if theSUserMembership
does not exists
-
getLightUserMembership
public SUserMembership getLightUserMembership(long userId, long groupId, long roleId) throws SIdentityException
Description copied from interface:IdentityService
Get theSUserMembership
of the specific user, group and role without userName, groupName and roleName being set.- Specified by:
getLightUserMembership
in interfaceIdentityService
- Parameters:
userId
- The user's identifiergroupId
- The group's identifierroleId
- The role's identifier- Returns:
- the lightened
SUserMembership
- Throws:
SIdentityException
- occurs on persistence layer access problem or if theSUserMembership
does not exists
-
getNumberOfUserMemberships
public long getNumberOfUserMemberships() throws SIdentityException
Description copied from interface:IdentityService
Get total number of userMemberships of the current tenant- Specified by:
getNumberOfUserMemberships
in interfaceIdentityService
- Returns:
- total number of userMemberships
- Throws:
SIdentityException
- occurs on persistence layer access problem
-
getLightUserMemberships
public java.util.List<SUserMembership> getLightUserMemberships(int startIndex, int numberOfElements) throws SIdentityException
Description copied from interface:IdentityService
Get light userMembership in a specific interval, this is used for pagination- Specified by:
getLightUserMemberships
in interfaceIdentityService
- Parameters:
startIndex
- Index of the record to be retrieved from. First record has index 0numberOfElements
- Number of result we want to get. Maximum number of result returned.- Returns:
- a list of SUserMembership objects without userName, groupName and roleName
- Throws:
SIdentityException
-
getNumberOfUsers
public long getNumberOfUsers(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
Get total number of users according to specific query options- Specified by:
getNumberOfUsers
in interfaceIdentityService
- Parameters:
options
- The QueryOptions object containing some query conditions- Returns:
- the satisfied user number
- Throws:
SBonitaReadException
-
searchUsers
public java.util.List<SUser> searchUsers(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
Search users according to specific query options- Specified by:
searchUsers
in interfaceIdentityService
- Parameters:
options
- The QueryOptions object containing some query conditions- Returns:
- a list of SUser objects
- Throws:
SBonitaReadException
-
getNumberOfRoles
public long getNumberOfRoles(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
Get total number of roles according to specific query options- Specified by:
getNumberOfRoles
in interfaceIdentityService
- Parameters:
options
- The QueryOptions object containing some query conditions- Returns:
- the satisfied role number
- Throws:
SBonitaReadException
-
searchRoles
public java.util.List<SRole> searchRoles(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
Search roles according to specific query options- Specified by:
searchRoles
in interfaceIdentityService
- Parameters:
options
- The QueryOptions object containing some query conditions- Returns:
- a list of SRole objects
- Throws:
SBonitaReadException
-
getNumberOfGroups
public long getNumberOfGroups(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
Get total number of groups according to specific query options- Specified by:
getNumberOfGroups
in interfaceIdentityService
- Parameters:
options
- The QueryOptions object containing some query conditions- Returns:
- the group number
- Throws:
SBonitaReadException
-
searchGroups
public java.util.List<SGroup> searchGroups(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
Search groups according to specific query options- Specified by:
searchGroups
in interfaceIdentityService
- Parameters:
options
- The QueryOptions object containing some query conditions- Returns:
- a list of SGroup objects
- Throws:
SBonitaReadException
-
checkCredentials
public boolean checkCredentials(SUser user, java.lang.String password)
Description copied from interface:IdentityService
Checks whether the couple user/password is valid.- Specified by:
checkCredentials
in interfaceIdentityService
- Parameters:
user
- the userpassword
- the password- Returns:
- true if the couple user/password is valid; false otherwise
-
searchCustomUserInfoValue
public java.util.List<SCustomUserInfoValue> searchCustomUserInfoValue(QueryOptions options) throws SBonitaReadException
Description copied from interface:IdentityService
SearchSCustomUserInfoValue
matching the criterias of the givenQueryOptions
- Specified by:
searchCustomUserInfoValue
in interfaceIdentityService
- Parameters:
options
- The QueryOptions object containing some query conditions- Returns:
- a list of SCustomUserInfoValue objects
- Throws:
SBonitaReadException
- occurs on persistence layer access problem or if search parameters are not correct
-
getCustomUserInfoValueOfUserAndDefinitions
public java.util.List<SCustomUserInfoValue> getCustomUserInfoValueOfUserAndDefinitions(long userId, java.util.List<java.lang.Long> definitionsIds) throws SBonitaReadException
Description copied from interface:IdentityService
Get SCustomUserInfoValues of definitions for a user- Specified by:
getCustomUserInfoValueOfUserAndDefinitions
in interfaceIdentityService
- Throws:
SBonitaReadException
-
updateUser
public SUser updateUser(long userId, EntityUpdateDescriptor userUpdateDescriptor, EntityUpdateDescriptor personalDataUpdateDescriptor, EntityUpdateDescriptor professionalDataUpdateDescriptor, EntityUpdateDescriptor iconUpdater) throws SIdentityException
Description copied from interface:IdentityService
Update the user having id userId according to the entity update descriptors in parameters- Specified by:
updateUser
in interfaceIdentityService
- Parameters:
userId
- the user to updateuserUpdateDescriptor
- the entity update descriptor of the user itselfpersonalDataUpdateDescriptor
- the entity update descriptor for the personal dataprofessionalDataUpdateDescriptor
- the entity update descriptor for the professional data- Returns:
- the updated user
- Throws:
SIdentityException
-
createUser
public SUser createUser(SUser sUser, SContactInfo personalContactInfo, SContactInfo proContactInfo, java.lang.String iconFilename, byte[] iconContent) throws SUserCreationException
Description copied from interface:IdentityService
create a new user in database along with its contact data- Specified by:
createUser
in interfaceIdentityService
- Parameters:
sUser
- the user to persistpersonalContactInfo
- its personal contact infoproContactInfo
- its professional contact infoiconFilename
- original name of the icon, used to determine the mime typeiconContent
- content of the icon- Returns:
- the user persisted
- Throws:
SUserCreationException
-
-