Interface IdentityStorage


  • public interface IdentityStorage
    Version:
    $Revision$
    Author:
    Alain Defrance
    • Field Detail

      • DEFAULT_SORTING

        static final Sorting DEFAULT_SORTING
      • DEFAULT_UPLOAD_IMAGE_LIMIT

        static final int DEFAULT_UPLOAD_IMAGE_LIMIT
        Default avatar and banner upload limits.
        See Also:
        Constant Field Values
    • Method Detail

      • updateIdentityMembership

        void updateIdentityMembership​(String remoteId)
                               throws IdentityStorageException
        Updates existing identity's membership in OrganizationService.
        Parameters:
        remoteId - the remoteId to be updated membership.
        Throws:
        IdentityStorageException
        Since:
        4.0.0
      • getIdentitiesByProfileFilter

        List<Identity> getIdentitiesByProfileFilter​(String providerId,
                                                    ProfileFilter profileFilter,
                                                    long offset,
                                                    long limit,
                                                    boolean forceLoadOrReloadProfile)
                                             throws IdentityStorageException
        Gets the identities by profile filter.
        Parameters:
        providerId - Id of provider.
        profileFilter - Information of profile that used in filtering.
        offset - Start index of list to be get.
        limit - End index of list to be get.
        forceLoadOrReloadProfile - Load profile or not.
        Returns:
        the identities by profile filter.
        Throws:
        IdentityStorageException
        Since:
        1.2.0-GA
      • getIdentitiesForMentions

        List<Identity> getIdentitiesForMentions​(String providerId,
                                                ProfileFilter profileFilter,
                                                Relationship.Type type,
                                                long offset,
                                                long limit,
                                                boolean forceLoadOrReloadProfile)
                                         throws IdentityStorageException
        Gets the identities by profile filter.
        Parameters:
        providerId - Id of provider.
        profileFilter - Information of profile that used in filtering.
        offset - Start index of list to be get.
        limit - End index of list to be get.
        forceLoadOrReloadProfile - Load profile or not.
        Returns:
        the identities by profile filter.
        Throws:
        IdentityStorageException
        Since:
        4.0.0-Alpha1
      • getIdentitiesForUnifiedSearch

        List<Identity> getIdentitiesForUnifiedSearch​(String providerId,
                                                     ProfileFilter profileFilter,
                                                     long offset,
                                                     long limit)
                                              throws IdentityStorageException
        Gets the identities for Unified Search.
        Parameters:
        providerId - Id of provider.
        profileFilter - Information of profile that used in filtering.
        offset - Start index of list to be get.
        limit - End index of list to be get.
        Returns:
        the identities
        Throws:
        IdentityStorageException
        Since:
        4.0.x
      • getIdentitiesByProfileFilterCount

        int getIdentitiesByProfileFilterCount​(String providerId,
                                              ProfileFilter profileFilter)
                                       throws IdentityStorageException
        Counts the number of identity by profile filter.
        Parameters:
        providerId - Id of Provider.
        profileFilter - Information of profile are used in filtering.
        Returns:
        Number of identities that are filtered by profile.
        Throws:
        IdentityStorageException
        Since:
        1.2.0-GA
      • getIdentitiesByFirstCharacterOfNameCount

        int getIdentitiesByFirstCharacterOfNameCount​(String providerId,
                                                     ProfileFilter profileFilter)
                                              throws IdentityStorageException
        Counts the number of identities that match the first character of name.
        Parameters:
        providerId -
        profileFilter - Profile filter object.
        Returns:
        Number of identities that start with the first character of name.
        Throws:
        IdentityStorageException
        Since:
        1.2.0-GA
      • getIdentitiesByFirstCharacterOfName

        @Deprecated
        List<Identity> getIdentitiesByFirstCharacterOfName​(String providerId,
                                                           ProfileFilter profileFilter,
                                                           long offset,
                                                           long limit,
                                                           boolean forceLoadOrReloadProfile)
                                                    throws IdentityStorageException
        Deprecated.
        use method getIdentities or getIdentitiesForUnifiedSearch instead
        Gets the identities that match the first character of name.
        Parameters:
        providerId - Id of provider.
        profileFilter - Profile filter object.
        offset - Start index of list to be get.
        limit - End index of list to be get.
        forceLoadOrReloadProfile - Load profile or not.
        Returns:
        Identities that have name start with the first character.
        Throws:
        IdentityStorageException
        Since:
        1.2.0-GA
      • getType

        @Deprecated
        default String getType​(String nodetype,
                               String property)
        Deprecated.
        JCR implementation doesn't exist anymore, so nodetype does not exist
        Gets the type.
        Parameters:
        nodetype - the nodetype
        property - the property
        Returns:
        the type
        Throws:
        IdentityStorageException
      • addOrModifyProfileProperties

        void addOrModifyProfileProperties​(Profile profile)
                                   throws IdentityStorageException
        Add or modify properties of profile and persist it. Profile parameter is a lightweight that contains only the property that you want to add or modify. NOTE: The method will not delete the properties on old profile when the param profile have not those keys.
        Parameters:
        profile -
        Throws:
        IdentityStorageException
      • updateProfileActivityId

        void updateProfileActivityId​(Identity identity,
                                     String activityId,
                                     Profile.AttachedActivityType type)
        Updates profile activity id by type.
        Parameters:
        identity -
        activityId -
        type - Type of activity id to get.
        Since:
        4.0.0.Alpha1
      • getProfileActivityId

        String getProfileActivityId​(Profile profile,
                                    Profile.AttachedActivityType type)
        Gets profile activity id by type.
        Parameters:
        profile -
        type - Type of activity id to get.
        Returns:
        Profile activity id.
        Since:
        4.0.0.Alpha1
      • getActiveUsers

        Set<String> getActiveUsers​(ActiveIdentityFilter filter)
        Gets the active user list base on the given ActiveIdentityFilter. 1. N days who last login less than N days. 2. UserGroup who belongs to this group.
        Parameters:
        filter -
        Returns:
        Since:
        4.1.0
      • processEnabledIdentity

        void processEnabledIdentity​(Identity identity,
                                    boolean isEnable)
        Process enable/disable Identity
        Parameters:
        identity - The Identity enable
        isEnable - true if the user is enable, false if not
        Since:
        4.2.x
      • getIdentitiesWithRelationships

        List<IdentityWithRelationship> getIdentitiesWithRelationships​(String identityId,
                                                                      int offset,
                                                                      int limit)
        Gets all identities from the store with the relationship that they have with current user identity.
        Parameters:
        identityId - user viewer identity id.
        offset - Start index of list to be get.
        limit - End index of list to be get.
        Returns:
        Identities that have name start with the first character.
        Since:
        4.4.0
      • getIdentitiesWithRelationships

        default List<IdentityWithRelationship> getIdentitiesWithRelationships​(String identityId,
                                                                              String firstCharFieldName,
                                                                              char firstChar,
                                                                              String sortFieldName,
                                                                              String sortDirection,
                                                                              int offset,
                                                                              int limit)
        Gets all identities from the store with the relationship that they have with current user identity. The firstChar parameter will be used to filter on identities fullname|lastname|firstname first character.
        Parameters:
        identityId -
        firstCharFieldName -
        firstChar -
        sortFieldName -
        sortDirection -
        offset -
        limit -
        Returns:
      • countIdentitiesWithRelationships

        int countIdentitiesWithRelationships​(String identityId)
                                      throws Exception
        Counts the number of identities
        Parameters:
        identityId - Id of Identity.
        Returns:
        Number of identities.
        Throws:
        Exception
        Since:
        4.4.0
      • countSpaceMemberIdentitiesByProfileFilter

        int countSpaceMemberIdentitiesByProfileFilter​(Space space,
                                                      ProfileFilter profileFilter,
                                                      SpaceMemberFilterListAccess.Type type)
        count Space's members by status and filter it by Profile Filter
        Parameters:
        space -
        profileFilter -
        type -
        Returns:
      • getIdentities

        default List<Identity> getIdentities​(String providerId,
                                             long offset,
                                             long limit)
        Get list of identities by providerId
        Parameters:
        providerId -
        offset -
        limit -
        Returns:
      • getIdentities

        List<Identity> getIdentities​(String providerId,
                                     String firstCharacterFieldName,
                                     char firstCharacter,
                                     String sortField,
                                     String sortDirection,
                                     boolean isEnabled,
                                     String userType,
                                     Boolean isConnected,
                                     String enrollmentStatus,
                                     long offset,
                                     long limit)
        Get list of identities by providerId The firstChar parameter will be used to filter on identities fullname/firstname/lastname first character.
        Parameters:
        providerId -
        firstCharacterFieldName -
        firstCharacter -
        sortField -
        sortDirection -
        isEnabled -
        userType -
        isConnected -
        enrollmentStatus -
        offset -
        limit -
        Returns:
      • sortIdentities

        default List<String> sortIdentities​(List<String> identityRemoteIds,
                                            String firstCharacterFieldName,
                                            char firstCharacter,
                                            String sortField,
                                            String sortDirection)
        Sorts a list of user identities using a field
        Parameters:
        identityRemoteIds -
        firstCharacterFieldName -
        firstCharacter -
        sortField -
        sortDirection -
        Returns:
      • sortIdentities

        default List<String> sortIdentities​(List<String> identityRemoteIds,
                                            String firstCharacterFieldName,
                                            char firstCharacter,
                                            String sortField,
                                            String sortDirection,
                                            boolean filterDisabled)
        Sorts a list of user identities using a field. Additionally, if filterDisabled is equal to true, only enabled users will be returned
        Parameters:
        identityRemoteIds -
        firstCharacterFieldName -
        firstCharacter -
        sortField -
        sortDirection -
        filterDisabled -
        Returns:
      • setImageUploadLimit

        default void setImageUploadLimit​(int imageUploadLimit)
        Change upload limit that will be used to check on uploaded avatar and banner
        Parameters:
        imageUploadLimit - upload limit in MB, default is 2 MB