/** * Returns an enumerator for the string values of an attribute. * * @see <a href="../../../../api/com/novell/ldap/LDAPAttribute.html#getStringValues()"> com.novell.ldap.LDAPAttribute.getStringValues()</a> */ public Enumeration getStringValues() { return attr.getStringValues(); }
LDAPEntry entry1 = searchResults.next(); System.out.println("\n" + entry1.getDN()); System.out.println(" Attributes: "); LDAPAttributeSet attributeSet1 = entry1.getAttributeSet(); Iterator allAttributes1 = attributeSet1.iterator(); while(allAttributes1.hasNext()) { LDAPAttribute attribute = (LDAPAttribute)allAttributes1.next(); String attrName = attribute.getName(); System.out.println(" " + attrName); Enumeration allValues1 = attribute.getStringValues(); while(allValues1.hasMoreElements()) { oid = (String) allValues1.nextElement(); if ( (attrName.equalsIgnoreCase("supportedExtension")) || (attrName.equalsIgnoreCase("supportedControl"))) { System.out.println(" " + oid); } } }
/** * Fill provided <code>searchAttributeList</code> with provided LDAP attributes. * * @param searchAttributeList the XWiki attributes. * @param attributeSet the LDAP attributes. */ protected void ldapToXWikiAttribute(List<XWikiLDAPSearchAttribute> searchAttributeList, LDAPAttributeSet attributeSet) { for (Object attributeItem : attributeSet) { LDAPAttribute attribute = (LDAPAttribute) attributeItem; String attributeName = attribute.getName(); if (LOG.isDebugEnabled()) { LOG.debug(" - values for attribute \"" + attributeName + "\""); } Enumeration<String> allValues = attribute.getStringValues(); if (allValues != null) { while (allValues.hasMoreElements()) { String value = allValues.nextElement(); if (LOG.isDebugEnabled()) { LOG.debug(" |- [" + value + "]"); } searchAttributeList.add(new XWikiLDAPSearchAttribute(attributeName, value)); } } } }
/** * Extract group's members from provided LDAP search result. * * @param ldapEntry the LDAP search result. * @param memberMap the result: maps DN to member id. * @param subgroups return all the subgroups identified. * @param context the XWiki context. */ private void getGroupMembersFromLDAPEntry(LDAPEntry ldapEntry, Map<String, String> memberMap, List<String> subgroups, XWikiContext context) { for (String memberField : getGroupMemberFields()) { LDAPAttribute attribute = ldapEntry.getAttribute(memberField); if (attribute != null) { Enumeration<String> values = attribute.getStringValues(); while (values.hasMoreElements()) { String member = values.nextElement(); LOGGER.debug(" |- Member value [{}] found. Trying to resolve it.", member); // we check for subgroups recursive call to scan all subgroups and identify members // and their uid getGroupMembers(member, memberMap, subgroups, context); } } } }
LOGGER.debug(" - values for attribute [{}]", attributeName); Enumeration<String> allValues = attribute.getStringValues();
Enumeration<String> values = classAttribute.getStringValues(); Collection<String> groupClasses = getGroupClasses(); while (values.hasMoreElements()) {
Enumeration enumString = attr.getStringValues();
System.out.println(attrName); if (attrName.equalsIgnoreCase("suid")) { // we got the CN cnValue = (String) attr.getStringValues().nextElement(); System.out.println(cnValue); } else {
Enumeration<?> parameters = parameterAttribute.getStringValues(); while (parameters.hasMoreElements()) {
mod.setName(mods[i].getAttribute().getName()); ArrayList list = new ArrayList(); Enumeration evals = mods[i].getAttribute().getStringValues(); while (evals.hasMoreElements()) { list.add(evals.nextElement());