Class UserProfilesSearchCriteriaBuilder
- java.lang.Object
-
- org.silverpeas.core.webapi.profile.UserProfilesSearchCriteriaBuilder
-
public class UserProfilesSearchCriteriaBuilder extends Object
A builder of search criteria on user profiles.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserProfilesSearchCriteriaBuilder
aSearchCriteria()
Constructs a new builder of criteria for searching user profiles.UserDetailsSearchCriteria
build()
Builds the criteria according to the build properties that have been set.UserProfilesSearchCriteriaBuilder
includeAlsoRemovedUsers()
Includes also among the users to find those they are removed.UserProfilesSearchCriteriaBuilder
withAccessLevels(UserAccessLevel... accessLevels)
The users to find must have at least one of the specified access levelsUserProfilesSearchCriteriaBuilder
withComponentInstanceId(String instanceId)
The users to find have an access right on the specified component instance.UserProfilesSearchCriteriaBuilder
withDomainIds(String... domainIds)
The users to find have to be at least in one of the specified user directory domains.UserProfilesSearchCriteriaBuilder
withGroupIds(String... groupIds)
The users to find have to be at least in one of the specified user groups.UserProfilesSearchCriteriaBuilder
withName(String name)
The users to find should satisfy the specified name.UserProfilesSearchCriteriaBuilder
withPaginationPage(PaginationPage page)
The search results are paginated and only the specified page should be returned from the search results.UserProfilesSearchCriteriaBuilder
withResourceId(String resourceId)
The users to find have an access right on the specified resource.UserProfilesSearchCriteriaBuilder
withRoles(String[] roleIds, boolean matchingAllRoles)
The users to find have to play at least one of the specified roles.UserProfilesSearchCriteriaBuilder
withUserIds(String... userIds)
The users to find are those with the specified unique identifiers of users.UserProfilesSearchCriteriaBuilder
withUserSpecificIds(String... userSpecificIds)
The users to find are those with the specified domain specific identifiers of users.UserProfilesSearchCriteriaBuilder
withUserStatesToExclude(UserState... userStates)
Excludes from the search scope the users with the specified states.
-
-
-
Method Detail
-
aSearchCriteria
public static UserProfilesSearchCriteriaBuilder aSearchCriteria()
Constructs a new builder of criteria for searching user profiles.- Returns:
- a
UserProfilesSearchCriteriaBuilder
instance.
-
withName
public UserProfilesSearchCriteriaBuilder withName(String name)
The users to find should satisfy the specified name. The wildcard character '*' is supported to mean any characters.- Parameters:
name
- the name of a user. It can be the firstname or the lastname of the users to search.- Returns:
- itself.
-
withComponentInstanceId
public UserProfilesSearchCriteriaBuilder withComponentInstanceId(String instanceId)
The users to find have an access right on the specified component instance.- Parameters:
instanceId
- the unique identifier of a component instance.- Returns:
-
withResourceId
public UserProfilesSearchCriteriaBuilder withResourceId(String resourceId)
The users to find have an access right on the specified resource. The component instance should be set with the methodwithComponentInstanceId(String)
in order to refer exactly the resource.- Parameters:
resourceId
- the unique identifier of a resource in a given component instance.- Returns:
- itself.
-
withRoles
public UserProfilesSearchCriteriaBuilder withRoles(String[] roleIds, boolean matchingAllRoles)
The users to find have to play at least one of the specified roles.- Parameters:
roleIds
- one or more identifiers of roles.matchingAllRoles
- one or more identifiers of roles.- Returns:
- itself.
-
withGroupIds
public UserProfilesSearchCriteriaBuilder withGroupIds(String... groupIds)
The users to find have to be at least in one of the specified user groups.- Parameters:
groupIds
- one or more unique identifiers of user groups.- Returns:
- itself.
-
withDomainIds
public UserProfilesSearchCriteriaBuilder withDomainIds(String... domainIds)
The users to find have to be at least in one of the specified user directory domains.- Parameters:
domainIds
- one or more unique identifiers of domains.- Returns:
- itself.
-
withAccessLevels
public UserProfilesSearchCriteriaBuilder withAccessLevels(UserAccessLevel... accessLevels)
The users to find must have at least one of the specified access levels- Parameters:
accessLevels
- one or more access levels.- Returns:
- itself.
-
withUserIds
public UserProfilesSearchCriteriaBuilder withUserIds(String... userIds)
The users to find are those with the specified unique identifiers of users.- Parameters:
userIds
- one ore more unique identifiers of users;- Returns:
- itself.
-
withUserSpecificIds
public UserProfilesSearchCriteriaBuilder withUserSpecificIds(String... userSpecificIds)
The users to find are those with the specified domain specific identifiers of users.- Parameters:
userSpecificIds
- one ore more domain specific identifiers of users;- Returns:
- itself.
-
withUserStatesToExclude
public UserProfilesSearchCriteriaBuilder withUserStatesToExclude(UserState... userStates)
Excludes from the search scope the users with the specified states. The deleted users are always excluded as to be expected. Be cautious, by default the removed users are here also excluded but they can be included explicitly by invoking the methodincludeAlsoRemovedUsers()
.- Parameters:
userStates
- the states the users to find must not have.- Returns:
- itself.
-
includeAlsoRemovedUsers
public UserProfilesSearchCriteriaBuilder includeAlsoRemovedUsers()
Includes also among the users to find those they are removed.- Returns:
- itself.
-
withPaginationPage
public UserProfilesSearchCriteriaBuilder withPaginationPage(PaginationPage page)
The search results are paginated and only the specified page should be returned from the search results.- Parameters:
page
- the page corresponding to a paginated search results.- Returns:
- itself.
-
build
public UserDetailsSearchCriteria build()
Builds the criteria according to the build properties that have been set.- Returns:
- a
UserDetailsSearchCriteria
instance.
-
-