public class ClientSearchCriteria
extends java.lang.Object
A user filter is added using the method byUser
. A user filter consists of a security check name and a user ID.
The filter searches for clients associated with the given user ID, authenticated by the given security check
An application filter is added using the method byApplication
. It searches for clients of a given application ID and / or a specific
application version.
Attribute filters search for public attributes in the client registration data. Attribute filters are added using the method byAttribute
.
An attribute filter consists of an attribute name and value pair, and it searches for clients with a matching attriute.
byUser
, byApplication
and byAttribute
. The example below
constructs a search criteria that combines all three types of filters.
ClientSearchCriteria criteria = new ClientSearchCriteria()
.byUser("UserLogin", userName)
.byApplication("com.ibm.myApp", "1.0")
.byAttribute(attributeName, attributeValue)
.maxLength(10);
A serach criteria has a limit on the number of clients that can be returned in the search results. The default number is 500, and it can be
changed using the method maxLength
.Constructor and Description |
---|
ClientSearchCriteria() |
Modifier and Type | Method and Description |
---|---|
ClientSearchCriteria |
byApplication(java.lang.String appId,
java.lang.String appVersion)
Adds an application filter to the search criteria.
|
ClientSearchCriteria |
byAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute filter to the search criteria.
|
ClientSearchCriteria |
byUser(java.lang.String securityCheckName,
java.lang.String userId)
Adds a user ID filter to the search criteria.
|
java.lang.String |
getAppId()
Gets the application ID defined in the application filter.
|
java.lang.String |
getAppVersion()
Gets the application version defined in the application filter.
|
java.util.Map |
getAttributes()
Gets the attribute filters (attribute name and value pairs) included in this search criteria.
|
int |
getMaxLength()
Gets the max number of clients to be returned in the serach results.
|
java.lang.String |
getSecurityCheckName()
Gets the name of the security check defined in the user filter.
|
java.lang.String |
getUserId()
Gets the user ID search string defined in the user filter.
|
ClientSearchCriteria |
maxLength(int maxLength)
Sets the maximum number of clients to be returned in the search results.
|
public ClientSearchCriteria byUser(java.lang.String securityCheckName, java.lang.String userId)
securityCheckName
- the security check that authenticated the user, not nulluserId
- the user ID search string, not nullpublic ClientSearchCriteria byApplication(java.lang.String appId, java.lang.String appVersion)
appId
- application ID. If the value is null, the filter searches for all clients with the specified version, regardless of their application IDappVersion
- application version, null means all versions of the given application IDpublic ClientSearchCriteria byAttribute(java.lang.String name, java.lang.String value)
name
- public attribute name, not nullvalue
- attribute value, not nullpublic ClientSearchCriteria maxLength(int maxLength)
maxLength
- maximum result lengthpublic java.lang.String getSecurityCheckName()
public java.lang.String getUserId()
public java.lang.String getAppId()
public java.lang.String getAppVersion()
public java.util.Map getAttributes()
public int getMaxLength()
© Copyright IBM Corp. 2006, 2015. All Rights Reserved.