private void injectEntry(LdifEntry entry, DirectoryService service) throws Exception {
        if (entry.isChangeAdd()) {
            service.getAdminSession().add(
                new DefaultEntry(service.getSchemaManager(), entry.getEntry()));
        } else if (entry.isChangeModify()) {
            service.getAdminSession().modify(entry.getDn(), entry.getModifications());
        } else {
            String message = I18n.err(I18n.ERR_117, entry.getChangeType());
            throw new NamingException(message);
        }
    }
A simple ldap server.

@author eric.wittmann@redhat.com
tools/ldap/src/main/java/io/apiman/tools/ldap/ApimanLdapServer.java