Interface IdentityManager
-
public interface IdentityManagerProvides 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 isListAccesswhich is used for lazy loading. Also, the API which adds or removes the provider information is provided.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_FIRST_CHAR_FILTERINGstatic SortingDEFAULT_SORTINGstatic charEMPTY_CHARACTER
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddIdentityProvider(IdentityProvider<?> identityProvider)Adds an identity provider to an identity manager.voidaddOrModifyProfileProperties(Profile profile)Deprecated.Will be removed by 4.0.x.voidaddProfileListener(ProfileListenerPlugin plugin)Deprecated.voiddeleteIdentity(Identity identity)Deletes an identity.InputStreamgetAvatarInputStream(Identity identity)Gets a profile avatar associated with a provided identityInputStreamgetBannerInputStream(Identity identity)Gets a profile banner associated with a provided identityList<Identity>getConnections(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 SortinggetDefaultSorting()default StringgetFirstCharacterFiltering()List<Identity>getIdentities(String providerId)Deprecated.UsegetIdentities(String, boolean)instead.List<Identity>getIdentities(String providerId, boolean loadProfile)Deprecated.UsegetIdentities(String, boolean)instead.List<Identity>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.List<Identity>getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter, long offset, long limit)Deprecated.List<Identity>getIdentitiesByProfileFilter(ProfileFilter profileFilter)Deprecated.List<Identity>getIdentitiesByProfileFilter(ProfileFilter profileFilter, long offset, long limit)Deprecated.longgetIdentitiesCount(String providerId)Deprecated.Will be removed by 4.0.x.List<Identity>getIdentitiesFilterByAlphaBet(String providerId, ProfileFilter profileFilter)Deprecated.List<Identity>getIdentitiesFilterByAlphaBet(String providerId, ProfileFilter profileFilter, long offset, long limit)Deprecated.List<Identity>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.IdentitygetIdentity(String id)Gets an identity by Id and also loads his profile.IdentitygetIdentity(String identityId, boolean isProfileLoaded)Deprecated.UsegetIdentity(String)instead.IdentitygetIdentity(String providerId, String remoteId, boolean loadProfile)Deprecated.UsegetOrCreateIdentity(String, String, boolean)instead.IdentityStoragegetIdentityStorage()Deprecated.Will be removed by 4.0.x.default intgetImageUploadLimit()List<Identity>getLastIdentities(int limit)Gets the last identities that have been created.IdentitygetOrCreateIdentity(String providerId, String remoteId)Gets an identity by a remote Id.IdentitygetOrCreateIdentity(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/loginProfilegetProfile(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.IdentityStoragegetStorage()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.voidregisterIdentityProviders(IdentityProviderPlugin plugin)Registers 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.voidsaveIdentity(Identity identity)Deprecated.UsegetOrCreateIdentity(String, String, boolean)instead.voidsaveProfile(Profile profile)Deprecated.default List<String>sortIdentities(List<String> identityRemoteIds, String sortField)Deprecated.default List<String>sortIdentities(List<String> identityRemoteIds, String firstCharacterFieldName, char firstCharacter, String sortField, String sortDirection)Sorts a list of user identities using a fielddefault 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.voidunregisterProfileListener(ProfileListener listener)Deprecated.Will be removed by 4.0.x.voidupdateAvatar(Profile p)Deprecated.Will be removed by 4.0.x.voidupdateBasicInfo(Profile p)Deprecated.Will be removed by 4.0.x.voidupdateContactSection(Profile p)Deprecated.Will be removed by 4.0.x.voidupdateExperienceSection(Profile p)Deprecated.Will be removed by 4.0.x.voidupdateHeaderSection(Profile p)Deprecated.Will be removed by 4.0.x.IdentityupdateIdentity(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 on
-
-
-
Field Detail
-
DEFAULT_SORTING
static final Sorting DEFAULT_SORTING
-
DEFAULT_FIRST_CHAR_FILTERING
static final String DEFAULT_FIRST_CHAR_FILTERING
-
EMPTY_CHARACTER
static final char EMPTY_CHARACTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLastIdentities
List<Identity> getLastIdentities(int limit)
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
Identity getOrCreateIdentity(String providerId, String remoteId, boolean isProfileLoaded)
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
Identity getIdentity(String identityId, boolean isProfileLoaded)
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
Identity updateIdentity(Identity identity)
Updates specific properties of an identity.- Parameters:
identity- The identity.- Returns:
- The updated identity.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
deleteIdentity
void deleteIdentity(Identity identity)
Deletes an identity.- Parameters:
identity- The identity to be deleted.- eXo level API
- Platform
-
hardDeleteIdentity
void hardDeleteIdentity(Identity identity)
Cleans all data related to a specific identity.- Parameters:
identity- The identity whose all data is cleaned.- eXo level API
- Platform
-
getConnectionsWithListAccess
org.exoplatform.commons.utils.ListAccess<Identity> getConnectionsWithListAccess(Identity identity)
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
Profile getProfile(Identity identity)
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
InputStream getAvatarInputStream(Identity identity) throws IOException
Gets a profile avatar associated with a provided identity- Parameters:
identity-- Returns:
- Throws:
IOException
-
getBannerInputStream
InputStream getBannerInputStream(Identity identity) throws IOException
Gets a profile banner associated with a provided identity- Parameters:
identity-- Returns:
- Throws:
IOException
-
updateProfile
void updateProfile(Profile specificProfile)
Updates a specific profile.- Parameters:
specificProfile- The specific profile.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
updateProfile
default void updateProfile(Profile specificProfile, boolean broadcastChanges)
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
-
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
void addIdentityProvider(IdentityProvider<?> identityProvider)
Adds an identity provider to an identity manager.- Parameters:
identityProvider- The identity provider.- eXo level API
- Platform
-
removeIdentityProvider
void removeIdentityProvider(IdentityProvider<?> identityProvider)
Removes a specific identity provider.- Parameters:
identityProvider- The specific identity provider.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
registerProfileListener
void registerProfileListener(ProfileListenerPlugin profileListenerPlugin)
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
void registerIdentityProviders(IdentityProviderPlugin plugin)
Registers one or more identity providers throughIdentityProviderPlugin.- Parameters:
plugin- The identity provider plugin.- eXo level API
- Platform
-
processEnabledIdentity
void processEnabledIdentity(String remoteId, boolean isEnable)
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
Identity getIdentity(String id)
Gets 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:
getIdentity(String, boolean)- eXo level API
- Provisional
-
getOrCreateIdentity
Identity getOrCreateIdentity(String providerId, String remoteId)
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
List<Identity> getIdentitiesByProfileFilter(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 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
List<Identity> getIdentitiesFilterByAlphaBet(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:
profileFilter- The profile filter.- Returns:
- The identities.
- Throws:
Exception- the exception- eXo level API
- Provisional
-
getIdentity
Identity getIdentity(String providerId, String remoteId, boolean loadProfile)
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
long getIdentitiesCount(String providerId)
Deprecated.Will be removed by 4.0.x.Gets a count of identities.- Returns:
- The count of identities.
- eXo level API
- Provisional
-
identityExisted
boolean identityExisted(String providerId, String remoteId)
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
void saveIdentity(Identity identity)
Deprecated.UsegetOrCreateIdentity(String, String, boolean)instead. Will be removed by 4.0.x.Saves an identity.- Parameters:
identity- The identity to be saved.- eXo level API
- Provisional
-
saveProfile
void saveProfile(Profile profile)
Deprecated.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
-
addOrModifyProfileProperties
void addOrModifyProfileProperties(Profile profile) throws Exception
Deprecated.Will be removed by 4.0.x.Adds or modifies properties of a profile. The profile parameter is lightweight that contains only the property you want to add or modify. NOTE: The method will not delete properties from the old profile when the param profile has not those keys.- Parameters:
profile- The identity profile containing information which is added or modified.- Throws:
Exception- eXo level API
- Provisional
-
updateAvatar
void updateAvatar(Profile p)
Deprecated.Will be removed by 4.0.x.Updates an avatar.- Parameters:
p- The profile containing its avatar which is updated.- Throws:
MessageException- eXo level API
- Provisional
-
updateBasicInfo
void updateBasicInfo(Profile p) throws Exception
Deprecated.Will be removed by 4.0.x.Updates the basic information.- Parameters:
p- The profile containing its basic information which is updated.- Throws:
Exception- eXo level API
- Provisional
-
updateContactSection
void updateContactSection(Profile p) throws Exception
Deprecated.Will be removed by 4.0.x.Updates the contact section of a profile.- Parameters:
p- The profile containing its contact section which is updated.- Throws:
Exception- eXo level API
- Provisional
-
updateExperienceSection
void updateExperienceSection(Profile p) throws Exception
Deprecated.Will be removed by 4.0.x.Updates the experience section of a profile.- Parameters:
p- The profile containing the experience section which is updated.- Throws:
Exception- eXo level API
- Provisional
-
updateHeaderSection
void updateHeaderSection(Profile p) throws Exception
Deprecated.Will be removed by 4.0.x.Updates the header section of profile.- Parameters:
p- The profile containing the header section which is updated.- Throws:
Exception- eXo level API
- Provisional
-
getIdentities
List<Identity> getIdentities(String providerId) throws Exception
Deprecated.UsegetIdentities(String, boolean)instead. Will be removed by 4.0.x.Gets identities.- Parameters:
providerId- Id of the provider.- Returns:
- The identities.
- Throws:
Exception- the exception- eXo level API
- Provisional
-
getIdentities
List<Identity> getIdentities(String providerId, boolean loadProfile) throws Exception
Deprecated.UsegetIdentities(String, boolean)instead. Will be removed by 4.0.x.Gets all identities from a provider Id.- Parameters:
providerId- Id of the provider.loadProfile- The load profile.- Returns:
- The identities.
- Throws:
Exception- eXo level API
- Provisional
-
getConnections
List<Identity> getConnections(Identity ownerIdentity) throws Exception
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
void registerProfileListener(ProfileListener listener)
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
void unregisterProfileListener(ProfileListener listener)
Deprecated.Will be removed by 4.0.x.Unregisters a profile listener.- Parameters:
listener- The listener to be unregistered.- eXo level API
- Provisional
-
addProfileListener
void addProfileListener(ProfileListenerPlugin plugin)
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 default List<String> sortIdentities(List<String> identityRemoteIds, String sortField)
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:
Listof userNames sorted by sortField
-
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:
-
getDefaultSorting
default Sorting getDefaultSorting()
- Returns:
- default sorting to apply when listing
-
getFirstCharacterFiltering
default String getFirstCharacterFiltering()
- Returns:
- field name to use to filter on first character when listing identities
-
getImageUploadLimit
default int getImageUploadLimit()
- Returns:
- banner and avatar of identities Max upload size in MB
-
getOrCreateSpaceIdentity
default Identity getOrCreateSpaceIdentity(String spacePrettyName)
Retrieves the identity of a given space identified by its prettyName
-
-