Interface IdentityStorage


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

    • DEFAULT_SORTING

      static final Sorting DEFAULT_SORTING
    • EMPTY_CHARACTER

      static final char EMPTY_CHARACTER
      See Also:
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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

      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

      @Deprecated default List<String> sortIdentities(List<String> identityRemoteIds, String sortField)
      Sorts a list of user identities using a field
      Parameters:
      identityRemoteIds -
      sortField -
      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
    • 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