public TextData search(int pMessageID, TextData pBase, int pScope,
int pDerefAliases, int pSizeLimit, int pTimeLimit,
boolean pTypesOnly, LDAPFilter pFilter,
Array_Of_TextData<TextData> pAttributes, ParameterHolder_LDAPEntry_Array pResults) {
TextData returnString = new TextData("success"); // As returned by
// UDS
LDAPSearchResults results;
try {
results = this.ldapSearch(pBase, pScope, pDerefAliases,
pSizeLimit, pTimeLimit, pTypesOnly, pFilter, pAttributes);
org.ietf.ldap.LDAPEntry entry;
org.ietf.ldap.LDAPAttribute attribute;
LDAPAttributeSet attrSet;
LDAP.LDAPEntry fEntry;
LDAP.LDAPAttribute fAttribute;
Iterator<org.ietf.ldap.LDAPAttribute> setItr;
Array_Of_TextData<TextData> listOfTextDataValues;
String[] listOfStringValues;
Array_Of_LDAPAttribute<LDAPAttribute> listOfAttributes;
while (results.hasMore()) {
entry = (org.ietf.ldap.LDAPEntry)(results.next());
fEntry = new LDAP.LDAPEntry();
fEntry.setDN(entry.getDN());
listOfAttributes = new Array_Of_LDAPAttribute<LDAPAttribute>();
attrSet = entry.getAttributeSet();
setItr = attrSet.iterator();
while (setItr.hasNext()) {
attribute = (org.ietf.ldap.LDAPAttribute)setItr.next();
fAttribute = new LDAP.LDAPAttribute();
fAttribute.setAttName(new TextData(attribute.getName()));
listOfStringValues = attribute.getStringValueArray();
listOfTextDataValues = new Array_Of_TextData<TextData>();
for (int j=0, jSize = listOfStringValues.length; j<jSize; j++ ) {
listOfTextDataValues.add(new TextData(listOfStringValues[j]));
}
fAttribute.setAttValueList(listOfTextDataValues);
listOfAttributes.add(fAttribute);
}
fEntry.setAttList(listOfAttributes);
((Array_Of_LDAPEntry<LDAPEntry>)pResults.getObject()).add(fEntry);
}
} catch (LDAPException e) {
if (pSizeLimit >0) {
returnString = new TextData("sizeLimitExceeded"); // As return by UDS
} else {
returnString = new TextData("failed");
}
}
return returnString;
}