In the DMS API, searches are performed on an organization object.
To search an organization:
For example, the following SmDmsSearch constructor call creates a search object to search for groups. The root parameter specifies a start point of o=swdev.org.
SmDmsSearch mySearch = new SmDmsSearch ( "(&(objectclass=organizationalUnit) (ou=groups))", "o=swdev.org");
Note: The root is the top level of the SiteMinder user directory to search. It is not necessarily the top level of the entire directory structure.
Use the set... methods in the SmDmsSearch class to set any other search parameters—for example:
mySearch.setScope(2);
result = targetOrg.search (mySearch, 1);
The second parameter of the search() method indicates the direction to search, as shown in the following table:
|
Direction |
Integer Value |
|---|---|
|
Reset |
0 |
|
Forward |
1 |
|
Back |
2 |
|
Refresh |
3 |
Vector mySearchResults = search.getResults();
The first element of the results vector contains the search parameters in a SmDmsSearchResultParams object. The remaining elements are SmDmsObject objects. To distinguish object types, the classId attribute of each object is set through the setClassId() method. For example, if the classId is DMSOBJECT_CLASS_USER, the object is a user. If the classId is DMSOBJECT_CLASS_GROUP, the object is a group.
| Copyright © 2011 CA. All rights reserved. | Email CA Technologies about this topic |