Interface PersonService
- All Known Implementing Classes:
PersonServiceImpl
,ReadOnlyPersonService
public interface PersonService
Provides CRUD operation on Persons.
- Since:
- 5.7
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A finder for locating persons.static interface
A searcher for finding people based on a search term.static interface
only here so that the remote person service can proxy it.static interface
Provides methods for validating the CRUD methods. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMembership
(String username, String groupName) Add the givenUser
identified by username to the givenGroup
identified by groupName.void
changeMyPassword
(PasswordChangeDetails passwordChangeDetails) Change the password of the current user.void
changeUserPassword
(String userName, String newPass) Change the password of the given user.create
(UserDetailsForCreation userDetailsForCreation) Create a new active userDelete the given person.void
Disable the givenUser
identified by username.void
Enable the givenUser
identified by username.fetchActiveUsers
(PageRequest limitedRequest) Fetch a page of active users (users which count towards the license limit).Create a person finder to locate persons Restrictions can be applied to the finder using the appropriate withFoo() methodgetCurrentUser
(Expansion... expansions) Get the currently logged in uservoid
removeMembership
(String username, String groupName) Remove the givenUser
identified by username from the givenGroup
identified by groupName.search()
Create a person searcher to find people matching search criteria For given search category and/or criteria, return all People matching the supplied criteria.void
update
(UserDetailsForUpdate userDetailsForUpdate) Update the current user with the supplied details (full name or email).void
update
(String username, UserDetailsForUpdate userDetailsForUpdate) Update the given user with the supplied details (full name or email).Get the validator of the Person Service.
-
Method Details
-
create
Create a new active user- Parameters:
userDetailsForCreation
- User Details- Returns:
- UserKey User Key
- Since:
- 8.4.0
-
getCurrentUser
Get the currently logged in user- Since:
- 5.9
-
find
Create a person finder to locate persons Restrictions can be applied to the finder using the appropriate withFoo() methodFor example:
personService.find() .withKey("DEV") .fetchOne()
- Returns:
- a new PersonFinder
-
fetchActiveUsers
Fetch a page of active users (users which count towards the license limit). The page is ordered by last login date, ascending with people who never logged in first. The results will exclude users that are: - anonymous, - deactivated, - externally deleted, - shadowed - unlicensed This feature relies on search index and might not be accurate when site reindex is in progress.- Parameters:
limitedRequest
- The page request- Returns:
- a page of active users
- Since:
- 9.3.0
-
disable
Disable the givenUser
identified by username. This method is idempotent i.e. if the user is already disabled then no action will be taken.- Parameters:
username
- The username identifying the given user.- Since:
- 8.2.0
-
enable
Enable the givenUser
identified by username. This method is idempotent i.e. if the user is already enabled then no action will be taken.- Parameters:
username
- The username identifying the given user.- Since:
- 8.2.0
-
update
Update the current user with the supplied details (full name or email).- Parameters:
userDetailsForUpdate
- User Details- Since:
- 9.3.0
-
update
Update the given user with the supplied details (full name or email).- Parameters:
username
- The username identifying the given user.userDetailsForUpdate
- User Details- Since:
- 9.3.0
-
delete
Delete the given person.The deletion happens asynchronously so a LongTaskSubmission is returned, that can be used to track progress.
- Parameters:
personToDelete
- the person to delete- Returns:
- a LongTaskSubmission describing the user deletion operation
- Since:
- 6.13.0
-
search
PersonService.PersonSearcher search()Create a person searcher to find people matching search criteria For given search category and/or criteria, return all People matching the supplied criteria.For example:
personService.search() .forUnsyncedUsers("joe") .fetchMany(..)
- Returns:
- a new PersonSearcher
-
addMembership
Add the givenUser
identified by username to the givenGroup
identified by groupName. This method is idempotent i.e. if the membership already exists then no action will be taken.- Parameters:
username
- The username identifying the given user.groupName
- The group name identifying the given group.- Since:
- 8.2.0
-
removeMembership
Remove the givenUser
identified by username from the givenGroup
identified by groupName. This method is idempotent i.e. if the membership is not present then no action will be taken.- Parameters:
username
- The username identifying the given user.groupName
- The group name identifying the given group.- Since:
- 8.2.0
-
changeUserPassword
Change the password of the given user.- Parameters:
userName
- The userName identifying the given user.newPass
- New Password- Since:
- 8.4.0
-
changeMyPassword
Change the password of the current user.- Parameters:
passwordChangeDetails
- password change details- Since:
- 8.4.0
-
validator
PersonService.Validator validator()Get the validator of the Person Service.
-