com.stratelia.webactiv.beans.admin.dao
Class UserSearchCriteriaForDAO

java.lang.Object
  extended by com.stratelia.webactiv.beans.admin.dao.UserSearchCriteriaForDAO
All Implemented Interfaces:
SearchCriteria

public class UserSearchCriteriaForDAO
extends Object
implements SearchCriteria

An implementation of the search criteria for user details stored in a SQL data source and used by the DAOs. By default, the criterion are linked together by a conjonction operator. Nevertheless, you can explicitly specify it by using the UserSearchCriteriaForDAO#and() method.


Field Summary
 
Fields inherited from interface com.stratelia.webactiv.beans.admin.SearchCriteria
ANY
 
Method Summary
 UserSearchCriteriaForDAO and()
          Appends a criteria conjonction.
 PaginationPage getPagination()
          Gets the criterion on the pagination page to fetch.
 boolean isEmpty()
          Is this criteria empty?
 boolean isPaginationSet()
          Is the pagination criterion set?
static UserSearchCriteriaForDAO newCriteria()
           
 UserSearchCriteriaForDAO onAccessLevels(UserAccessLevel... accessLevels)
          Appends a criterion on the user access level for which the search must be constrained to.
 SearchCriteria onComponentInstanceId(String instanceId)
          Appends a criterion on the component instance for which the search must be constrained to.
 UserSearchCriteriaForDAO onDomainId(String domainId)
          Appends a criterion on the user domain for which the search must be constrained to.
 UserSearchCriteriaForDAO onGroupIds(String... groupIds)
          Appends a criterion on the user groups for which the search must be constrained to.
 UserSearchCriteriaForDAO onName(String name)
          Appends a criterion on the resources name for which the search must be constrained to.
 SearchCriteria onPagination(PaginationPage page)
          Appends a criteria on a resources pagination.
 SearchCriteria onResourceId(String resourceId)
          Appends a criterion on a given component instance's resource for which the search must be constrained to.
 SearchCriteria onRoleNames(String... roleIds)
          Appends a criterion on the user roles for which the search must be constrained to.
 SearchCriteria onUserIds(String... userIds)
          Appends a criteria on the user profiles for which the search must be constrained to.
 UserSearchCriteriaForDAO onUserStatesToExclude(UserState... userStates)
          Appends a criteria on the user states that must exclude users from the result.
 UserSearchCriteriaForDAO or()
          Appends a criteria disjonction.
 String toSQLQuery(String fields)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newCriteria

public static UserSearchCriteriaForDAO newCriteria()

and

public UserSearchCriteriaForDAO and()
Description copied from interface: SearchCriteria
Appends a criteria conjonction.

Specified by:
and in interface SearchCriteria
Returns:
the criteria enriched with a conjonction. The conjonction will be applied with the last added criterion and the next one.

or

public UserSearchCriteriaForDAO or()
Description copied from interface: SearchCriteria
Appends a criteria disjonction.

Specified by:
or in interface SearchCriteria
Returns:
the criteria enriched with a disjonction. The disjonction will be applied with the last added criterion and the next one.

onName

public UserSearchCriteriaForDAO 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.

Specified by:
onName in interface SearchCriteria
Parameters:
name - a pattern on the name the resources to fetch must have.
Returns:
the criteria enriched with a criterion on the user name.

onGroupIds

public UserSearchCriteriaForDAO 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.

Specified by:
onGroupIds in interface SearchCriteria
Parameters:
groupIds - the unique identifiers of the groups.
Returns:
the criteria enriched with a criterion on the user groups.

onAccessLevels

public UserSearchCriteriaForDAO 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.

Specified by:
onAccessLevels in interface SearchCriteria
Parameters:
accessLevels - the access levels aimed.
Returns:
the criteria enriched with a criterion on the user access level.

onDomainId

public UserSearchCriteriaForDAO onDomainId(String domainId)
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.

Specified by:
onDomainId in interface SearchCriteria
Parameters:
domainId - the unique identifier of the user domain.
Returns:
the criteria enriched with a criterion on the user domain.

onUserIds

public SearchCriteria 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.

Specified by:
onUserIds in interface SearchCriteria
Parameters:
userIds - the user identifiers.
Returns:
the criteria enriched with a criterion on the user identifiers.

onUserStatesToExclude

public UserSearchCriteriaForDAO onUserStatesToExclude(UserState... userStates)
Description copied from interface: SearchCriteria
Appends a criteria on the user states that must exclude users from the result. The properties of the resources to fetch have to satisfy this criterion.

Specified by:
onUserStatesToExclude in interface SearchCriteria
Parameters:
userStates - the user states that exclude users from the result.
Returns:
the criteria enriched with a criterion on the user states.

toSQLQuery

public String toSQLQuery(String fields)

toString

public String toString()
Overrides:
toString in class Object

isEmpty

public boolean isEmpty()
Description copied from interface: SearchCriteria
Is this criteria empty?

Specified by:
isEmpty in interface SearchCriteria
Returns:
true if this criteria has no criterion, false otherwise.

onRoleNames

public SearchCriteria 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.

Specified by:
onRoleNames in interface SearchCriteria
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.

onComponentInstanceId

public SearchCriteria 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.

Specified by:
onComponentInstanceId in interface SearchCriteria
Parameters:
instanceId - the unique identifier of the component instance.
Returns:
the criteria enriched with a criterion on the component instance.

onResourceId

public SearchCriteria 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.

Specified by:
onResourceId in interface SearchCriteria
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.

onPagination

public SearchCriteria onPagination(PaginationPage page)
Description copied from interface: SearchCriteria
Appends a criteria 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.

Specified by:
onPagination in interface SearchCriteria
Parameters:
page - the page of resources to fetch.
Returns:
the criteria enriched with a criterion on the resources pagination.

getPagination

public PaginationPage getPagination()
Gets the criterion on the pagination page to fetch.

Returns:
a pagination page.

isPaginationSet

public boolean isPaginationSet()
Is the pagination criterion set?

Returns:
true if a criterion on the pagination about user profiles is set, false otherwise.


Copyright © 2016 Silverpeas. All Rights Reserved.