Interface IdentityService

All Known Implementing Classes:
IdentityServiceImpl

public interface IdentityService
This service allow to manage the users and organizations and membership and the relations between them.
Since:
6.0
Author:
Anthony Birembaut, Baptiste Mesta, Matthieu Chaffotte
  • Field Details

  • Method Details

    • getRole

      SRole getRole(long roleId) throws SRoleNotFoundException
      Gets the SRole given by its identifier.
      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

      SRole getRoleByName(String roleName) throws SRoleNotFoundException
      Get the SRole given by its name.
      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.
    • getNumberOfRoles

      long getNumberOfRoles() throws SIdentityException
      Get total number of SRole for this tenant
      Returns:
      the total number of roles for this tenant
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getRoles

      List<SRole> getRoles(List<Long> roleIds) throws SRoleNotFoundException
      Get a List of SRole by their identifiers
      Parameters:
      roleIds - the role identifiers
      Returns:
      a list of SRole objects
      Throws:
      SRoleNotFoundException - Occurs when roleId does not refer to any role.
    • getRoles

      List<SRole> getRoles(int fromIndex, int numberOfRoles) throws SIdentityException
      Get a List of SRole in specific interval If the number of existing results are lower than the number asked, all results from the given index are retrieved.
      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfRoles - Number of result to retrieve
      Returns:
      a list of SRole objects
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getRoles

      List<SRole> getRoles(int fromIndex, int numberOfRoles, String field, OrderByType order) throws SIdentityException
      Get a List of SRole in specific interval, sorted by field attribute in the given OrderByType 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

      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfRoles - Number of result to retrieve
      field - The field used by the sort
      order - 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
    • getGroupByPath

      SGroup getGroupByPath(String groupPath) throws SGroupNotFoundException
      Get the SGroup by its path
      Parameters:
      groupPath - The group path
      Returns:
      the group
      Throws:
      SGroupNotFoundException - Occurs when the groupPath does not refer to any group.
    • getGroup

      SGroup getGroup(long groupId) throws SGroupNotFoundException
      Get SGroup by its identifier
      Parameters:
      groupId - The group identifier
      Returns:
      the group
      Throws:
      SGroupNotFoundException - occurs when the groupId does not refer to any group.
    • getNumberOfGroups

      long getNumberOfGroups() throws SIdentityException
      Get total number of SGroup in the current tenant
      Returns:
      the total number of SGroup
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getGroups

      List<SGroup> getGroups(List<Long> groupIds) throws SGroupNotFoundException
      Get a List of SGroup for specific groupIds
      Parameters:
      groupIds - The group identifiers
      Returns:
      a List of SGroup object
      Throws:
      SGroupNotFoundException - occurs when no given group identifiers refer to any group.
    • getGroups

      List<SGroup> getGroups(int fromIndex, int numberOfGroups) throws SIdentityException
      Get a List of SGroup 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.
      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfGroups - Number of result to retrieve
      Returns:
      a List of SGroup
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getGroups

      List<SGroup> getGroups(int fromIndex, int numberOfGroups, String field, OrderByType order) throws SIdentityException
      Get a List of SGroup in specific interval, sorted by field attribute in the given OrderByType order.

      For instance, getGroups(0,10,"displayName", OrderByType.DESC) returns the 10 first SGroup 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 SGroupBuilderFactory to get a list of available field keys to sort

      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfGroups - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of paginated SGroup objects
      Throws:
      SIdentityException - occurs on persistence layer access problem
      See Also:
      • SGroupBuilderFactory
    • getNumberOfGroupChildren

      long getNumberOfGroupChildren(long parentGroupId) throws SIdentityException
      Get number of child groups for the group identified by the given id
      Parameters:
      parentGroupId - The parent group identifier
      Returns:
      the number of child groups
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getGroupChildren

      List<SGroup> getGroupChildren(long parentGroupId, int fromIndex, int numberOfGroups) throws SIdentityException
      Get a List child SGroup 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.
      Parameters:
      parentGroupId - The parent group identifier
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfGroups - Number of result to retrieve
      Returns:
      a List of child SGroup
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getGroupChildren

      List<SGroup> getGroupChildren(long parentGroupId, int fromIndex, int numberOfGroups, String field, OrderByType order) throws SIdentityException
      Get a List of child SGroup in specific interval, sorted by field attribute in the given OrderByType order.

      For instance, getGroupChildren(0,10,"displayName", OrderByType.DESC) returns the 10 first child SGroup of the parent SGroup identified by parentGroupId 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 SGroupBuilderFactory to get a list of available field keys to sort

      Parameters:
      parentGroupId - The parent group identifier
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfGroups - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of child SGroup
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUser

      SUser getUser(long userId) throws SUserNotFoundException
      Get SUser by its id
      Parameters:
      userId - The user identifier
      Returns:
      the user
      Throws:
      SUserNotFoundException - occurs when the userId does not refer to any user.
    • checkCredentials

      boolean checkCredentials(SUser user, String password)
      Checks whether the couple user/password is valid.
      Parameters:
      user - the user
      password - the password
      Returns:
      true if the couple user/password is valid; false otherwise
    • getUserByUserName

      SUser getUserByUserName(String username) throws SUserNotFoundException
      Get SUser by its name
      Parameters:
      username - The user name
      Returns:
      the user
      Throws:
      SUserNotFoundException - occurs when the user name does not refer to any user.
    • getNumberOfUsers

      long getNumberOfUsers() throws SIdentityException
      Get total number of SUser on the current tenant
      Returns:
      the total number of users
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUsers

      List<SUser> getUsers(List<Long> userIds) throws SUserNotFoundException
      Get SUser by their userIds
      Parameters:
      userIds - A List of user identifiers
      Returns:
      a List of SUser
      Throws:
      SUserNotFoundException - occurs when none of the given userIds refer to any user.
    • getUsersByUsername

      List<SUser> getUsersByUsername(List<String> userNames) throws SIdentityException
      retrieve a List of SUser from their names.
      Parameters:
      userNames - the list of user names
      Returns:
      a List of SUser
      Throws:
      SIdentityException - If an exception occurs when retrieving the users
    • getUsers

      List<SUser> getUsers(int fromIndex, int numberOfUsers) throws SIdentityException
      Get a List of SUser from a specific interval. If the number of existing results are lower than the number asked, all results from the given index are retrieved.
      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUsers

      List<SUser> getUsers(int fromIndex, int numberOfUsers, String field, OrderByType order) throws SIdentityException
      Get a List of child SUser from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getUsers(0,10,"displayName", OrderByType.DESC) returns the 10 first SUser 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 SUser to get a list of available field keys to sort

      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result we want to get. Maximum number of result returned.
      field - The field used by the order
      order - ASC or DESC
      Returns:
      a List of paginated SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUsersWithManager

      List<SUser> getUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, String field, OrderByType order) throws SIdentityException
      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.
      Parameters:
      managerId - The manager identifier, actually it is user identifier
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberMaxOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getActiveUsersWithManager

      List<SUser> getActiveUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, String field, OrderByType order) throws SIdentityException
      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.
      Parameters:
      managerId - The manager identifier, actually it is user identifier
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberMaxOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getInactiveUsersWithManager

      List<SUser> getInactiveUsersWithManager(long managerId, int fromIndex, int numberMaxOfUsers, String field, OrderByType order) throws SIdentityException
      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.
      Parameters:
      managerId - The manager identifier, actually it is user identifier
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberMaxOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getNumberOfUsersByRole

      long getNumberOfUsersByRole(long roleId) throws SIdentityException
      Get total number of users for the given role on the current tenant
      Parameters:
      roleId - The identifier of role
      Returns:
      total number of users related to the given role
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUsersWithRole

      List<SUser> getUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException
      Get a List of SUser from a specific interval for the given SRole 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.
      Parameters:
      roleId - The identifier of the SRole of the SUser to retrieve
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getActiveUsersWithRole

      List<SUser> getActiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException
      Get a List of active SUser from a specific interval for the given SRole identifier. If the number of existing results are lower than the number asked, all results from the given index are retrieved.
      Parameters:
      roleId - The identifier of the SRole of the SUser to retrieve
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getInactiveUsersWithRole

      List<SUser> getInactiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers) throws SIdentityException
      Get a List of inactive SUser from a specific interval for the given SRole identifier. If the number of existing results are lower than the number asked, all results from the given index are retrieved.
      Parameters:
      roleId - The identifier of the SRole of the SUser to retrieve
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUsersWithRole

      List<SUser> getUsersWithRole(long roleId, int fromIndex, int numberOfUsers, String field, OrderByType order) throws SIdentityException
      Get a List of SUser for given SRole from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getUsersWithRole(1,0,10,"displayName", OrderByType.DESC) returns the 10 first SUser of the SRole with id '1' 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 SUser to get a list of available field keys to sort

      Parameters:
      roleId - The identifier of the SRole
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getActiveUsersWithRole

      List<SUser> getActiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers, String field, OrderByType order) throws SIdentityException
      Get a List of active SUser for given SRole from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getActiveUsersWithRole(1,0,10,"displayName", OrderByType.DESC) returns the 10 first SUser of the SRole with id '1' 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 SUser to get a list of available field keys to sort

      Parameters:
      roleId - The identifier of the SRole
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getInactiveUsersWithRole

      List<SUser> getInactiveUsersWithRole(long roleId, int fromIndex, int numberOfUsers, String field, OrderByType order) throws SIdentityException
      Get a List of Inactive SUser for given SRole from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getInactiveUsersWithRole(1,0,10,"displayName", OrderByType.DESC) returns the 10 first SUser of the SRole with id '1' 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 SUser to get a list of available field keys to sort

      Parameters:
      roleId - The identifier of the SRole
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getNumberOfUsersByGroup

      long getNumberOfUsersByGroup(long groupId) throws SIdentityException
      Get total number of users for the given SGroup
      Parameters:
      groupId - The identifier of the SGroup
      Returns:
      total number of users in the given group
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getActiveUsersInGroup

      List<SUser> getActiveUsersInGroup(long groupId, int fromIndex, int numberOfUsers, String field, OrderByType order) throws SIdentityException
      Get a List of Active SUser for given SGroup from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getActiveUsersInGroup(1,0,10,"displayName", OrderByType.DESC) returns the 10 first SUser of the SGroup with id '1' 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 SUser to get a list of available field keys to sort

      Parameters:
      groupId - Identifier of the SGroup
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getInactiveUsersInGroup

      List<SUser> getInactiveUsersInGroup(long groupId, int fromIndex, int numberOfUsers, String field, OrderByType order) throws SIdentityException
      Get a List of Inactive SUser for given SGroup from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getInactiveUsersInGroup(1,0,10,"displayName", OrderByType.DESC) returns the 10 first SUser of the SGroup with id '1' 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 SUser to get a list of available field keys to sort

      Parameters:
      groupId - Identifier of the SGroup
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUsersInGroup

      List<SUser> getUsersInGroup(long groupId, int fromIndex, int numberOfUsers, String field, OrderByType order) throws SIdentityException
      Get a List of SUser for given SGroup from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getUsersInGroup(1,0,10,"displayName", OrderByType.DESC) returns the 10 first SUser of the SGroup with id '1' 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 SUser to get a list of available field keys to sort

      Parameters:
      groupId - Identifier of the SGroup
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUsers - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUser
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUserMembershipsOfGroup

      List<SUserMembership> getUserMembershipsOfGroup(long groupId, int fromIndex, int numberOfResults) throws SIdentityException
      Get a List of SUserMembership for given group from specific interval

      If the number of existing results are lower than the number asked, all results from the given index are retrieved.

      Parameters:
      groupId - Identifier of the group
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfResults - Number of result to retrieve
      Returns:
      a List of SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUserMembershipsOfRole

      List<SUserMembership> getUserMembershipsOfRole(long roleId, int fromIndex, int numberOfResults) throws SIdentityException
      Get a List of SUserMembership for given role from specific interval

      If the number of existing results are lower than the number asked, all results from the given index are retrieved.

      Parameters:
      roleId - Identifier of the role
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfResults - Number of result to retrieve
      Returns:
      a List of SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUserMembership

      SUserMembership getUserMembership(long userMembershipId) throws SIdentityException
      Get SUserMembership by given id
      Parameters:
      userMembershipId - The identifier of userMembership
      Returns:
      the SUserMembership of the given id
      Throws:
      SIdentityException - occurs on persistence layer access problem or if the SUserMembership does not exists
    • getUserMembership

      SUserMembership getUserMembership(long userId, long groupId, long roleId) throws SIdentityException
      Get SUserMembership of specific SUser, SGroup and SRole
      Parameters:
      userId - The user's identifier
      groupId - The group's identifier
      roleId - The role's identifier
      Returns:
      the SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem or if the SUserMembership does not exists
    • getLightUserMembership

      SUserMembership getLightUserMembership(long userId, long groupId, long roleId) throws SIdentityException
      Get the SUserMembership of the specific user, group and role without userName, groupName and roleName being set.
      Parameters:
      userId - The user's identifier
      groupId - The group's identifier
      roleId - The role's identifier
      Returns:
      the lightened SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem or if the SUserMembership does not exists
    • getUserMemberships

      List<SUserMembership> getUserMemberships(List<Long> userMembershipIds) throws SIdentityException
      Get a List of SUserMembership of the given identifiers if they exists
      Parameters:
      userMembershipIds - The SUserMembership's identifiers
      Returns:
      a List of SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem or if none identifiers match an existing SUserMembership
    • getUserMemberships

      List<SUserMembership> getUserMemberships(int fromIndex, int numberOfResults) throws SIdentityException
      Get a List of SUserMembership from specific interval

      If the number of existing results are lower than the number asked, all results from the given index are retrieved.

      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfResults - Number of result to retrieve
      Returns:
      a List of SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUserMemberships

      List<SUserMembership> getUserMemberships(int fromIndex, int numberOfUserMemberships, OrderByOption orderByOption) throws SIdentityException
      Get a List of SUserMembership from specific interval, sorted by field attribute in the given OrderByType order order.

      For instance, getUserMemberships(0,10,"id", OrderByType.DESC) returns the 10 first SUserMembership 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 SUserMembershipBuilderFactory to check available field keys to sort

      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfUserMemberships - Number of result to retrieve
      field - The field used to sort
      order - ASC or DESC
      Returns:
      a List of SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem
      See Also:
      • SUserMembershipBuilderFactory
    • getCustomUserInfoDefinition

      SCustomUserInfoDefinition getCustomUserInfoDefinition(long customUserInfoDefinitionId) throws SIdentityException
      Parameters:
      customUserInfoDefinitionId - The SCustomUserInfoDefinition's identifier
      Returns:
      the customUserInfoDefinition
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getCustomUserInfoValue

      SCustomUserInfoValue getCustomUserInfoValue(long customUserInfoValueId) throws SCustomUserInfoValueNotFoundException, SCustomUserInfoValueReadException
      Get SCustomUserInfoValue by its id
      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 id
      SCustomUserInfoValueReadException - if an exception occurs while trying to get the custom user info value
    • getCustomUserInfoDefinitionByName

      Get a SCustomUserInfoDefinition by its name
      Parameters:
      name - The name of the SCustomUserInfoDefinition to retrieve
      Returns:
      the SCustomUserInfoDefinition identified by the given name
      Throws:
      SCustomUserInfoDefinitionNotFoundException - if there is no custom user info definition for the given name
      SCustomUserInfoDefinitionReadException - if an exception occurs when trying to retrieve the custom user info definition
    • hasCustomUserInfoDefinition

      boolean hasCustomUserInfoDefinition(String name) throws SCustomUserInfoDefinitionReadException
      Verify if there is a SCustomUserInfoDefinition of the given name
      Parameters:
      name - The SCustomUserInfoDefinition's name to check
      Returns:
      the SCustomUserInfoDefinition of the given name
      Throws:
      SCustomUserInfoDefinitionNotFoundException - if there is no custom user info definition for the given name
      SCustomUserInfoDefinitionReadException - if an exception occurs when trying to retrieve the custom user info definition
    • getNumberOfCustomUserInfoDefinition

      long getNumberOfCustomUserInfoDefinition() throws SIdentityException
      Get total number of SCustomUserInfoDefinition of the current tenant
      Returns:
      the total number of SCustomUserInfoDefinition of the current tenant
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getNumberOfCustomUserInfoValue

      long getNumberOfCustomUserInfoValue(QueryOptions options) throws SBonitaReadException
      Get total number of SCustomUserInfoValue of the current tenant matching the criterias of the given QueryOptions
      Parameters:
      options - The QueryOptions containing filtering conditions
      Returns:
      the total number of custom user info value
      Throws:
      SIdentityException - occurs on persistence layer access problem
      SBonitaReadException
    • getCustomUserInfoDefinitions

      List<SCustomUserInfoDefinition> getCustomUserInfoDefinitions(List<Long> customUserInfoDefinitionIds) throws SIdentityException
      Get a List of SCustomUserInfoDefinition of the given identifiers
      Parameters:
      customUserInfoDefinitionIds - A List of SCustomUserInfoDefinition identifiers
      Returns:
      a List of SCustomUserInfoDefinition
      Throws:
      SIdentityException - occurs on persistence layer access problem or if none identifiers match an existing SCustomUserInfoDefinition
    • getCustomUserInfoValues

      List<SCustomUserInfoValue> getCustomUserInfoValues(List<Long> customUserInfoValueIds) throws SIdentityException
      Get a List of SCustomUserInfoValue of the given identifiers
      Parameters:
      customUserInfoValueIds - A List of SCustomUserInfoValue identifiers
      Returns:
      A List of SCustomUserInfoValue
      Throws:
      SIdentityException - occurs on persistence layer access problem or if none identifiers match an existing SCustomUserInfoDefinition
    • getCustomUserInfoDefinitions

      List<SCustomUserInfoDefinition> getCustomUserInfoDefinitions(int fromIndex, int maxResults) throws SIdentityException
      Get a List of SCustomUserInfoDefinition from specific interval

      If the number of existing results are lower than the number asked, all results from the given index are retrieved.

      Parameters:
      fromIndex - Index of the record to be retrieved from. First record has index 0
      maxResults - Number of result to retrieve
      Returns:
      a List of SCustomUserInfoDefinition
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUserIdsWithCustomUserInfo

      List<Long> getUserIdsWithCustomUserInfo(String userInfoName, String userInfoValue, boolean usePartialMatch, int fromIndex, int maxResults) throws SIdentityException
      Retrieve a List 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.

      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
      Since:
      6.3.2
    • searchCustomUserInfoValue

      List<SCustomUserInfoValue> searchCustomUserInfoValue(QueryOptions options) throws SBonitaReadException
      Search SCustomUserInfoValue matching the criterias of the given QueryOptions
      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

      List<SCustomUserInfoValue> getCustomUserInfoValueOfUserAndDefinitions(long userId, List<Long> definitionsIds) throws SBonitaReadException
      Get SCustomUserInfoValues of definitions for a user
      Throws:
      SBonitaReadException
    • getUserMembershipsOfUser

      List<SUserMembership> getUserMembershipsOfUser(long userId, int fromIndex, int numberOfMemberships) throws SIdentityException
      Get SUserMembership for a specific interval for a given user
      Parameters:
      userId - The user's identifier
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfMemberships - Number of result to retrieve
      Returns:
      a List of SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getUserMembershipsOfUser

      List<SUserMembership> getUserMembershipsOfUser(long userId, int fromIndex, int numberOfMemberships, String field, OrderByType sortOrder) throws SIdentityException
      Get a List of SUserMembership of a given user from specific interval, sorted by field attribute in the given OrderByType 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 order

      If 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

      Parameters:
      userId - The identifier of user
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberOfMemberships - Number of result to retrieve
      field - The field user to do order
      sortOrder - ASC or DESC
      Returns:
      a List of SUserMembership
      Throws:
      SIdentityException - occurs on persistence layer access problem
      See Also:
      • SUserMembershipBuilderFactory
    • getUserMembershipsOfUser

      List<SUserMembership> getUserMembershipsOfUser(long userId, int fromIndex, int numberPerPage, OrderByOption sortOrder) throws SIdentityException
      Get a List of SUserMembership of a given user from specific interval, sorted by default field in the given OrderByType 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 order

      If the number of existing results are lower than the number asked, all results from the given index are retrieved.

      Parameters:
      userId - The identifier of user
      fromIndex - Index of the record to be retrieved from. First record has index 0
      numberPerPage - Number of result o retrieve
      sortOrder - OrderByOption object containing order information
      Returns:
      a list of SUserMembership objects
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getNumberOfUserMembershipsOfUser

      long getNumberOfUserMembershipsOfUser(long userId) throws SIdentityException
      Get total number of SUserMembership for a specific user
      Parameters:
      userId - The user's identifier
      Returns:
      total number of userMemberships for the specific user
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • getNumberOfUserMemberships

      long getNumberOfUserMemberships() throws SIdentityException
      Get total number of userMemberships of the current tenant
      Returns:
      total number of userMemberships
      Throws:
      SIdentityException - occurs on persistence layer access problem
    • createUser

      SUser createUser(SUser user) throws SUserCreationException
      Create SUser and store it to persistence layer
      Parameters:
      user - The user to create and store
      Returns:
      the created user with its identifier set
      Throws:
      SUserCreationException - occurs on persistence layer access problem
    • updateUser

      void updateUser(SUser user, EntityUpdateDescriptor descriptor) throws SUserUpdateException
      Update SUser according to the EntityUpdateDescriptor
      Parameters:
      user - The SUser to update
      descriptor - The SUser contents to update
      Throws:
      SUserUpdateException - occurs on persistence layer access problem
    • updateUser

      @Deprecated void updateUser(SUser user, EntityUpdateDescriptor descriptor, boolean isPasswordEncrypted) throws SUserUpdateException
      Deprecated.
      Update SUser according to the EntityUpdateDescriptor
      Parameters:
      user - The SUser to update
      descriptor - The SUser contents to update
      isPasswordEncrypted - allow to know if the password given in the EntityUpdateDescriptor is encrypted or not
      Throws:
      SUserUpdateException
    • createCustomUserInfoDefinition

      Create custom user info definition in DB for a server given custom user info definition
      Parameters:
      customUserInfo - SCustomUserInfoDefinition object
      Throws:
      SCustomUserInfoDefinitionAlreadyExistsException - TODO
      SCustomUserInfoDefinitionCreationException - TODO
    • updateCustomUserInfoDefinition

      void updateCustomUserInfoDefinition(SCustomUserInfoDefinition customUserInfo, EntityUpdateDescriptor descriptor) throws SIdentityException
      Update customUserInfoDefinition according to the descriptor
      Parameters:
      customUserInfo - The customUserInfoDefinition will be updated
      descriptor - The update description
      Throws:
      SIdentityException
    • createCustomUserInfoValue

      SCustomUserInfoValue createCustomUserInfoValue(SCustomUserInfoValue customUserInfo) throws SIdentityException
      Create profileMetadataValue in DB for give profileMetadataValue object
      Parameters:
      customUserInfo - A profileMetadataValue object
      Throws:
      SIdentityException
    • updateCustomUserInfoValue

      void updateCustomUserInfoValue(SCustomUserInfoValue customUserInfo, EntityUpdateDescriptor descriptor) throws SIdentityException
      Update profileMetadataValue according to the descriptor
      Parameters:
      customUserInfo - The profileMetadataValue will be updated
      descriptor - The update description
      Throws:
      SIdentityException
    • createRole

      void createRole(SRole role, String iconFilename, byte[] iconContent) throws SIdentityException
      Create role in DB for the given role
      Parameters:
      role - A role object
      iconFilename -
      iconContent -
      Throws:
      SIdentityException
    • updateRole

      SRole updateRole(SRole role, EntityUpdateDescriptor descriptor, EntityUpdateDescriptor iconUpdater) throws SIdentityException
      Update role according to the descriptor
      Parameters:
      role - The role will be updated
      descriptor - The update description
      iconUpdater -
      Throws:
      SIdentityException
    • createGroup

      void createGroup(SGroup group, String iconFileName, byte[] iconContent) throws SGroupCreationException
      Create group in DB for the given group object
      Parameters:
      group - A group object
      iconFileName -
      iconContent -
      Throws:
      SGroupCreationException
    • updateGroup

      void updateGroup(SGroup group, EntityUpdateDescriptor descriptor, EntityUpdateDescriptor iconUpdater) throws SIdentityException
      Update group according to the descriptor
      Parameters:
      group - The group will be updated
      descriptor - The update description
      iconUpdater -
      Throws:
      SIdentityException
    • createUserMembership

      void createUserMembership(SUserMembership userMembership) throws SUserMembershipCreationException
      Create userMembership in DB for the given userMembership object
      Parameters:
      userMembership - A userMembership object
      Throws:
      SUserMembershipCreationException
    • updateUserMembership

      void updateUserMembership(SUserMembership userMembership, EntityUpdateDescriptor descriptor) throws SIdentityException
      Update userMembership according to the descriptor
      Parameters:
      userMembership - The userMembership will be updated
      descriptor - The update description
      Throws:
      SIdentityException
    • deleteUser

      void deleteUser(SUser user) throws SUserDeletionException
      Delete the specific user
      Parameters:
      user - The user will be deleted
      Throws:
      SUserDeletionException
    • deleteUser

      void deleteUser(long userId) throws SUserDeletionException
      Delete user by its id
      Parameters:
      userId - The identifier of user
      Throws:
      SUserDeletionException
    • deleteAllUsers

      void deleteAllUsers() throws SUserDeletionException
      Delete all users for the connected tenant
      Throws:
      SUserDeletionException
      Since:
      6.1
    • deleteCustomUserInfoDefinition

      void deleteCustomUserInfoDefinition(SCustomUserInfoDefinition metadataDefinition) throws SIdentityException
      Delete the specific custom user info
      Parameters:
      metadataDefinition - The custom user info object will be deleted
      Throws:
      SIdentityException
    • deleteCustomUserInfoDefinition

      void deleteCustomUserInfoDefinition(long customUserInfoDefinitionId) throws SIdentityException
      Delete the id specified custom user info
      Parameters:
      customUserInfoDefinitionId - The identifier of custom user info
      Throws:
      SIdentityException
    • deleteCustomUserInfoValue

      void deleteCustomUserInfoValue(SCustomUserInfoValue customUserInfo) throws SIdentityException
      Delete the specific profileMetadataValue
      Parameters:
      customUserInfo - The profileMetadataValue object will be deleted
      Throws:
      SIdentityException
    • deleteCustomUserInfoValue

      void deleteCustomUserInfoValue(long customUserInfoValueId) throws SIdentityException
      Delete the id specified profileMetadataValue
      Parameters:
      customUserInfoValueId - The identifier of profileMetadataValue
      Throws:
      SIdentityException
    • deleteRole

      void deleteRole(SRole role) throws SRoleDeletionException
      Delete the specific role
      Parameters:
      role - The role will be deleted
      Throws:
      SRoleDeletionException
    • deleteRole

      void deleteRole(long roleId) throws SRoleNotFoundException, SRoleDeletionException
      Delete the id specified role
      Parameters:
      roleId - The role identifier
      Throws:
      SRoleNotFoundException - Error occurs when no role found with the specific roleId
      SRoleDeletionException
    • deleteAllRoles

      void deleteAllRoles() throws SRoleDeletionException
      Delete all roles for the connected tenant
      Throws:
      SRoleDeletionException
      Since:
      6.1
    • deleteGroup

      void deleteGroup(SGroup group) throws SGroupDeletionException
      Delete the specific group
      Parameters:
      group - The group will be deleted
      Throws:
      SGroupDeletionException
    • deleteGroup

      void deleteGroup(long groupId) throws SGroupNotFoundException, SGroupDeletionException
      Delete the id specified group
      Parameters:
      groupId - The identifier of group
      Throws:
      SGroupNotFoundException - Error occurs when no group found with the specific groupId
      SGroupDeletionException
    • deleteAllGroups

      void deleteAllGroups() throws SGroupDeletionException
      Delete all groups for the connected tenant
      Throws:
      SGroupDeletionException
      Since:
      6.1
    • deleteUserMembership

      void deleteUserMembership(SUserMembership userMembership) throws SMembershipDeletionException
      Delete the specific userMembership
      Parameters:
      userMembership - The userMembership will be deleted
      Throws:
      SMembershipDeletionException
    • deleteLightUserMembership

      void deleteLightUserMembership(SUserMembership userMembership) throws SMembershipDeletionException
      Delete the specific light userMembership
      Parameters:
      userMembership -
      Throws:
      SMembershipDeletionException
      Since:
      6.1
    • deleteUserMembership

      void deleteUserMembership(long userMembershipId) throws SMembershipDeletionException
      Delete the id specified userMembership
      Parameters:
      userMembershipId - The identifier of userMembership
      Throws:
      SMembershipDeletionException
    • deleteAllUserMemberships

      void deleteAllUserMemberships() throws SMembershipDeletionException
      Delete all user memberships for the connected tenant
      Throws:
      SMembershipDeletionException
      Since:
      6.1
    • getNumberOfUsers

      long getNumberOfUsers(QueryOptions options) throws SBonitaReadException
      Get total number of users according to specific query options
      Parameters:
      options - The QueryOptions object containing some query conditions
      Returns:
      the satisfied user number
      Throws:
      SBonitaReadException
    • searchUsers

      List<SUser> searchUsers(QueryOptions options) throws SBonitaReadException
      Search users according to specific query options
      Parameters:
      options - The QueryOptions object containing some query conditions
      Returns:
      a list of SUser objects
      Throws:
      SBonitaReadException
    • getNumberOfRoles

      long getNumberOfRoles(QueryOptions options) throws SBonitaReadException
      Get total number of roles according to specific query options
      Parameters:
      options - The QueryOptions object containing some query conditions
      Returns:
      the satisfied role number
      Throws:
      SBonitaReadException
    • searchRoles

      List<SRole> searchRoles(QueryOptions options) throws SBonitaReadException
      Search roles according to specific query options
      Parameters:
      options - The QueryOptions object containing some query conditions
      Returns:
      a list of SRole objects
      Throws:
      SBonitaReadException
    • getNumberOfGroups

      long getNumberOfGroups(QueryOptions options) throws SBonitaReadException
      Get total number of groups according to specific query options
      Parameters:
      options - The QueryOptions object containing some query conditions
      Returns:
      the group number
      Throws:
      SBonitaReadException
    • searchGroups

      List<SGroup> searchGroups(QueryOptions options) throws SBonitaReadException
      Search groups according to specific query options
      Parameters:
      options - The QueryOptions object containing some query conditions
      Returns:
      a list of SGroup objects
      Throws:
      SBonitaReadException
    • getNumberOfUsersByMembership

      long getNumberOfUsersByMembership(long groupId, long roleId) throws SIdentityException
      Get total number of userMemberships contains specific group and role
      Parameters:
      groupId - The identifier of group
      roleId - The identifier of role
      Returns:
      the number of userMemberships
      Throws:
      SIdentityException
    • getLightUserMembership

      SUserMembership getLightUserMembership(long userMembershipId) throws SIdentityException
      Get light userMembership by its id
      Parameters:
      userMembershipId - The identifier of userMembership
      Returns:
      a SUserMembership object without userName, groupName and roleName
      Throws:
      SIdentityException
    • getLightUserMemberships

      List<SUserMembership> getLightUserMemberships(int startIndex, int numberOfElements) throws SIdentityException
      Get light userMembership in a specific interval, this is used for pagination
      Parameters:
      startIndex - Index of the record to be retrieved from. First record has index 0
      numberOfElements - 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
    • deleteChildrenGroup

      List<Long> deleteChildrenGroup(long groupId) throws SGroupDeletionException, SGroupNotFoundException
      delete children groups of the given group if there is some
      Parameters:
      groupId - The index of the group to delete
      Throws:
      SGroupDeletionException
      SGroupNotFoundException
    • getUserContactInfo

      SContactInfo getUserContactInfo(long userId, boolean isPersonal) throws SIdentityException
      Return the user contact info for a specific user.
      Parameters:
      userId - the ID of the user to retrieve the contact info from
      isPersonal - Do we want personal contact information (or professional) ?
      Returns:
      the corresponding SContactInfo, if found
      Throws:
      SIdentityException - if a Read problem occurred
    • createUserContactInfo

      SContactInfo createUserContactInfo(SContactInfo contactInfo) throws SUserCreationException
      Create user contact information for given data
      Parameters:
      contactInfo - The user contact information object
      Returns:
      The contact info created
      Throws:
      SUserCreationException
    • updateUserContactInfo

      void updateUserContactInfo(SContactInfo contactInfo, EntityUpdateDescriptor descriptor) throws SIdentityException
      Update user contact information according to the descriptor
      Parameters:
      contactInfo - The user contact information to be updated
      descriptor - The update description
      Throws:
      SUserUpdateException
      SIdentityException
    • createUserWithoutEncryptingPassword

      @Deprecated SUser createUserWithoutEncryptingPassword(SUser user) throws SUserCreationException
      Deprecated.
      Create user in DB for given user and
      Parameters:
      user - The user object
      Throws:
      SUserCreationException
    • updateUser

      SUser updateUser(long userId, EntityUpdateDescriptor userUpdateDescriptor, EntityUpdateDescriptor personalDataUpdateDescriptor, EntityUpdateDescriptor professionalDataUpdateDescriptor, EntityUpdateDescriptor iconUpdater) throws SIdentityException
      Update the user having id userId according to the entity update descriptors in parameters
      Parameters:
      userId - the user to update
      userUpdateDescriptor - the entity update descriptor of the user itself
      personalDataUpdateDescriptor - the entity update descriptor for the personal data
      professionalDataUpdateDescriptor - the entity update descriptor for the professional data
      Returns:
      the updated user
      Throws:
      SIdentityException
    • createUser

      SUser createUser(SUser sUser, SContactInfo personalContactInfo, SContactInfo proContactInfo, String iconFilename, byte[] iconContent) throws SUserCreationException
      create a new user in database along with its contact data
      Parameters:
      sUser - the user to persist
      personalContactInfo - its personal contact info
      proContactInfo - its professional contact info
      iconFilename - original name of the icon, used to determine the mime type
      iconContent - content of the icon
      Returns:
      the user persisted
      Throws:
      SUserCreationException