Class ProfileServiceImpl
java.lang.Object
org.bonitasoft.engine.profile.impl.ProfileServiceImpl
- All Implemented Interfaces:
ProfileService
- Author:
- Matthieu Chaffotte, Elias Ricken de Medeiros
-
Field Summary
Fields inherited from interface org.bonitasoft.engine.profile.ProfileService
PROFILE, PROFILE_MEMBER -
Constructor Summary
ConstructorsConstructorDescriptionProfileServiceImpl(PersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, ReadSessionAccessor sessionAccessor, SessionService sessionService) -
Method Summary
Modifier and TypeMethodDescriptionaddGroupToProfile(long profileId, long groupId, String groupName, String parentPath) Add a group to exist profileaddRoleAndGroupToProfile(long profileId, long roleId, long groupId, String roleName, String groupName, String groupParentPath) Add a role and a group to exist profileaddRoleToProfile(long profileId, long roleId, String roleName) Add a role to exist profileaddUserToProfile(long profileId, long userId, String firstName, String lastName, String userName) Add a user to exist profilecreateProfile(SProfile profile) Add a new profilevoidDelete all profile members for the connected tenantvoiddeleteAllProfileMembersOfProfile(SProfile profile) voiddeleteProfile(long profileId) Delete profile by its idvoiddeleteProfile(SProfile profile) Delete profile by given sProfilevoiddeleteProfileMember(long profileMemberId) Delete a profile member by its idvoiddeleteProfileMember(SProfileMember profileMember) Delete a profile member by given sProfile memberlonggetNumberOfProfileMembers(String querySuffix, QueryOptions countOptions) Get the total number of profile memberslonggetNumberOfProfiles(QueryOptions queryOptions) getProfile(long profileId) Get profile by its idgetProfileByName(String profileName) Get profile by given namegetProfileMembers(long profileId, QueryOptions queryOptions) Get a list of profileMembers by the given profileIdgetProfileMembers(List<Long> profileIds) Get the total number of sProfileMember by a list contains profileIdsgetProfileMembersOfGroup(long groupId, int fromIndex, int numberOfElements, String field, OrderByType order) Get all sProfileMembers with same group having the given value for the given int indexgetProfileMembersOfRole(long roleId, int fromIndex, int numberOfElements, String field, OrderByType order) Get all sProfileMembers with same group having the given value for the given int indexgetProfileMembersOfUser(long userId, int fromIndex, int numberOfElements, String field, OrderByType order) Get all sProfileMembers with same user having the given value for the given int indexgetProfileMemberWithoutDisplayName(long profileMemberId) getProfiles(List<Long> profileIds) Get all profiles by given idsgetProfilesOfUser(long userId) searchProfileMembers(String querySuffix, QueryOptions queryOptions) Get all sProfileMember by profileId and queryOptionssearchProfiles(QueryOptions queryOptions) searchProfilesOfUser(long userId, int fromIndex, int numberOfElements, String field, OrderByType order) Get all profiles of the user by userIdupdateProfile(SProfile sProfile, EntityUpdateDescriptor descriptor) Update profile by given profile and new contentvoidupdateProfileMetaData(long profileId) updates profile metaData fields lastUpdateDate and lastUpdatedBy for a given profile
-
Constructor Details
-
ProfileServiceImpl
public ProfileServiceImpl(PersistenceService persistenceService, Recorder recorder, QueriableLoggerService queriableLoggerService, ReadSessionAccessor sessionAccessor, SessionService sessionService)
-
-
Method Details
-
createProfile
Description copied from interface:ProfileServiceAdd a new profile- Specified by:
createProfilein interfaceProfileService- Returns:
- sProfile
- Throws:
SProfileCreationException- occurs when an exception is thrown during sProfile creation
-
getProfile
Description copied from interface:ProfileServiceGet profile by its id- Specified by:
getProfilein interfaceProfileService- Returns:
- sProfile
- Throws:
SProfileNotFoundException- occurs when the identifier does not refer to an existing sProfile
-
getProfileByName
public SProfile getProfileByName(String profileName) throws SProfileNotFoundException, SBonitaReadException Description copied from interface:ProfileServiceGet profile by given name- Specified by:
getProfileByNamein interfaceProfileService- Returns:
- sProfile
- Throws:
SProfileNotFoundException- occurs when the identifier does not refer to an existing sProfileSBonitaReadException
-
getProfiles
Description copied from interface:ProfileServiceGet all profiles by given ids- Specified by:
getProfilesin interfaceProfileService- Parameters:
profileIds- a list contains many profile id- Returns:
- Throws:
SProfileNotFoundException- occurs when the identifier does not refer to an existing sProfile
-
updateProfile
public SProfile updateProfile(SProfile sProfile, EntityUpdateDescriptor descriptor) throws SProfileUpdateException Description copied from interface:ProfileServiceUpdate profile by given profile and new content- Specified by:
updateProfilein interfaceProfileService- Returns:
- The updated profile
- Throws:
SProfileUpdateException- occurs when an exception is thrown during sProfile update
-
deleteProfile
public void deleteProfile(SProfile profile) throws SProfileDeletionException, SProfileMemberDeletionException Description copied from interface:ProfileServiceDelete profile by given sProfile- Specified by:
deleteProfilein interfaceProfileService- Throws:
SProfileDeletionException- occurs when an exception is thrown during sProfile deletionSProfileMemberDeletionException
-
deleteAllProfileMembersOfProfile
public void deleteAllProfileMembersOfProfile(SProfile profile) throws SProfileMemberDeletionException - Specified by:
deleteAllProfileMembersOfProfilein interfaceProfileService- Throws:
SProfileMemberDeletionException
-
deleteProfile
public void deleteProfile(long profileId) throws SProfileNotFoundException, SProfileDeletionException, SProfileMemberDeletionException Description copied from interface:ProfileServiceDelete profile by its id- Specified by:
deleteProfilein interfaceProfileService- Throws:
SProfileNotFoundException- occurs when the identifier does not refer to an existing sProfileSProfileDeletionException- occurs when an exception is thrown during sProfile deletionSProfileMemberDeletionException
-
addUserToProfile
public SProfileMember addUserToProfile(long profileId, long userId, String firstName, String lastName, String userName) throws SProfileMemberCreationException Description copied from interface:ProfileServiceAdd a user to exist profile- Specified by:
addUserToProfilein interfaceProfileService- Parameters:
profileId- the identifier of profileuserId- the identifier of user- Returns:
- sProfileMember
- Throws:
SProfileMemberCreationException
-
addGroupToProfile
public SProfileMember addGroupToProfile(long profileId, long groupId, String groupName, String parentPath) throws SProfileMemberCreationException Description copied from interface:ProfileServiceAdd a group to exist profile- Specified by:
addGroupToProfilein interfaceProfileService- Parameters:
profileId- the identifier of profilegroupId- the identifier of group- Returns:
- sProfileMember
- Throws:
SProfileMemberCreationException- TODO
-
addRoleToProfile
public SProfileMember addRoleToProfile(long profileId, long roleId, String roleName) throws SProfileMemberCreationException Description copied from interface:ProfileServiceAdd a role to exist profile- Specified by:
addRoleToProfilein interfaceProfileService- Parameters:
profileId- the identifier of profileroleId- the identifier of role- Returns:
- sProfileMember
- Throws:
SProfileMemberCreationException- TODO
-
addRoleAndGroupToProfile
public SProfileMember addRoleAndGroupToProfile(long profileId, long roleId, long groupId, String roleName, String groupName, String groupParentPath) throws SProfileMemberCreationException Description copied from interface:ProfileServiceAdd a role and a group to exist profile- Specified by:
addRoleAndGroupToProfilein interfaceProfileService- Parameters:
profileId- the identifier of profileroleId- the identifier of rolegroupId- the identifier of group- Returns:
- sProfileMember
- Throws:
SProfileMemberCreationException- TODO
-
deleteProfileMember
public void deleteProfileMember(long profileMemberId) throws SProfileMemberDeletionException, SProfileMemberNotFoundException Description copied from interface:ProfileServiceDelete a profile member by its id- Specified by:
deleteProfileMemberin interfaceProfileService- Throws:
SProfileMemberDeletionException- occurs when an exception is thrown during sProfileMember deletionSProfileMemberNotFoundException- occurs when the identifier does not refer to an existing sProfileMember
-
getProfileMemberWithoutDisplayName
public SProfileMember getProfileMemberWithoutDisplayName(long profileMemberId) throws SProfileMemberNotFoundException - Specified by:
getProfileMemberWithoutDisplayNamein interfaceProfileService- Returns:
- Throws:
SProfileMemberNotFoundException
-
deleteProfileMember
public void deleteProfileMember(SProfileMember profileMember) throws SProfileMemberDeletionException Description copied from interface:ProfileServiceDelete a profile member by given sProfile member- Specified by:
deleteProfileMemberin interfaceProfileService- Throws:
SProfileMemberDeletionException- occurs when an exception is thrown during sProfileMember deletion
-
getProfileMembersOfUser
public List<SProfileMember> getProfileMembersOfUser(long userId, int fromIndex, int numberOfElements, String field, OrderByType order) throws SBonitaReadException Description copied from interface:ProfileServiceGet all sProfileMembers with same user having the given value for the given int index- Specified by:
getProfileMembersOfUserin interfaceProfileService- Parameters:
userId- the identifier of userfromIndex- first result to be considered(>=0)numberOfElements- the max number of emelents to be returned (>=0)- Returns:
- sProfileMember
- Throws:
SBonitaReadException- occurs when an exception is thrown during sProfileMember creation
-
getProfileMembersOfGroup
public List<SProfileMember> getProfileMembersOfGroup(long groupId, int fromIndex, int numberOfElements, String field, OrderByType order) throws SBonitaReadException Description copied from interface:ProfileServiceGet all sProfileMembers with same group having the given value for the given int index- Specified by:
getProfileMembersOfGroupin interfaceProfileService- Parameters:
groupId- the identifier of groupfromIndex- first result to be considered(>=0)numberOfElements- the max number of elements to be returned (>=0)- Returns:
- sProfileMember
- Throws:
SBonitaReadException- occurs when an exception is thrown during sProfileMember creation
-
getProfileMembersOfRole
public List<SProfileMember> getProfileMembersOfRole(long roleId, int fromIndex, int numberOfElements, String field, OrderByType order) throws SBonitaReadException Description copied from interface:ProfileServiceGet all sProfileMembers with same group having the given value for the given int index- Specified by:
getProfileMembersOfRolein interfaceProfileService- Parameters:
roleId- the identifier of rolefromIndex- first result to be considered(>=0)numberOfElements- the max number of elements to be returned (>=0)- Returns:
- sProfileMember
- Throws:
SBonitaReadException- occurs when an exception is thrown during sProfileMember creation
-
searchProfilesOfUser
public List<SProfile> searchProfilesOfUser(long userId, int fromIndex, int numberOfElements, String field, OrderByType order) throws SBonitaReadException Description copied from interface:ProfileServiceGet all profiles of the user by userId- Specified by:
searchProfilesOfUserin interfaceProfileServicefromIndex- first result to be considered(>=0)numberOfElements- the max number of elementss to be returned (>=0)- Returns:
- A list of sProfile
- Throws:
SBonitaReadException
-
getProfilesOfUser
- Specified by:
getProfilesOfUserin interfaceProfileService- Throws:
SBonitaReadException
-
getProfileMembers
public List<SProfileMember> getProfileMembers(long profileId, QueryOptions queryOptions) throws SProfileMemberNotFoundException Description copied from interface:ProfileServiceGet a list of profileMembers by the given profileId- Specified by:
getProfileMembersin interfaceProfileService- Returns:
- a list of profileMembers
- Throws:
SProfileMemberNotFoundException
-
searchProfileMembers
public List<SProfileMember> searchProfileMembers(String querySuffix, QueryOptions queryOptions) throws SBonitaReadException Description copied from interface:ProfileServiceGet all sProfileMember by profileId and queryOptions- Specified by:
searchProfileMembersin interfaceProfileService- Parameters:
querySuffix- the suffix of query string- Returns:
- all sProfileMember by profileId and queryOptions
- Throws:
SBonitaReadException
-
getNumberOfProfileMembers
public long getNumberOfProfileMembers(String querySuffix, QueryOptions countOptions) throws SBonitaReadException Description copied from interface:ProfileServiceGet the total number of profile members- Specified by:
getNumberOfProfileMembersin interfaceProfileService- Parameters:
querySuffix- the suffix of query stringcountOptions- The criterion used to search profileMembers- Returns:
- the total number of profile members
- Throws:
SBonitaReadException
-
getProfileMembers
Description copied from interface:ProfileServiceGet the total number of sProfileMember by a list contains profileIds- Specified by:
getProfileMembersin interfaceProfileService- Returns:
- A list of <profileId, NumberOfMemberForThatProfile>
- Throws:
SBonitaReadException
-
deleteAllProfileMembers
Description copied from interface:ProfileServiceDelete all profile members for the connected tenant- Specified by:
deleteAllProfileMembersin interfaceProfileService- Throws:
SProfileMemberDeletionException
-
getNumberOfProfiles
- Specified by:
getNumberOfProfilesin interfaceProfileService- Returns:
- Throws:
SBonitaReadException
-
searchProfiles
- Specified by:
searchProfilesin interfaceProfileService- Returns:
- Throws:
SBonitaReadException
-
updateProfileMetaData
Description copied from interface:ProfileServiceupdates profile metaData fields lastUpdateDate and lastUpdatedBy for a given profile- Specified by:
updateProfileMetaDatain interfaceProfileService- Throws:
SProfileUpdateException- when given profileId is not found
-