/** * Creates a new ldap entry. * * @param dn dn for this entry * @param attrs collection of attributes to add */ public LdapEntry(final String dn, final Collection<LdapAttribute> attrs) { this(); setDn(dn); addAttributes(attrs); }
/** * Creates a new ldap entry. * * @param dn dn for this entry * @param attrs collection of attributes to add */ public LdapEntry(final String dn, final Collection<LdapAttribute> attrs) { this(); setDn(dn); addAttributes(attrs); }
/** * Creates a new ldap entry. * * @param dn dn for this entry * @param attrs collection of attributes to add */ public LdapEntry(final String dn, final Collection<LdapAttribute> attrs) { this(); setDn(dn); addAttributes(attrs); }
@Override protected void insert(final Map<String, Object> attributes) { attributes.put("objectClass", "person"); final LdapEntry ldapEntry = new LdapEntry(getEntryId(attributes)); ldapEntry.addAttributes(getLdapAttributes(attributes)); Connection connection = null; try { connection = connectionFactory.getConnection(); connection.open(); final AddOperation add = new AddOperation(connection); add.execute(new AddRequest(ldapEntry.getDn(), ldapEntry.getAttributes())); } catch (final LdapException e) { throw new TechnicalException(e); } finally { if (connection != null) { connection.close(); } } }