/** * Returns an ldap attribute using the supplied jndi attribute. * * @param attr jndi attribute * * @return ldap attribute * * @throws NamingException if the attribute values cannot be read */ public LdapAttribute toLdapAttribute(final Attribute attr) throws NamingException { final Set<Object> values = new HashSet<>(); final NamingEnumeration<?> ne = attr.getAll(); while (ne.hasMore()) { values.add(ne.next()); } return LdapAttribute.createLdapAttribute(sortBehavior, attr.getID(), values); }
/** * Returns an ldap attribute using the supplied jndi attribute. * * @param attr jndi attribute * * @return ldap attribute * * @throws NamingException if the attribute values cannot be read */ public LdapAttribute toLdapAttribute(final Attribute attr) throws NamingException { final Set<Object> values = new HashSet<>(); final NamingEnumeration<?> ne = attr.getAll(); while (ne.hasMore()) { values.add(ne.next()); } return LdapAttribute.createLdapAttribute(sortBehavior, attr.getID(), values); }
/** * Returns an ldap attribute using the supplied jndi attribute. * * @param attr jndi attribute * * @return ldap attribute * * @throws NamingException if the attribute values cannot be read */ public LdapAttribute toLdapAttribute(final Attribute attr) throws NamingException { final Set<Object> values = new HashSet<>(); final NamingEnumeration<?> ne = attr.getAll(); while (ne.hasMore()) { values.add(ne.next()); } return LdapAttribute.createLdapAttribute(sortBehavior, attr.getID(), values); }
/** * Returns an ldap attribute derived from the supplied node list. * * @param name of the ldap attribute * @param nodes to parse * * @return ldap attribute */ protected LdapAttribute createLdapAttribute(final String name, final NodeList nodes) { boolean isBase64 = false; final Set<Object> values = new HashSet<>(); for (int i = 0; i < nodes.getLength(); i++) { final Element valueElement = (Element) nodes.item(i); if (valueElement != null) { if (valueElement.hasAttribute("encoding") && "base64".equals(valueElement.getAttribute("encoding"))) { isBase64 = true; } values.add(getAttrValue(valueElement, isBase64)); } } return LdapAttribute.createLdapAttribute(sortBehavior, name, values); }
/** * Returns an ldap attribute derived from the supplied node list. * * @param name of the ldap attribute * @param nodes to parse * * @return ldap attribute */ protected LdapAttribute createLdapAttribute(final String name, final NodeList nodes) { boolean isBase64 = false; final Set<Object> values = new HashSet<>(); for (int i = 0; i < nodes.getLength(); i++) { final Element valueElement = (Element) nodes.item(i); if (valueElement != null) { if (valueElement.hasAttribute("encoding") && "base64".equals(valueElement.getAttribute("encoding"))) { isBase64 = true; } values.add(getAttrValue(valueElement, isBase64)); } } return LdapAttribute.createLdapAttribute(sortBehavior, name, values); }
/** * Returns an ldap attribute derived from the supplied node list. * * @param name of the ldap attribute * @param nodes to parse * * @return ldap attribute */ protected LdapAttribute createLdapAttribute(final String name, final NodeList nodes) { boolean isBase64 = false; final Set<Object> values = new HashSet<>(); for (int i = 0; i < nodes.getLength(); i++) { final Element valueElement = (Element) nodes.item(i); if (valueElement != null) { if (valueElement.hasAttribute("encoding") && "base64".equals(valueElement.getAttribute("encoding"))) { isBase64 = true; } values.add(getAttrValue(valueElement, isBase64)); } } return LdapAttribute.createLdapAttribute(sortBehavior, name, values); }