Interface IdentityStorage
public interface IdentityStorage
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Sortingstatic final intDefault avatar and banner upload limits. -
Method Summary
Modifier and TypeMethodDescriptionintcountIdentitiesWithRelationships(String identityId) Counts the number of identitiesintcountSpaceMemberIdentitiesByProfileFilter(Space space, ProfileFilter profileFilter, SpaceMemberFilterListAccess.Type type) count Space's members by status and filter it by Profile FiltervoiddeleteIdentity(Identity identity) Deletes an identityfindIdentity(String providerId, String remoteId) Gets the identity by remote id.findIdentityById(String nodeId) Gets the identity by his id.default StringfindIdentityId(String providerId, String remoteId) Gets the identity id by remote id.default org.exoplatform.commons.file.model.FileItemgetAvatarFile(Identity identity) Retrieves user avatar file by a given identitygetAvatarInputStreamById(Identity identity) Gets a the avatar stream for a given identitygetBannerInputStreamById(Identity identity) Gets a the avatar stream for a given identitygetDisabledSpaceMembers(Long spaceId) Gets the list of usernames of the disabled space membersgetIdentities(String providerId, long offset, long limit) Get list of identities by providerIdgetIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, long offset, long limit) Get list of identities by providerIdgetIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter, long offset, long limit, boolean forceLoadOrReloadProfile) Gets the identities by profile filter.intgetIdentitiesByProfileFilterCount(String providerId, ProfileFilter profileFilter) Counts the number of identity by profile filter.intgetIdentitiesCount(String providerId) Gets total number of identities in storage depend on providerId.getIdentitiesForMentions(String providerId, ProfileFilter profileFilter, Relationship.Type type, long offset, long limit, boolean forceLoadOrReloadProfile) Gets the identities by profile filter.intgetIdentitiesForMentionsCount(String providerId, ProfileFilter profileFilter, Relationship.Type type) Gets the count identities by profile filter.getIdentitiesForUnifiedSearch(String providerId, ProfileFilter profileFilter, long offset, long limit) Gets the identities for Unified Search.getIdentitiesWithRelationships(String identityId, int offset, int limit) Gets all identities from the store with the relationship that they have with current user identity.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.getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, long offset, long limit) Get list of identities by providerIdgetProfileActivityId(Profile profile, Profile.AttachedActivityType type) Gets profile activity id by type.getSpaceMemberIdentitiesByProfileFilter(Space space, ProfileFilter profileFilter, SpaceMemberFilterListAccess.Type type, long offset, long limit) get Space's member Identity and filter it by Profile Filterdefault StringDeprecated, for removal: This API element is subject to removal in a future version.JCR implementation doesn't exist anymore, so nodetype does not existvoidhardDeleteIdentity(Identity identity) Hard delete an identityloadProfile(Profile profile) Load profile.voidprocessEnabledIdentity(Identity identity, boolean isEnable) Process enable/disable IdentityvoidsaveIdentity(Identity identity) Saves identity.voidsaveProfile(Profile profile) Saves profile.default voidsetImageUploadLimit(int imageUploadLimit) Change upload limit that will be used to check on uploaded avatar and bannersortIdentities(List<String> identityRemoteIds, String sortField) Deprecated.sortIdentities(List<String> identityRemoteIds, String sortField, String sortDirection) Sorts a list of user identities using a fieldsortIdentities(List<String> identityRemoteIds, String sortField, String sortDirection, boolean filterDisabled) Sorts a list of user identities using a field.updateIdentity(Identity identity) Updates existing identity's properties.voidupdateIdentityMembership(String remoteId) Updates existing identity's membership in OrganizationService.voidupdateProfile(Profile profile) Updates profile.voidupdateProfileActivityId(Identity identity, String activityId, Profile.AttachedActivityType type) Updates profile activity id by type.
-
Field Details
-
DEFAULT_SORTING
-
DEFAULT_UPLOAD_IMAGE_LIMIT
static final int DEFAULT_UPLOAD_IMAGE_LIMITDefault avatar and banner upload limits.- See Also:
-
-
Method Details
-
saveIdentity
Saves identity.- Parameters:
identity- the identity- Throws:
IdentityStorageException
-
updateIdentity
Updates existing identity's properties.- Parameters:
identity- the identity to be updated.- Returns:
- the updated identity.
- Throws:
IdentityStorageException- Since:
- 1.2.0-GA
-
updateIdentityMembership
Updates existing identity's membership in OrganizationService.- Parameters:
remoteId- the remoteId to be updated membership.- Throws:
IdentityStorageException- Since:
- 4.0.0
-
findIdentityById
Gets the identity by his id.- Parameters:
nodeId- the id of identity- Returns:
- the identity
- Throws:
IdentityStorageException
-
deleteIdentity
Deletes an identity- Parameters:
identity-- Throws:
IdentityStorageException
-
hardDeleteIdentity
Hard delete an identity- Parameters:
identity-- Throws:
IdentityStorageException
-
loadProfile
Load profile.- Parameters:
profile- the profile- Throws:
IdentityStorageException
-
findIdentity
Gets the identity by remote id.- Parameters:
providerId- the identity providerremoteId- the id- Returns:
- the identity by remote id
- Throws:
IdentityStorageException
-
findIdentityId
Gets the identity id by remote id.- Parameters:
providerId- the identity providerremoteId- the id- Returns:
- the identity id
- Throws:
IdentityStorageException
-
saveProfile
Saves profile.- Parameters:
profile- the profile- Throws:
IdentityStorageException
-
updateProfile
Updates profile.- Parameters:
profile- the profile- Throws:
IdentityStorageException- Since:
- 1.2.0-GA
-
getIdentitiesCount
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 existGets the type.- Parameters:
nodetype- the nodetypeproperty- 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
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
Process enable/disable Identity- Parameters:
identity- The Identity enableisEnable- 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
Counts the number of identities- Parameters:
identityId- Id of Identity.- Returns:
- Number of identities.
- Throws:
Exception- Since:
- 4.4.0
-
getAvatarInputStreamById
Gets a the avatar stream for a given identity- Parameters:
identity-- Returns:
- Throws:
IOException
-
getBannerInputStreamById
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
Get list of identities by providerId- Parameters:
providerId-offset-limit-- Returns:
-
getIdentities
List<Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, long offset, long limit) Get list of identities by providerId- Parameters:
providerId-sortField-sortDirection-isEnabled-userType-isConnected-enrollmentStatus-offset-limit-- Returns:
-
getIdentityIds
default List<String> getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, long offset, long limit) Get list of identities by providerId- Parameters:
providerId-sortField-sortDirection-isEnabled-userType-isConnected-enrollmentStatus-offset-limit-- Returns:
Listof identity ids
-
sortIdentities
Deprecated.Sorts a list of user identities using a field- Parameters:
identityRemoteIds-sortField-- Returns:
-
getDisabledSpaceMembers
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
Retrieves user avatar file by a given identity- Parameters:
identity- User social identity- Returns:
FileItem
-