Problem while Searching objects in Tivoli Identity Manager - TechRepublic
Question
September 26, 2007 at 05:16 AM
ajmerasunny

Problem while Searching objects in Tivoli Identity Manager

by ajmerasunny . Updated 18 years, 10 months ago

I am trying to build an webapplication in which i am search records based on the uid and i am not able to do that. Please help me

This is gist of my code

PlatformContext platform = getPlatform();
SelfRegistrationManager selfRegister;
Person person;
Subject sub = getSubject(platform,”itim manager”,”Infosys123″);
SearchMO searchMO = new SearchMO(platform,sub);
searchMO.setCategory(ObjectProfileCategory.PERSON);
DistinguishedName dn = new DistinguishedName(“ou=infy,dc=edison,dc=com”);
CompoundDN cdn = new CompoundDN(dn);
searchMO.setContext(cdn);
String filter = “userid=nidhi”;
searchMO.setFilter(“\”(“+ filter + “)\””);
Collection persons = searchMO.execute().getResults();
Iterator it = persons.iterator();
PrintWriter pw = response.getWriter();
if (persons.size () == 0) {
System.out.println (“Unable to find Person”);
System.exit (0);
}
System.out.println (persons.size () + “people found”);

if(it.hasNext())

pw.print(“User with entered UserID Already Exist”);

else {

selfRegister = new SelfRegistrationManager(platform);

person = getallPersonData();

selfRegister.createPerson(person);

String statusValue=”your submission has been made”;

}

This discussion is locked

All Comments