Interface IdentityManager
public interface IdentityManager
Provides APIs to manage identities.
APIs provide capability of getting, creating or updating identities and profile information.
One identity is got by Id and allows the profile to be loaded or not.
With a list of identities, the type of returned result is
ListAccess which is used for lazy loading.
Also, the API which adds or removes the provider information is provided.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdentityProvider(IdentityProvider<?> identityProvider) Adds an identity provider to an identity manager.voidDeprecated.voiddeleteIdentity(Identity identity) Deletes an identity.default org.exoplatform.commons.file.model.FileItemgetAvatarFile(Identity identity) Retrieves user avatar file by a given identitygetAvatarInputStream(Identity identity) Gets a profile avatar associated with a provided identitygetBannerInputStream(Identity identity) Gets a profile banner associated with a provided identitygetConnections(Identity ownerIdentity) Deprecated.org.exoplatform.commons.utils.ListAccess<Identity> getConnectionsWithListAccess(Identity identity) Gets a list access which contains all identities connected to the provided identity.default SortinggetDisabledSpaceMembers(long spaceId) getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter) Deprecated.org.exoplatform.commons.utils.ListAccess<Identity> getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter, boolean isProfileLoaded) Gets a list access which contains all identities from a given provider.getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter, long offset, long limit) Deprecated.getIdentitiesByProfileFilter(ProfileFilter profileFilter) Deprecated.getIdentitiesByProfileFilter(ProfileFilter profileFilter, long offset, long limit) Deprecated.longgetIdentitiesCount(String providerId) Deprecated.Will be removed by 4.0.x.getIdentitiesFilterByAlphaBet(String providerId, ProfileFilter profileFilter) Deprecated.getIdentitiesFilterByAlphaBet(String providerId, ProfileFilter profileFilter, long offset, long limit) Deprecated.getIdentitiesFilterByAlphaBet(ProfileFilter profileFilter) Deprecated.org.exoplatform.commons.utils.ListAccess<Identity> getIdentitiesForUnifiedSearch(String providerId, ProfileFilter profileFilter) Gets a list access which contains identities matching with the Unified Search condition.default IdentitygetIdentity(long id) getIdentity(String id) Deprecated, for removal: This API element is subject to removal in a future version.Use getIdentity(Long) rather than getIdentity(String) since the id is no more an UUID inherited from JCRgetIdentity(String identityId, boolean isProfileLoaded) Deprecated.UsegetIdentity(String)instead.getIdentity(String providerId, String remoteId, boolean loadProfile) Deprecated.UsegetOrCreateIdentity(String, String, boolean)instead.Deprecated.Will be removed by 4.0.x.default intgetLastIdentities(int limit) Gets the last identities that have been created.default IdentitygetOrCreateGroupIdentity(String groupId) Retrieves the identity of a given group identified by its full idgetOrCreateIdentity(String providerId, String remoteId) Gets an identity by a remote Id.getOrCreateIdentity(String providerId, String remoteId, boolean isProfileLoaded) Deprecated.UsegetOrCreateIdentity(String, String)instead.default IdentitygetOrCreateSpaceIdentity(String spacePrettyName) Retrieves the identity of a given space identified by its prettyNamedefault IdentitygetOrCreateUserIdentity(String username) Retrieves the identity of a given user identified by his username/logingetProfile(Identity identity) Gets a profile associated with a provided identity.org.exoplatform.commons.utils.ListAccess<Identity> getSpaceIdentityByProfileFilter(Space space, ProfileFilter profileFilter, SpaceMemberFilterListAccess.Type type, boolean isProfileLoaded) Gets space identities by filter information.Deprecated.Will be removed by 4.0.x.voidhardDeleteIdentity(Identity identity) Cleans all data related to a specific identity.booleanidentityExisted(String providerId, String remoteId) Checks if an identity has already existed or not.voidprocessEnabledIdentity(String remoteId, boolean isEnable) Process status of Identity when enable/disable user.voidRegisters one or more identity providers throughIdentityProviderPlugin.voidregisterProfileListener(ProfileListener listener) Deprecated.Will be removed by 4.0.x.voidregisterProfileListener(ProfileListenerPlugin profileListenerPlugin) Registers a profile listener plugin by an external component plugin mechanism.voidremoveIdentityProvider(IdentityProvider<?> identityProvider) Removes a specific identity provider.default voidsaveIdentity(Identity identity) Deprecated, for removal: This API element is subject to removal in a future version.UseupdateIdentity(Identity)instead.default voidsaveProfile(Profile profile) Deprecated, for removal: This API element is subject to removal in a future version.sortIdentities(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.voidunregisterProfileListener(ProfileListener listener) Deprecated.Will be removed by 4.0.x.updateIdentity(Identity identity) Updates specific properties of an identity.voidupdateProfile(Profile specificProfile) Updates a specific profile.default voidupdateProfile(Profile specificProfile, boolean broadcastChanges) Updates a specific profile and broadcast detected changes on profile if 'broadcastChanges' is turned ondefault voidupdateProfile(Profile specificProfile, String modifierUsername, boolean broadcastChanges) Updates a specific profile and broadcast detected changes on profile if 'broadcastChanges' is turned on
-
Field Details
-
DEFAULT_SORTING
-
-
Method Details
-
getLastIdentities
Gets the last identities that have been created.- Parameters:
limit- the limit of identities to provide.- Returns:
- The last identities.
- Since:
- 4.0.x
- eXo level API
- Experimental
-
getOrCreateIdentity
Deprecated.UsegetOrCreateIdentity(String, String)instead. * Will be moved by 6.0.x.Gets or creates an identity provided by an identity provider and an identity Id.- Parameters:
providerId- Id of the identity provider.remoteId- The user remote Id.isProfileLoaded- Is profile loaded or not.- Returns:
- The identity.
- eXo level API
- Platform
-
getIdentity
Deprecated.UsegetIdentity(String)instead.Gets an identity by a given Id. This Id is UUID defined by storage.- Parameters:
identityId- Id of the identity.isProfileLoaded- Is profile loaded or not.- Returns:
- The identity.
- eXo level API
- Platform
-
updateIdentity
Updates specific properties of an identity.- Parameters:
identity- The identity.- Returns:
- The updated identity.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
deleteIdentity
Deletes an identity.- Parameters:
identity- The identity to be deleted.- eXo level API
- Platform
-
hardDeleteIdentity
Cleans all data related to a specific identity.- Parameters:
identity- The identity whose all data is cleaned.- eXo level API
- Platform
-
getConnectionsWithListAccess
Gets a list access which contains all identities connected to the provided identity. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
identity- The provided identity.- Returns:
- The identities which have connected to the provided identity.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getProfile
Gets a profile associated with a provided identity.- Parameters:
identity- The provided identity.- Returns:
- The profile.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getAvatarInputStream
Gets a profile avatar associated with a provided identity- Parameters:
identity-- Returns:
- Throws:
IOException
-
getBannerInputStream
Gets a profile banner associated with a provided identity- Parameters:
identity-- Returns:
- Throws:
IOException
-
updateProfile
Updates a specific profile.- Parameters:
specificProfile- The specific profile.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
updateProfile
Updates a specific profile and broadcast detected changes on profile if 'broadcastChanges' is turned on- Parameters:
specificProfile- The specific profile.broadcastChanges- whether detect and broadcast changed fields or not
-
updateProfile
default void updateProfile(Profile specificProfile, String modifierUsername, boolean broadcastChanges) Updates a specific profile and broadcast detected changes on profile if 'broadcastChanges' is turned on- Parameters:
specificProfile- The specific profile.modifierUsername- modifier username.broadcastChanges- whether detect and broadcast changed fields or not
-
getIdentitiesByProfileFilter
org.exoplatform.commons.utils.ListAccess<Identity> getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter, boolean isProfileLoaded) Gets a list access which contains all identities from a given provider. These identities are filtered by the profile filter. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
providerId- Id of the provider.profileFilter- The filter.isProfileLoaded- Is profile loaded or not.- Returns:
- The identities.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getIdentitiesForUnifiedSearch
org.exoplatform.commons.utils.ListAccess<Identity> getIdentitiesForUnifiedSearch(String providerId, ProfileFilter profileFilter) Gets a list access which contains identities matching with the Unified Search condition.- Parameters:
providerId- Id of the provider.profileFilter- The filter.- Returns:
- The identities.
- Since:
- 4.0.x
-
getSpaceIdentityByProfileFilter
org.exoplatform.commons.utils.ListAccess<Identity> getSpaceIdentityByProfileFilter(Space space, ProfileFilter profileFilter, SpaceMemberFilterListAccess.Type type, boolean isProfileLoaded) Gets space identities by filter information. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
space- The space in which identities are got.profileFilter- The filter information.type- Type of identities to find.isProfileLoaded- Is profile loaded or not.- Returns:
- The space identities.
- eXo level API
- Platform
-
addIdentityProvider
Adds an identity provider to an identity manager.- Parameters:
identityProvider- The identity provider.- eXo level API
- Platform
-
removeIdentityProvider
Removes a specific identity provider.- Parameters:
identityProvider- The specific identity provider.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
registerProfileListener
Registers a profile listener plugin by an external component plugin mechanism. For example:<external-component-plugins> <target-component>org.exoplatform.social.core.manager.IdentityManager</target-component> <component-plugin> <name>ProfileUpdatesPublisher</name> <set-method>registerProfileListener</set-method> <type>org.exoplatform.social.core.application.ProfileUpdatesPublisher</type> </component-plugin> </external-component-plugins>- Parameters:
profileListenerPlugin- The profile listener plugin.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
registerIdentityProviders
Registers one or more identity providers throughIdentityProviderPlugin.- Parameters:
plugin- The identity provider plugin.- eXo level API
- Platform
-
processEnabledIdentity
Process status of Identity when enable/disable user.- Parameters:
remoteId- The user remote idisEnable- true if the user is enable, false if not- Since:
- 4.1.x
- eXo level API
- Platform
-
getIdentity
Deprecated, for removal: This API element is subject to removal in a future version.Use getIdentity(Long) rather than getIdentity(String) since the id is no more an UUID inherited from JCRGets an identity by Id and also loads his profile.- Parameters:
id- Id of a Social identity (such asGlobalId) or a raw identity (such asIdentity.getId()).- Returns:
- Null if nothing is found, or the Identity object.
- See Also:
- eXo level API
- Provisional
-
getIdentity
-
getOrCreateIdentity
Gets an identity by a remote Id.- Parameters:
providerId- Id of the provider.remoteId- The remote Id.- Returns:
- The identity.
- eXo level API
- Provisional
-
getIdentitiesByProfileFilter
List<Identity> getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter) throws Exception Deprecated.UsegetIdentitiesByProfileFilter(String, org.exoplatform.social.core.profile.ProfileFilter, boolean)instead. Will be removed by 4.0.x.Gets identities by a profile filter.- Parameters:
providerId- Id of the provider.profileFilter- The profile filter.- Returns:
- The identities.
- Throws:
Exception- the exception- eXo level API
- Provisional
-
getIdentitiesByProfileFilter
List<Identity> getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter, long offset, long limit) throws Exception Deprecated.UsegetIdentitiesByProfileFilter(String, org.exoplatform.social.core.profile.ProfileFilter, boolean)instead. Will be removed by 4.0.x.Gets identities by a profile filter.- Parameters:
providerId- Id of the provider.profileFilter- The profile filter.offset- The starting point from which the identities are got.limit- The limitation of identities.- Returns:
- The identities.
- Throws:
Exception- eXo level API
- Provisional
-
getIdentitiesByProfileFilter
Deprecated.UsegetIdentitiesByProfileFilter(String, org.exoplatform.social.core.profile.ProfileFilter, boolean)instead. Will be removed by 4.0.x.Gets identities by the profile filter.- Parameters:
profileFilter- The profile filter.- Returns:
- The identities.
- Throws:
Exception- the exception- eXo level API
- Provisional
-
getIdentitiesByProfileFilter
List<Identity> getIdentitiesByProfileFilter(ProfileFilter profileFilter, long offset, long limit) throws Exception Deprecated.UsegetIdentitiesByProfileFilter(String, org.exoplatform.social.core.profile.ProfileFilter, boolean)instead. Will be removed by 4.0.x.Gets identities by the profile filter.- Parameters:
profileFilter- The profile filter.offset- The starting point from which the identities are got.limit- The limitation of identities.- Returns:
- The identities by the profile filter.
- Throws:
Exception- eXo level API
- Provisional
-
getIdentitiesFilterByAlphaBet
List<Identity> getIdentitiesFilterByAlphaBet(String providerId, ProfileFilter profileFilter) throws Exception Deprecated.UsegetIdentitiesByProfileFilter(String, org.exoplatform.social.core.profile.ProfileFilter, boolean)instead. Will be removed by 4.0.x.Gets identities by the alphabetical filter.- Parameters:
providerId- Id of the provider.profileFilter- The profile filter.- Returns:
- The identities.
- Throws:
Exception- the exception- eXo level API
- Provisional
-
getIdentitiesFilterByAlphaBet
List<Identity> getIdentitiesFilterByAlphaBet(String providerId, ProfileFilter profileFilter, long offset, long limit) throws Exception Deprecated.UsegetIdentitiesByProfileFilter(String, org.exoplatform.social.core.profile.ProfileFilter, boolean)instead. Will be removed by 4.0.x.Gets identities by the alphabetical filter with offset and limit points.- Parameters:
providerId- Id of the provider.profileFilter- The profile filter.offset- The starting point from which identities are got.limit- The limitation of identities.- Returns:
- The identities.
- Throws:
Exception- eXo level API
- Provisional
-
getIdentitiesFilterByAlphaBet
Deprecated.UsegetIdentitiesByProfileFilter(String, org.exoplatform.social.core.profile.ProfileFilter, boolean)instead. Will be removed by 4.0.x.Gets identities by the alphabetical filter.- Parameters:
profileFilter- The profile filter.- Returns:
- The identities.
- Throws:
Exception- the exception- eXo level API
- Provisional
-
getIdentity
Deprecated.UsegetOrCreateIdentity(String, String, boolean)instead. Will be removed by 4.0.x.Gets an identity from the provider. To make sure to get information from DB, usegetOrCreateIdentity(String, String, boolean).- Parameters:
providerId- Id of the provider.remoteId- The remote Id.loadProfile- Load the identity profile or not.- Returns:
- The identity.
- eXo level API
- Provisional
-
getIdentitiesCount
Deprecated.Will be removed by 4.0.x.Gets a count of identities.- Returns:
- The count of identities.
- eXo level API
- Provisional
-
identityExisted
Checks if an identity has already existed or not.- Parameters:
providerId- Id of the provider.remoteId- The remote Id.- Returns:
- "True" if the checked identity has already existed. Otherwise, it returns "false".
- eXo level API
- Provisional
-
saveIdentity
Deprecated, for removal: This API element is subject to removal in a future version.UseupdateIdentity(Identity)instead. Will be removed by 4.0.x.Saves an identity.- Parameters:
identity- The identity to be saved.- eXo level API
- Provisional
-
saveProfile
Deprecated, for removal: This API element is subject to removal in a future version.UseupdateProfile(org.exoplatform.social.core.identity.model.Profile)instead. Will be removed by 4.0.x.Saves a profile.- Parameters:
profile- The profile to be saved.- eXo level API
- Provisional
-
getConnections
Deprecated.UsegetConnectionsWithListAccess(org.exoplatform.social.core.identity.model.Identity)instead. Will be removed by 4.0.x.Gets connections of an identity.- Parameters:
ownerIdentity- The identity.- Returns:
- The list of identities.
- Throws:
Exception- Since:
- 1.1.1
- eXo level API
- Provisional
-
getIdentityStorage
IdentityStorage getIdentityStorage()Deprecated.Will be removed by 4.0.x.Gets the identity storage.- Returns:
- The identity storage.
- eXo level API
- Provisional
-
getStorage
IdentityStorage getStorage()Deprecated.Will be removed by 4.0.x.Gets the identity storage.- Returns:
- The identity storage.
- eXo level API
- Provisional
-
registerProfileListener
Deprecated.Will be removed by 4.0.x.Registers a profile listener.- Parameters:
listener- The profile listener to be registered.- eXo level API
- Provisional
-
unregisterProfileListener
Deprecated.Will be removed by 4.0.x.Unregisters a profile listener.- Parameters:
listener- The listener to be unregistered.- eXo level API
- Provisional
-
addProfileListener
Deprecated.UseregisterProfileListener(org.exoplatform.social.core.profile.ProfileListenerPlugin)instead. Will be removed by 4.0.x.Registers a profile listener component plugin.- Parameters:
plugin- The plugin to be registered.- eXo level API
- Provisional
-
sortIdentities
Deprecated.Sorts a list of user identities using a field- Parameters:
identityRemoteIds-sortField-- Returns:
-
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:
Listof userNames sorted by sortField
-
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:
-
getDefaultSorting
- Returns:
- default sorting to apply when listing
-
getImageUploadLimit
default int getImageUploadLimit()- Returns:
- banner and avatar of identities Max upload size in MB
-
getOrCreateSpaceIdentity
Retrieves the identity of a given space identified by its prettyName -
getOrCreateGroupIdentity
Retrieves the identity of a given group identified by its full id- Parameters:
groupId-GroupprettyName- Returns:
Identityif found, else null
-
getOrCreateUserIdentity
Retrieves the identity of a given user identified by his username/login- Parameters:
username- login identifier of the user- Returns:
Identityif found, else null
-
getAvatarFile
Retrieves user avatar file by a given identity- Parameters:
identity- User social identity- Returns:
FileItem
-
getDisabledSpaceMembers
- Parameters:
spaceId-- Returns:
-
registerProfileListener(org.exoplatform.social.core.profile.ProfileListenerPlugin)instead.