Class RDBMSIdentityStorageImpl
java.lang.Object
org.exoplatform.social.core.jpa.storage.RDBMSIdentityStorageImpl
- All Implemented Interfaces:
org.exoplatform.social.core.storage.api.IdentityStorage
public class RDBMSIdentityStorageImpl
extends Object
implements org.exoplatform.social.core.storage.api.IdentityStorage
-
Field Summary
FieldsFields inherited from interface org.exoplatform.social.core.storage.api.IdentityStorage
DEFAULT_SORTING, DEFAULT_UPLOAD_IMAGE_LIMIT -
Constructor Summary
ConstructorsConstructorDescriptionRDBMSIdentityStorageImpl(IdentityDAO identityDAO, SpaceMemberDAO spaceMemberDAO, org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.services.organization.OrganizationService orgService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOrModifyProfileProperties(org.exoplatform.social.core.identity.model.Profile profile) Add or modify properties of profile and persist to database.intcountIdentitiesWithRelationships(String identityId) intcountSpaceMemberIdentitiesByProfileFilter(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.identity.SpaceMemberFilterListAccess.Type type) voiddeleteIdentity(org.exoplatform.social.core.identity.model.Identity identity) Deletes an identityorg.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.identity.model.Identity> findByFilter(ExtendProfileFilter filter) org.exoplatform.social.core.identity.model.IdentityfindIdentity(String providerId, String remoteId) Gets the identity by remote id.org.exoplatform.social.core.identity.model.IdentityfindIdentityById(String nodeId) Gets the identity by his id.findIdentityId(String providerId, String remoteId) getActiveUsers(org.exoplatform.social.core.identity.model.ActiveIdentityFilter filter) Gets the active user list base on the given ActiveIdentityFilter.org.exoplatform.social.core.storage.api.ActivityStorageorg.exoplatform.commons.file.model.FileItemgetAvatarFile(org.exoplatform.social.core.identity.model.Identity identity) getAvatarInputStreamById(org.exoplatform.social.core.identity.model.Identity identity) getBannerInputStreamById(org.exoplatform.social.core.identity.model.Identity identity) getDisabledSpaceMembers(Long spaceId) getEnabledUsernames(boolean internalsOnly, String afterUsername, int limit) List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, long offset, long limit) List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, long offset, long limit) List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, boolean includeInheritedMemberships, long offset, long limit) List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, long offset, long limit) List<org.exoplatform.social.core.identity.model.Identity> getIdentitiesByProfileFilter(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, long offset, long limit, boolean forceLoadOrReloadProfile) intgetIdentitiesByProfileFilterCount(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter) intgetIdentitiesCount(String providerId) Gets total number of identities in storage depend on providerId.List<org.exoplatform.social.core.identity.model.Identity> getIdentitiesForMentions(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit, boolean forceLoadOrReloadProfile) intgetIdentitiesForMentionsCount(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type) List<org.exoplatform.social.core.identity.model.Identity> getIdentitiesForUnifiedSearch(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, long offset, long limit) List<org.exoplatform.social.core.identity.model.IdentityWithRelationship> getIdentitiesWithRelationships(String identityId, int offset, int limit) List<org.exoplatform.social.core.identity.model.IdentityWithRelationship> getIdentitiesWithRelationships(String identityId, String sortFieldName, String sortDirection, int offset, int limit) getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, long offset, long limit) getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, boolean includeInheritedMemberships, long offset, long limit) getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, long offset, long limit) org.exoplatform.social.core.identity.IdentityProvider<?> getIdentityProvider(String providerId) getProfileActivityId(org.exoplatform.social.core.identity.model.Profile profile, org.exoplatform.social.core.identity.model.Profile.AttachedActivityType type) Gets profile activity id by type.org.exoplatform.social.core.storage.api.IdentityStorageList<org.exoplatform.social.core.identity.model.Identity> getSpaceMemberIdentitiesByProfileFilter(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.identity.SpaceMemberFilterListAccess.Type type, long offset, long limit) voidhardDeleteIdentity(org.exoplatform.social.core.identity.model.Identity identity) Hard delete an identityorg.exoplatform.social.core.identity.model.ProfileloadProfile(org.exoplatform.social.core.identity.model.Profile profile) Load profile.voidprocessEnabledIdentity(org.exoplatform.social.core.identity.model.Identity identity, boolean isEnable) Process enable/disable IdentityvoidremoveIdentity(org.exoplatform.social.core.identity.model.Identity identity) This method is introduced to clean totally identity from database It's used in unit testvoidsaveIdentity(org.exoplatform.social.core.identity.model.Identity identity) Saves identity.voidsaveProfile(org.exoplatform.social.core.identity.model.Profile profile) Saves profile.voidsetImageUploadLimit(int imageUploadLimit) voidsetProfileSearchConnector(ProfileSearchConnector profileSearchConnector) sortIdentities(List<String> identityRemoteIds, String sortField, String sortDirection) sortIdentities(List<String> identityRemoteIds, String sortField, String sortDirection, boolean filterDisabled) org.exoplatform.social.core.identity.model.IdentityupdateIdentity(org.exoplatform.social.core.identity.model.Identity identity) Updates existing identity's properties.voidupdateIdentityMembership(String remoteId) Updates existing identity's membership in OrganizationService.voidupdateProfile(org.exoplatform.social.core.identity.model.Profile profile) Updates profile.voidupdateProfileActivityId(org.exoplatform.social.core.identity.model.Identity identity, String activityId, org.exoplatform.social.core.identity.model.Profile.AttachedActivityType type) Updates profile activity id by type.voidupdateProfileProperty(String identityId, String propertyName, String value) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.exoplatform.social.core.storage.api.IdentityStorage
getIdentities, getIdentityIds, getType, sortIdentities
-
Field Details
-
DELETED_EMAIL_PREFIX
- See Also:
-
-
Constructor Details
-
RDBMSIdentityStorageImpl
public RDBMSIdentityStorageImpl(IdentityDAO identityDAO, SpaceMemberDAO spaceMemberDAO, org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.services.organization.OrganizationService orgService)
-
-
Method Details
-
getProfileSearchConnector
-
setProfileSearchConnector
-
saveIdentity
public void saveIdentity(org.exoplatform.social.core.identity.model.Identity identity) throws org.exoplatform.social.core.storage.IdentityStorageException Saves identity.- Specified by:
saveIdentityin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
identity- the identity- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
updateIdentity
public org.exoplatform.social.core.identity.model.Identity updateIdentity(org.exoplatform.social.core.identity.model.Identity identity) throws org.exoplatform.social.core.storage.IdentityStorageException Updates existing identity's properties.- Specified by:
updateIdentityin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
identity- the identity to be updated.- Returns:
- the updated identity.
- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error- Since:
- 1.2.0-GA
-
updateIdentityMembership
public void updateIdentityMembership(String remoteId) throws org.exoplatform.social.core.storage.IdentityStorageException Updates existing identity's membership in OrganizationService.- Specified by:
updateIdentityMembershipin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
remoteId- the remoteId to be updated membership.- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error- Since:
- 4.0.0
-
findIdentityById
public org.exoplatform.social.core.identity.model.Identity findIdentityById(String nodeId) throws org.exoplatform.social.core.storage.IdentityStorageException Gets the identity by his id.- Specified by:
findIdentityByIdin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
nodeId- the id of identity- Returns:
- the identity
- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
deleteIdentity
public void deleteIdentity(org.exoplatform.social.core.identity.model.Identity identity) throws org.exoplatform.social.core.storage.IdentityStorageException Deletes an identity- Specified by:
deleteIdentityin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
identity- the Identity to be deleted- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
hardDeleteIdentity
public void hardDeleteIdentity(org.exoplatform.social.core.identity.model.Identity identity) throws org.exoplatform.social.core.storage.IdentityStorageException Hard delete an identity- Specified by:
hardDeleteIdentityin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
identity- the identity to be deleted- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
loadProfile
public org.exoplatform.social.core.identity.model.Profile loadProfile(org.exoplatform.social.core.identity.model.Profile profile) throws org.exoplatform.social.core.storage.IdentityStorageException Load profile.- Specified by:
loadProfilein interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
profile- the profile- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
findIdentity
public org.exoplatform.social.core.identity.model.Identity findIdentity(String providerId, String remoteId) throws org.exoplatform.social.core.storage.IdentityStorageException Gets the identity by remote id.- Specified by:
findIdentityin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
providerId- the identity providerremoteId- the id- Returns:
- the identity by remote id
- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
findIdentityId
-
saveProfile
public void saveProfile(org.exoplatform.social.core.identity.model.Profile profile) throws org.exoplatform.social.core.storage.IdentityStorageException Saves profile.- Specified by:
saveProfilein interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
profile- the profile- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
updateProfile
public void updateProfile(org.exoplatform.social.core.identity.model.Profile profile) throws org.exoplatform.social.core.storage.IdentityStorageException Updates profile.- Specified by:
updateProfilein interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
profile- the profile- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error- Since:
- 1.2.0-GA
-
getIdentitiesCount
public int getIdentitiesCount(String providerId) throws org.exoplatform.social.core.storage.IdentityStorageException Gets total number of identities in storage depend on providerId.- Specified by:
getIdentitiesCountin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
addOrModifyProfileProperties
public void addOrModifyProfileProperties(org.exoplatform.social.core.identity.model.Profile profile) throws org.exoplatform.social.core.storage.IdentityStorageException Add or modify properties of profile and persist to database. 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- the profile- Throws:
org.exoplatform.social.core.storage.IdentityStorageException- if has any error
-
updateProfileProperty
public void updateProfileProperty(String identityId, String propertyName, String value) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
updateProfilePropertyin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
updateProfileActivityId
public void updateProfileActivityId(org.exoplatform.social.core.identity.model.Identity identity, String activityId, org.exoplatform.social.core.identity.model.Profile.AttachedActivityType type) Updates profile activity id by type.- Specified by:
updateProfileActivityIdin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
identity- the identityactivityId- the activity idtype- Type of activity id to get.- Since:
- 4.0.0.Alpha1
-
getProfileActivityId
public String getProfileActivityId(org.exoplatform.social.core.identity.model.Profile profile, org.exoplatform.social.core.identity.model.Profile.AttachedActivityType type) Gets profile activity id by type.- Specified by:
getProfileActivityIdin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
profile- the Profiletype- Type of activity id to get.- Returns:
- Profile activity id.
- Since:
- 4.0.0.Alpha1
-
getActiveUsers
public Set<String> getActiveUsers(org.exoplatform.social.core.identity.model.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- the filter- Returns:
- set of identity ids
- Since:
- 4.1.0
-
processEnabledIdentity
public void processEnabledIdentity(org.exoplatform.social.core.identity.model.Identity identity, boolean isEnable) Process enable/disable Identity- Specified by:
processEnabledIdentityin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Parameters:
identity- The Identity enableisEnable- true if the user is enable, false if not- Since:
- 4.2.x
-
getEnabledUsernames
-
getIdentitiesForMentions
public List<org.exoplatform.social.core.identity.model.Identity> getIdentitiesForMentions(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit, boolean forceLoadOrReloadProfile) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getIdentitiesForMentionsin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
getIdentitiesForMentionsCount
public int getIdentitiesForMentionsCount(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.relationship.model.Relationship.Type type) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getIdentitiesForMentionsCountin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
getIdentitiesByProfileFilterCount
public int getIdentitiesByProfileFilterCount(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getIdentitiesByProfileFilterCountin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
getIdentitiesForUnifiedSearch
public List<org.exoplatform.social.core.identity.model.Identity> getIdentitiesForUnifiedSearch(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, long offset, long limit) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getIdentitiesForUnifiedSearchin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
getSpaceMemberIdentitiesByProfileFilter
public List<org.exoplatform.social.core.identity.model.Identity> getSpaceMemberIdentitiesByProfileFilter(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.identity.SpaceMemberFilterListAccess.Type type, long offset, long limit) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getSpaceMemberIdentitiesByProfileFilterin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
countSpaceMemberIdentitiesByProfileFilter
public int countSpaceMemberIdentitiesByProfileFilter(org.exoplatform.social.core.space.model.Space space, org.exoplatform.social.core.profile.ProfileFilter profileFilter, org.exoplatform.social.core.identity.SpaceMemberFilterListAccess.Type type) - Specified by:
countSpaceMemberIdentitiesByProfileFilterin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getIdentitiesByProfileFilter
public List<org.exoplatform.social.core.identity.model.Identity> getIdentitiesByProfileFilter(String providerId, org.exoplatform.social.core.profile.ProfileFilter profileFilter, long offset, long limit, boolean forceLoadOrReloadProfile) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getIdentitiesByProfileFilterin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
getIdentities
public List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, long offset, long limit) - Specified by:
getIdentitiesin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getIdentities
public List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, long offset, long limit) - Specified by:
getIdentitiesin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getIdentities
public List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, boolean includeInheritedMemberships, long offset, long limit) - Specified by:
getIdentitiesin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getIdentityIds
public List<String> getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, long offset, long limit) - Specified by:
getIdentityIdsin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getIdentityIds
public List<String> getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, long offset, long limit) - Specified by:
getIdentityIdsin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getIdentityIds
public List<String> getIdentityIds(String providerId, String sortField, String sortDirection, boolean isEnabled, String userType, Boolean isConnected, String enrollmentStatus, List<String> remoteIds, List<String> groupIds, String membershipType, boolean includeInheritedMemberships, long offset, long limit) - Specified by:
getIdentityIdsin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getIdentities
public List<org.exoplatform.social.core.identity.model.Identity> getIdentities(String providerId, long offset, long limit) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getIdentitiesin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
getIdentitiesWithRelationships
public List<org.exoplatform.social.core.identity.model.IdentityWithRelationship> getIdentitiesWithRelationships(String identityId, int offset, int limit) throws org.exoplatform.social.core.storage.IdentityStorageException - Specified by:
getIdentitiesWithRelationshipsin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
org.exoplatform.social.core.storage.IdentityStorageException
-
getIdentitiesWithRelationships
public List<org.exoplatform.social.core.identity.model.IdentityWithRelationship> getIdentitiesWithRelationships(String identityId, String sortFieldName, String sortDirection, int offset, int limit) - Specified by:
getIdentitiesWithRelationshipsin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
countIdentitiesWithRelationships
-
findByFilter
public org.exoplatform.commons.utils.ListAccess<org.exoplatform.social.core.identity.model.Identity> findByFilter(ExtendProfileFilter filter) -
removeIdentity
public void removeIdentity(org.exoplatform.social.core.identity.model.Identity identity) This method is introduced to clean totally identity from database It's used in unit test- Parameters:
identity- the Identity
-
getAvatarInputStreamById
public InputStream getAvatarInputStreamById(org.exoplatform.social.core.identity.model.Identity identity) throws IOException - Specified by:
getAvatarInputStreamByIdin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
IOException
-
getAvatarFile
public org.exoplatform.commons.file.model.FileItem getAvatarFile(org.exoplatform.social.core.identity.model.Identity identity) - Specified by:
getAvatarFilein interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-
getBannerInputStreamById
public InputStream getBannerInputStreamById(org.exoplatform.social.core.identity.model.Identity identity) throws IOException - Specified by:
getBannerInputStreamByIdin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage- Throws:
IOException
-
getDisabledSpaceMembers
-
getIdentityProvider
public org.exoplatform.social.core.identity.IdentityProvider<?> getIdentityProvider(String providerId) -
getRDBMSCachedIdentityStorage
public org.exoplatform.social.core.storage.api.IdentityStorage getRDBMSCachedIdentityStorage() -
getActivityStorage
public org.exoplatform.social.core.storage.api.ActivityStorage getActivityStorage() -
getSpaceStorage
-
sortIdentities
-
sortIdentities
-
setImageUploadLimit
public void setImageUploadLimit(int imageUploadLimit) - Specified by:
setImageUploadLimitin interfaceorg.exoplatform.social.core.storage.api.IdentityStorage
-