for (Attribute attribute : e.getAttributes()) { if (activeDirectory && "userPrincipalName".equalsIgnoreCase(attribute.getId())) { ldapEntry.setBindPrincipal(attribute.getString());
/** * {@inheritDoc} */ @Override public Collection<Attribute> getAttributes() { return entry.getAttributes(); }
/** * {@inheritDoc} */ public Collection<Attribute> getAttributes() { return clonedEntry.getAttributes(); }
/** * {@inheritDoc} */ @Override public Collection<Attribute> getAttributes() { return entry.getAttributes(); }
/** * {@inheritDoc} */ @Override public Collection<Attribute> getAttributes() { return entry.getAttributes(); }
/** * Check if the entry contains any collective AttributeType (those starting with 'c-') */ private boolean containsAnyCollectiveAttributes( Entry entry ) throws LdapException { for ( Attribute attribute : entry.getAttributes() ) { AttributeType attributeType = attribute.getAttributeType(); if ( attributeType.isCollective() ) { return true; } } return false; }
private void applyAttributes(Map<String, Object> props, Entry entry) throws LdapInvalidAttributeValueException { for (Attribute attr: entry.getAttributes()) { if (attr.isHumanReadable()) { final Object propValue; // for multivalue properties, store as collection if (attr.size() > 1) { List<String> values = new ArrayList(); for (Value<?> value : attr) { values.add(value.getString()); } propValue = values; } else { propValue = attr.getString(); } props.put(attr.getId(), propValue); } } }
out.writeInt( entry.getAttributes().size() ); for ( Attribute attribute : entry.getAttributes() )
for (Attribute attr : entry.getAttributes()) { String id = attr.getId(); List<String> values;
out.writeInt( entry.getAttributes().size() ); for ( Attribute attribute : entry.getAttributes() )
out.writeInt( entry.getAttributes().size() ); for ( Attribute attribute : entry.getAttributes() )
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { if ( algorithm == null ) { next( addContext ); return; } for ( Attribute attribute : addContext.getEntry().getAttributes() ) { if ( attributeTypes.contains( attribute.getAttributeType() ) ) { includeHashed( attribute ); } } next( addContext ); }
for (Attribute attribute : e.getAttributes()) { if (activeDirectory && "userPrincipalName".equalsIgnoreCase(attribute.getId())) { ldapEntry.setBindPrincipal(attribute.getString());
/** * Convert a ServerEntry into a BasicAttributes. The Dn is lost * during this conversion, as the Attributes object does not store * this element. * * @param entry The entry to convert * @return An instance of a AttributesImpl() object */ public static Attributes toBasicAttributes( Entry entry ) { if ( entry == null ) { return null; } Attributes attributes = new BasicAttributes( true ); for ( Attribute attribute : entry.getAttributes() ) { AttributeType attributeType = attribute.getAttributeType(); Attribute attr = entry.get( attributeType ); // Deal with a special case : an entry without any ObjectClass if ( attributeType.getOid().equals( SchemaConstants.OBJECT_CLASS_AT_OID ) && attr.size() == 0 ) { // We don't have any objectClass, just dismiss this element continue; } attributes.put( toBasicAttribute( attr ) ); } return attributes; }
ldif.setDn( addContext.getDn() ); for ( Attribute attribute : addEntry.getAttributes() )
for ( Attribute attribute : subentry.getAttributes() )
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { next( addContext ); if ( !changeLog.isEnabled() ) { return; } Entry addEntry = addContext.getEntry(); // we don't want to record addition of a tag as a change if ( addEntry.get( REV_AT_OID ) != null ) { return; } LdifEntry forward = new LdifEntry(); forward.setChangeType( ChangeType.Add ); forward.setDn( addContext.getDn() ); for ( Attribute attribute : addEntry.getAttributes() ) { AttributeType attributeType = attribute.getAttributeType(); forward.addAttribute( addEntry.get( attributeType ).clone() ); } LdifEntry reverse = LdifRevertor.reverseAdd( addContext.getDn() ); addContext.setChangeLogEvent( changeLog.log( getPrincipal( addContext ), forward, reverse ) ); }