Interface IdentityStorage


public interface IdentityStorage
  • Field Details

    • 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:
  • Method Details

    • saveIdentity

      void saveIdentity(Identity identity) throws IdentityStorageException
      Saves identity.
      Parameters:
      identity - the identity
      Throws:
      IdentityStorageException
    • updateIdentity

      Identity updateIdentity(Identity identity) throws IdentityStorageException
      Updates existing identity's properties.
      Parameters:
      identity - the identity to be updated.
      Returns:
      the updated identity.
      Throws:
      IdentityStorageException
      Since:
      1.2.0-GA
    • 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
    • findIdentityById

      Identity findIdentityById(String nodeId) throws IdentityStorageException
      Gets the identity by his id.
      Parameters:
      nodeId - the id of identity
      Returns:
      the identity
      Throws:
      IdentityStorageException
    • deleteIdentity

      void deleteIdentity(Identity identity) throws IdentityStorageException
      Deletes an identity
      Parameters:
      identity -
      Throws:
      IdentityStorageException
    • hardDeleteIdentity

      void hardDeleteIdentity(Identity identity) throws IdentityStorageException
      Hard delete an identity
      Parameters:
      identity -
      Throws:
      IdentityStorageException
    • loadProfile

      Profile loadProfile(Profile profile) throws IdentityStorageException
      Load profile.
      Parameters:
      profile - the profile
      Throws:
      IdentityStorageException
    • findIdentity

      Identity findIdentity(String providerId, String remoteId) throws IdentityStorageException
      Gets the identity by remote id.
      Parameters:
      providerId - the identity provider
      remoteId - the id
      Returns:
      the identity by remote id
      Throws:
      IdentityStorageException
    • findIdentityId

      default String findIdentityId(String providerId, String remoteId) throws IdentityStorageException
      Gets the identity id by remote id.
      Parameters:
      providerId - the identity provider
      remoteId - the id
      Returns:
      the identity id
      Throws:
      IdentityStorageException
    • saveProfile

      void saveProfile(Profile profile) throws IdentityStorageException
      Saves profile.
      Parameters:
      profile - the profile
      Throws:
      IdentityStorageException
    • updateProfile

      void updateProfile(Profile profile) throws IdentityStorageException
      Updates profile.
      Parameters:
      profile - the profile
      Throws:
      IdentityStorageException
      Since:
      1.2.0-GA
    • getIdentitiesCount

      int getIdentitiesCount(String providerId) throws IdentityStorageException
      Gets total number of identities in storage depend on providerId.
      Throws:
      IdentityStorageException
    • 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
    • getIdentitiesForMentionsCount

      int getIdentitiesForMentionsCount(String providerId, ProfileFilter profileFilter, Relationship.Type type) throws IdentityStorageException
      Gets the count identities by profile filter.
      Parameters:
      providerId - Id of provider.
      profileFilter - Information of profile that used in filtering.
      Returns:
      the number of filtered identities
      Throws:
      IdentityStorageException
      Since:
      4.4.0
    • 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
    • getType

      @Deprecated(forRemoval=true, since="1.4.0") default String getType(String nodetype, String property)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
    • getSpaceMemberIdentitiesByProfileFilter

      List<Identity> getSpaceMemberIdentitiesByProfileFilter(Space space, ProfileFilter profileFilter, SpaceMemberFilterListAccess.Type type, long offset, long limit) throws IdentityStorageException
      get Space's member Identity and filter it by Profile Filter
      Parameters:
      space -
      profileFilter -
      offset -
      limit -
      Returns:
      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
    • 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
      Since:
      4.4.0
    • getIdentitiesWithRelationships

      default List<IdentityWithRelationship> getIdentitiesWithRelationships(String identityId, String sortFieldName, String sortDirection, int offset, int limit)
      Gets all identities from the store with the relationship that they have with current user identity.
      Parameters:
      identityId -
      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
    • getAvatarInputStreamById

      InputStream getAvatarInputStreamById(Identity identity) throws IOException
      Gets a the avatar stream for a given identity
      Parameters:
      identity -
      Returns:
      Throws:
      IOException
    • getBannerInputStreamById

      InputStream getBannerInputStreamById(Identity identity) throws IOException
      Gets a the avatar stream for a given identity
      Parameters:
      identity -
      Returns:
      Throws:
      IOException
    • 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

      @Deprecated(forRemoval=true, since="7.2.0") default List<Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, long offset, long limit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The old getIdentities method without remoteIds no longer exists, use getIdentities with the remoteIds parameter instead.
      Get list of identities by providerId
      Parameters:
      providerId -
      sortField -
      sortDirection -
      isEnabled -
      userType -
      isConnected -
      enrollmentStatus -
      offset -
      limit -
      Returns:
    • getIdentities

      default List<Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, long offset, long limit)
    • getIdentityIds

      @Deprecated(forRemoval=true, since="7.2.0") default List<String> getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, long offset, long limit)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The old getIdentityIds method without remoteIds no longer exists, use getIdentityIds with the remoteIds parameter instead.
      Get list of identities by providerId
      Parameters:
      providerId -
      sortField -
      sortDirection -
      isEnabled -
      userType -
      isConnected -
      enrollmentStatus -
      offset -
      limit -
      Returns:
      List of identity ids
    • getIdentityIds

      default List<String> getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, long offset, long limit)
    • sortIdentities

      @Deprecated default List<String> sortIdentities(List<String> identityRemoteIds, String sortField)
      Sorts a list of user identities using a field
      Parameters:
      identityRemoteIds -
      sortField -
      Returns:
    • getDisabledSpaceMembers

      default List<String> getDisabledSpaceMembers(Long spaceId)
      Gets the list of usernames of the disabled space members
      Parameters:
      spaceId - the ID of the space
      Returns:
      the list of usernames
    • sortIdentities

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

      default List<String> sortIdentities(List<String> identityRemoteIds, 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 -
      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
    • getAvatarFile

      default org.exoplatform.commons.file.model.FileItem getAvatarFile(Identity identity)
      Retrieves user avatar file by a given identity
      Parameters:
      identity - User social identity
      Returns:
      FileItem