Class UserDetailsSearchCriteria
- java.lang.Object
-
- org.silverpeas.core.admin.user.model.AbstractSearchCriteria
-
- org.silverpeas.core.admin.user.model.UserDetailsSearchCriteria
-
- All Implemented Interfaces:
SearchCriteria
public class UserDetailsSearchCriteria extends AbstractSearchCriteria
A conjunction of criteria in the search of user details.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.admin.user.model.SearchCriteria
SearchCriteria.Constants
-
-
Field Summary
Fields Modifier and Type Field Description static String[]
ANY_GROUPS
-
Fields inherited from class org.silverpeas.core.admin.user.model.AbstractSearchCriteria
criteria
-
-
Constructor Summary
Constructors Constructor Description UserDetailsSearchCriteria()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
UserAccessLevel[]
getCriterionOnAccessLevels()
Gets access level criterion.String
getCriterionOnComponentInstanceId()
Gets the component instance the user or the group must belongs to.String[]
getCriterionOnDomainIds()
Gets the domain identifier.String
getCriterionOnFirstName()
Gets the pattern on the name the user first name must satisfy.String[]
getCriterionOnGroupIds()
Gets the disjunction on the group identifiers.Map<String,Set<String>>
getCriterionOnGroupsByRoles()
Gets the mapping of groups playing the roles given by the criterion on the role names by role name.String
getCriterionOnLastName()
Gets the pattern on the name the user last name must satisfy.String
getCriterionOnName()
Gets the pattern on the name the group or the user name must satisfy.PaginationPage
getCriterionOnPagination()
Gets the pagination page into which the groups to return has to be part.String
getCriterionOnResourceId()
Gets the resource in the component instance the user or the group must have privilege to access.String[]
getCriterionOnUserIds()
Gets the disjunction on the user identifiers.String[]
getCriterionOnUserSpecificIds()
Gets the disjunction on the user specific identifiers.int
hashCode()
UserDetailsSearchCriteria
includeRemovedUsers()
Forces to take into account removed users.boolean
isCriterionOnAccessLevelsSet()
boolean
isCriterionOnAnyGroupSet()
boolean
isCriterionOnComponentInstanceIdSet()
boolean
isCriterionOnDomainIdSet()
boolean
isCriterionOnFirstNameSet()
boolean
isCriterionOnGroupIdsSet()
boolean
isCriterionOnGroupsByRolesSet()
boolean
isCriterionOnLastNameSet()
boolean
isCriterionOnNameSet()
boolean
isCriterionOnPaginationSet()
boolean
isCriterionOnResourceIdSet()
boolean
isCriterionOnUserIdsSet()
boolean
isCriterionOnUserSpecificIdsSet()
boolean
isEmpty()
Is this criteria empty?UserDetailsSearchCriteria
onAccessLevels(UserAccessLevel... accessLevels)
Appends a criterion on the user access level for which the search must be constrained to.UserDetailsSearchCriteria
onComponentInstanceId(String instanceId)
Appends a criterion on the component instance for which the search must be constrained to.UserDetailsSearchCriteria
onDomainIds(String... domainIds)
Appends a criterion on the user domain for which the search must be constrained to.SearchCriteria
onFirstName(String firstName)
Appends a criterion on the first name of the users for which the search must be constrained to.UserDetailsSearchCriteria
onGroupIds(String... groupIds)
Appends a criterion on the user groups for which the search must be constrained to.SearchCriteria
onLastName(String lastName)
Appends a criterion on the last name of the users for which the search must be constrained to.UserDetailsSearchCriteria
onName(String name)
Appends a criterion on the resources name for which the search must be constrained to.UserDetailsSearchCriteria
onPagination(PaginationPage page)
Appends a criterion on a resources pagination.UserDetailsSearchCriteria
onResourceId(String resourceId)
Appends a criterion on a given component instance's resource for which the search must be constrained to.UserDetailsSearchCriteria
onRoleNames(String... roleIds)
Appends a criterion on the user roles for which the search must be constrained to.UserDetailsSearchCriteria
onUserIds(String... userIds)
Appends a criteria on the user profiles for which the search must be constrained to.SearchCriteria
onUserSpecificIds(String... userSpecificIds)
Appends a criterion on the user profiles for which the search must be constrained to.UserDetailsSearchCriteria
onUserStatesToExclude(UserState... userStates)
Appends a criterion on the user states to be excluded in the search of users.UserDetailsSearchCriteria
withGroupsByRoles(Map<String,Set<String>> groupIdsByRoles)
The users to search must be in specified groups playing the roles that are defined by the criterion on the role names.-
Methods inherited from class org.silverpeas.core.admin.user.model.AbstractSearchCriteria
getCriterionOnRoleNames, getCriterionOnUserStatesToExclude, isCriterionOnRoleNamesSet, isCriterionOnUserStatesToExcludeSet, matchingAllRoleNames, mustIncludeRemovedUsers, mustMatchAllRoles
-
-
-
-
Field Detail
-
ANY_GROUPS
public static final String[] ANY_GROUPS
-
-
Method Detail
-
onName
public UserDetailsSearchCriteria onName(String name)
Description copied from interface:SearchCriteria
Appends a criterion on the resources name for which the search must be constrained to. The name of the resources to fetch have to satisfy this criterion.- Parameters:
name
- a pattern on the name the resources to fetch must have.- Returns:
- the criteria enriched with a criterion on the resource name.
-
onFirstName
public SearchCriteria onFirstName(String firstName)
Appends a criterion on the first name of the users for which the search must be constrained to. The users to fetch have to satisfy this criterion.- Parameters:
firstName
- a pattern on the first name of the users to fetch.- Returns:
- the criteria enriched with a criterion on the user first name.
-
onLastName
public SearchCriteria onLastName(String lastName)
Appends a criterion on the last name of the users for which the search must be constrained to. The users to fetch have to satisfy this criterion.- Parameters:
lastName
- a pattern on the last name of the users to fetch.- Returns:
- the criteria enriched with a criterion on the user last name.
-
onComponentInstanceId
public UserDetailsSearchCriteria onComponentInstanceId(String instanceId)
Description copied from interface:SearchCriteria
Appends a criterion on the component instance for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.- Parameters:
instanceId
- the unique identifier of the component instance.- Returns:
- the criteria enriched with a criterion on the component instance.
-
onRoleNames
public UserDetailsSearchCriteria onRoleNames(String... roleIds)
Description copied from interface:SearchCriteria
Appends a criterion on the user roles for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion. This criterion replaces any previous criterion on the user roles.This criterion is useless without any criterion on either the component instance or on both the component instance and the resource for which the roles are defined.
- Specified by:
onRoleNames
in interfaceSearchCriteria
- Overrides:
onRoleNames
in classAbstractSearchCriteria
- Parameters:
roleIds
- the name of the user roles on which the criterion has to be built.- Returns:
- the criteria enriched with a criterion on the role names.
-
withGroupsByRoles
public UserDetailsSearchCriteria withGroupsByRoles(Map<String,Set<String>> groupIdsByRoles)
The users to search must be in specified groups playing the roles that are defined by the criterion on the role names. If this criterion isn't set, then only the users playing directly the roles will be searched and not those that are part of a group playing the roles. It is strongly recommended to specify the groups along with their own children groups.- Parameters:
groupIdsByRoles
- map containing one or more unique identifiers of groups playing the role that is specified in the criterion on the role names by role name.- Returns:
- itself.
-
onGroupIds
public UserDetailsSearchCriteria onGroupIds(String... groupIds)
Description copied from interface:SearchCriteria
Appends a criterion on the user groups for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion. This criterion replaces any previous criterion on the user groups.- Parameters:
groupIds
- the unique identifiers of the groups.- Returns:
- the criteria enriched with a criterion on the user groups.
-
onDomainIds
public UserDetailsSearchCriteria onDomainIds(String... domainIds)
Description copied from interface:SearchCriteria
Appends a criterion on the user domain for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion. This criterion replaces any previous criterion on the user domains.- Parameters:
domainIds
- the unique identifier of the user domain.- Returns:
- the criteria enriched with a criterion on the user domain.
-
onAccessLevels
public UserDetailsSearchCriteria onAccessLevels(UserAccessLevel... accessLevels)
Description copied from interface:SearchCriteria
Appends a criterion on the user access level for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion. This criterion replaces any previous criterion on the user access levels.- Parameters:
accessLevels
- the access levels aimed.- Returns:
- the criteria enriched with a criterion on the user access level.
-
onUserStatesToExclude
public UserDetailsSearchCriteria onUserStatesToExclude(UserState... userStates)
Description copied from interface:SearchCriteria
Appends a criterion on the user states to be excluded in the search of users. The properties of the resources to fetch have to satisfy this criterion. By default, the deleted users are always excluded but not the removed users. Latter have to be explicitly excluded. This criterion replaces any previous criterion on the user states.- Specified by:
onUserStatesToExclude
in interfaceSearchCriteria
- Overrides:
onUserStatesToExclude
in classAbstractSearchCriteria
- Parameters:
userStates
- the user states that exclude users from the result.- Returns:
- the criteria enriched with a criterion on the user states.
-
includeRemovedUsers
public UserDetailsSearchCriteria includeRemovedUsers()
Description copied from interface:SearchCriteria
Forces to take into account removed users.This method has priority over the
SearchCriteria.onUserStatesToExclude(UserState...)
one. It means that ifSearchCriteria.includeRemovedUsers()
is called thenUserState.REMOVED
state is removed from result ofSearchCriteria.onUserStatesToExclude(UserState...)
method call.- Specified by:
includeRemovedUsers
in interfaceSearchCriteria
- Overrides:
includeRemovedUsers
in classAbstractSearchCriteria
- Returns:
- the criteria enriched with a criterion on the user states.
-
onResourceId
public UserDetailsSearchCriteria onResourceId(String resourceId)
Description copied from interface:SearchCriteria
Appends a criterion on a given component instance's resource for which the search must be constrained to. This criterion has a meaning only when coupled with the criterion on the component instance. The properties of the resources to fetch have to satisfy both the criterion on the component instance and this one.- Parameters:
resourceId
- the unique identifier of the resource managed in the component instance. As each resource is particular to a given Silverpeas component, the unique identifier is made up of the resource type and of the resource identifier.- Returns:
- the criteria enriched with a criterion on the resource in the component instance.
-
onUserIds
public UserDetailsSearchCriteria onUserIds(String... userIds)
Description copied from interface:SearchCriteria
Appends a criteria on the user profiles for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion. This criterion replaces any previous criterion on the user profiles.- Parameters:
userIds
- the user identifiers.- Returns:
- the criteria enriched with a criterion on the user identifiers.
-
onUserSpecificIds
public SearchCriteria onUserSpecificIds(String... userSpecificIds)
Description copied from interface:SearchCriteria
Appends a criterion on the user profiles for which the search must be constrained to. The properties of the resources to fetch have to satisfy this criterion.One, and only one, domain id will be mandatory!
This criterion replaces any previous criterion on the user profiles.- Parameters:
userSpecificIds
- the user specific identifiers.- Returns:
- the criteria enriched with a criterion on the user identifiers.
-
onPagination
public UserDetailsSearchCriteria onPagination(PaginationPage page)
Description copied from interface:SearchCriteria
Appends a criterion on a resources pagination. The pagination is a mechanism to distribute the resources to fetch in one or more pages of same size and to navigate among theses different available pages. Yet, this criterion is about the page of resources to fetch.- Parameters:
page
- the page of resources to fetch.- Returns:
- the criteria enriched with a criterion on the resources pagination.
-
isCriterionOnGroupsByRolesSet
public boolean isCriterionOnGroupsByRolesSet()
-
isCriterionOnResourceIdSet
public boolean isCriterionOnResourceIdSet()
-
isCriterionOnComponentInstanceIdSet
public boolean isCriterionOnComponentInstanceIdSet()
-
isCriterionOnUserIdsSet
public boolean isCriterionOnUserIdsSet()
-
isCriterionOnUserSpecificIdsSet
public boolean isCriterionOnUserSpecificIdsSet()
-
isCriterionOnGroupIdsSet
public boolean isCriterionOnGroupIdsSet()
-
isCriterionOnAnyGroupSet
public boolean isCriterionOnAnyGroupSet()
-
isCriterionOnDomainIdSet
public boolean isCriterionOnDomainIdSet()
-
isCriterionOnAccessLevelsSet
public boolean isCriterionOnAccessLevelsSet()
-
isCriterionOnNameSet
public boolean isCriterionOnNameSet()
-
isCriterionOnFirstNameSet
public boolean isCriterionOnFirstNameSet()
-
isCriterionOnLastNameSet
public boolean isCriterionOnLastNameSet()
-
isCriterionOnPaginationSet
public boolean isCriterionOnPaginationSet()
-
getCriterionOnGroupsByRoles
public Map<String,Set<String>> getCriterionOnGroupsByRoles()
Gets the mapping of groups playing the roles given by the criterion on the role names by role name.- Returns:
- a map with set of group ids by role name.
-
getCriterionOnResourceId
public String getCriterionOnResourceId()
Gets the resource in the component instance the user or the group must have privilege to access.- Returns:
- the unique identifier of the resource in a component instance.
-
getCriterionOnComponentInstanceId
public String getCriterionOnComponentInstanceId()
Gets the component instance the user or the group must belongs to.- Returns:
- the unique identifier of the component instance.
-
getCriterionOnUserIds
public String[] getCriterionOnUserIds()
Gets the disjunction on the user identifiers.- Returns:
- an array with each element of the disjunction.
-
getCriterionOnUserSpecificIds
public String[] getCriterionOnUserSpecificIds()
Gets the disjunction on the user specific identifiers.- Returns:
- an array with each element of the disjunction.
-
getCriterionOnGroupIds
public String[] getCriterionOnGroupIds()
Gets the disjunction on the group identifiers.- Returns:
- an array with each element of the disjunction.
-
getCriterionOnDomainIds
public String[] getCriterionOnDomainIds()
Gets the domain identifier.- Returns:
- the domain identifier.
-
getCriterionOnAccessLevels
public UserAccessLevel[] getCriterionOnAccessLevels()
Gets access level criterion.- Returns:
- the access level criterion.
-
getCriterionOnName
public String getCriterionOnName()
Gets the pattern on the name the group or the user name must satisfy.- Returns:
- a pattern on the user or group name.
-
getCriterionOnFirstName
public String getCriterionOnFirstName()
Gets the pattern on the name the user first name must satisfy.- Returns:
- a pattern on the user first name.
-
getCriterionOnLastName
public String getCriterionOnLastName()
Gets the pattern on the name the user last name must satisfy.- Returns:
- a pattern on the user last name.
-
getCriterionOnPagination
public PaginationPage getCriterionOnPagination()
Gets the pagination page into which the groups to return has to be part.- Returns:
- the page in a pagination mechanism to fetch.
-
isEmpty
public boolean isEmpty()
Description copied from interface:SearchCriteria
Is this criteria empty?- Returns:
- true if this object has no any criteria, false otherwise.
-
-