if (location.href.indexOf('is-external=true') == -1) { parent.document.; } //-->
allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //-->
com.ibm.mfp.server.security.external.resource
Class ClientSearchCriteria
- java.lang.Object
- com.ibm.mfp.server.security.external.resource.ClientSearchCriteria
public class ClientSearchCriteria extends java.lang.Object
A search criteria for finding mobile clients registration data. A search criteria is a combination of filters of the following three types:
A search criteria can include at most one user filter, at most one application filter and zero or more attribute filters.
- Filter by user ID
- Filter by application
- Filter by a public attribute
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 checkAn 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. Filters can be added to a search criteria by chaining calls tobyUser,byApplication
andbyAttribute
. 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 methodmaxLength.
Constructor Summary
Constructors Constructor and Description ClientSearchCriteria()
Method Summary
Methods 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.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail
byUser
public ClientSearchCriteria byUser(java.lang.String securityCheckName, java.lang.String userId)
Adds a user ID filter to the search criteria. If the method is called more than once, only the last call applies (because a search criteria can have at most one user filter).
- Parameters:
securityCheckName - the security check that authenticated the user, not nulluserId
- the user ID search string, not null- Returns:
- this search criteria instance
byApplication
public ClientSearchCriteria byApplication(java.lang.String appId, java.lang.String appVersion)
Adds an application filter to the search criteria. An application filter can search by both the application ID and the application version, or by one of these parameters.
If the method is called more than once, only the last call applies (because a search criteria can have at most one application filter).
- Parameters:
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 ID- Returns:
- this search criteria instance
byAttribute
public ClientSearchCriteria byAttribute(java.lang.String name, java.lang.String value)
Adds an attribute filter to the search criteria.
Can be called multiple times to add multiple attribute filters.
- Parameters:
name - public attribute name, not nullvalue
- attribute value, not null- Returns:
- this search criteria instance
maxLength
public ClientSearchCriteria maxLength(int maxLength)
Sets the maximum number of clients to be returned in the search results. The default is 500.
- Parameters:
maxLength - maximum result length- Returns:
- this search criteria instance
getSecurityCheckName
public java.lang.String getSecurityCheckName()
Gets the name of the security check defined in the user filter. Returns null if the search criteria does not include a user filter.
- Returns:
- the name of the security check defined in the user filter; null if the search criteria does not include a user filter
getUserId
public java.lang.String getUserId()
Gets the user ID search string defined in the user filter. Returns null if the search criteria does not include a user filter.
- Returns:
- the user ID search string; null if the search criteria does not include a user filter
getAppId
public java.lang.String getAppId()
Gets the application ID defined in the application filter. Returns null if the search criteria does not include an application filter, or the filter was added with a null application ID.
- Returns:
- the application ID; null if the search criteria does not include an application filter, or the filter was added with a null application ID
getAppVersion
public java.lang.String getAppVersion()
Gets the application version defined in the application filter.
Returns null if the search criteria does not include an application filter, or the filter was added with a null application version.
- Returns:
- the application version; null if the search criteria does not include an application filter, or the filter was added with a null application version
getAttributes
public java.util.Map getAttributes()
Gets the attribute filters (attribute name and value pairs) included in this search criteria.
- Returns:
- the attribute filters (attribute name and value pairs) included in this search criteria
getMaxLength
public int getMaxLength()
Gets the max number of clients to be returned in the serach results.
- Returns:
- the max number of clients to be returned in the serach results
allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //-->
© Copyright IBM Corp. 2006, 2015. All Rights Reserved.