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
    • Method Detail

      • 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​(java.lang.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

        java.util.List<SRole> getRoles​(java.util.List<java.lang.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

        java.util.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

        java.util.List<SRole> getRoles​(int fromIndex,
                                       int numberOfRoles,
                                       java.lang.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
      • getGroups

        java.util.List<SGroup> getGroups​(java.util.List<java.lang.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

        java.util.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

        java.util.List<SGroup> getGroups​(int fromIndex,
                                         int numberOfGroups,
                                         java.lang.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

        java.util.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

        java.util.List<SGroup> getGroupChildren​(long parentGroupId,
                                                int fromIndex,
                                                int numberOfGroups,
                                                java.lang.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
      • checkCredentials

        boolean checkCredentials​(SUser user,
                                 java.lang.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
      • 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

        java.util.List<SUser> getUsers​(java.util.List<java.lang.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

        java.util.List<SUser> getUsersByUsername​(java.util.List<java.lang.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

        java.util.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

        java.util.List<SUser> getUsers​(int fromIndex,
                                       int numberOfUsers,
                                       java.lang.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

        java.util.List<SUser> getUsersWithManager​(long managerId,
                                                  int fromIndex,
                                                  int numberMaxOfUsers,
                                                  java.lang.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

        java.util.List<SUser> getActiveUsersWithManager​(long managerId,
                                                        int fromIndex,
                                                        int numberMaxOfUsers,
                                                        java.lang.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

        java.util.List<SUser> getInactiveUsersWithManager​(long managerId,
                                                          int fromIndex,
                                                          int numberMaxOfUsers,
                                                          java.lang.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

        java.util.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

        java.util.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

        java.util.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

        java.util.List<SUser> getUsersWithRole​(long roleId,
                                               int fromIndex,
                                               int numberOfUsers,
                                               java.lang.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

        java.util.List<SUser> getActiveUsersWithRole​(long roleId,
                                                     int fromIndex,
                                                     int numberOfUsers,
                                                     java.lang.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

        java.util.List<SUser> getInactiveUsersWithRole​(long roleId,
                                                       int fromIndex,
                                                       int numberOfUsers,
                                                       java.lang.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

        java.util.List<SUser> getActiveUsersInGroup​(long groupId,
                                                    int fromIndex,
                                                    int numberOfUsers,
                                                    java.lang.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

        java.util.List<SUser> getInactiveUsersInGroup​(long groupId,
                                                      int fromIndex,
                                                      int numberOfUsers,
                                                      java.lang.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

        java.util.List<SUser> getUsersInGroup​(long groupId,
                                              int fromIndex,
                                              int numberOfUsers,
                                              java.lang.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

        java.util.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

        java.util.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
      • 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

        java.util.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

        java.util.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
      • getCustomUserInfoDefinitions

        java.util.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

        java.util.List<java.lang.Long> getUserIdsWithCustomUserInfo​(java.lang.String userInfoName,
                                                                    java.lang.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
      • getUserMembershipsOfUser

        java.util.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

        java.util.List<SUserMembership> getUserMembershipsOfUser​(long userId,
                                                                 int fromIndex,
                                                                 int numberOfMemberships,
                                                                 java.lang.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

        java.util.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
      • createRole

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

        void createGroup​(SGroup group,
                         java.lang.String iconFileName,
                         byte[] iconContent)
                  throws SGroupCreationException
        Create group in DB for the given group object
        Parameters:
        group - A group object
        iconFileName -
        iconContent -
        Throws:
        SGroupCreationException
      • 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​(long customUserInfoValueId)
                                throws SIdentityException
        Delete the id specified profileMetadataValue
        Parameters:
        customUserInfoValueId - The identifier of profileMetadataValue
        Throws:
        SIdentityException
      • 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

        java.util.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

        java.util.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

        java.util.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

        java.util.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
      • 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
      • 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,
                         java.lang.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