Interface IdentityStorage
public interface IdentityStorage
- Version:
- $Revision$
- Author:
- Alain Defrance
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Sortingstatic final intDefault avatar and banner upload limits.static final char -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOrModifyProfileProperties(Profile profile) Add or modify properties of profile and persist it.intcountIdentitiesWithRelationships(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.getActiveUsers(ActiveIdentityFilter filter) Gets the active user list base on the given ActiveIdentityFilter.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 identitygetIdentities(String providerId, long offset, long limit) Get list of identities by providerIdgetIdentities(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.getIdentitiesByFirstCharacterOfName(String providerId, ProfileFilter profileFilter, long offset, long limit, boolean forceLoadOrReloadProfile) Deprecated.use method getIdentities or getIdentitiesForUnifiedSearch insteadintgetIdentitiesByFirstCharacterOfNameCount(String providerId, ProfileFilter profileFilter) Counts the number of identities that match the first character of name.getIdentitiesByProfileFilter(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 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.getProfileActivityId(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.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 firstCharacterFieldName, char firstCharacter, String sortField, String sortDirection) Sorts a list of user identities using a fieldsortIdentities(List<String> identityRemoteIds, String firstCharacterFieldName, char firstCharacter, 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
-
EMPTY_CHARACTER
static final char EMPTY_CHARACTER- See Also:
-
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
-
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
-
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 insteadGets 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.JCR implementation doesn't exist anymore, so nodetype does not existGets the type.- Parameters:
nodetype- the nodetypeproperty- the property- Returns:
- the type
- Throws:
IdentityStorageException
-
addOrModifyProfileProperties
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
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
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
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 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
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 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.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
Retrieves user avatar file by a given identity- Parameters:
identity- User social identity- Returns:
FileItem
-