-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDIFReader and mixed content from AD ldifde #1
Comments
For LDIF files that may contain a mix of entries and change records, you should use the while (true)
{
LDIFRecord r = ldifReader.readLDIFRecord();
if (r == null)
{
// End of the LDIF file.
break;
}
else if (r instanceof Entry)
{
// Treat it as an Entry
}
else
{
// Treat it as an LDIFChangeRecord
}
} Another option would be to use the while (true)
{
LDIFChangeRecord r = ldifReader.readChangeRecord(true);
if (r == null)
{
// End of the LDIF file.
break;
}
r.processChange(ldapConnection);
} |
Thanks, one more question. For example I do this:
This means if I use readChangeRecord/readLDIFRecord it won't be processed by the LDIFReaderEntryTranslator since those methods don't produce Entry objects? This is actually not a problem for me, I can apply the same logic that I use in the LDIFReaderEntryTranslator implementation to the LDIFChangeRecord. |
Although it's not yet in a release, there is code checked into the repository that includes an equivalent of an LDIFReaderEntryTranslator for LDIF change records. So you could check out and build the LDAP SDK for yourself if you want to try that. But the translator interface is really only beneficial if you're using multiple threads to read data and decode data from the LDIF file concurrently, since in that case the translator also is invoked concurrently. In most cases, a single-threaded approach is good enough, and you can just apply whatever transformation you want in your code after reading the change record and before writing it out to the new file. |
I've found the translator interface to be beneficial since it's so easy to implement it in JavaScript for quick transformation/processing/prototyping using jjs and Nashorn in Java 8. I can just specify a different JavaScript file each time and I don't need to compile anything. |
Updated the LDAP SDK documentation to include a number of RFCs with certificate-related specifications. This includes: * RFC 2986 -- PKCS #10: Certificate Request Syntax Specification Version 1.7 * RFC 5208 -- Asymmetric Key Packages (PKCS #8) * RFC 5280 -- Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile * RFC 7292 -- PKCS #12: Personal Information Exchange Syntax v1.1 * RFC 8017 -- PKCS #1: RSA Cryptography Specifications Version 2.2
Hello,
I performed an LDIF export from Active Directory using built-in ldifde tool on Windows 2012R2. The export included a group which has more than 1500 members and ldifde wrote the first 1500 members into an LDIF add record and the rest was written as an LDIF modify record.
When I try to read that LDIF using LDIFReader like this:
I get this error when it comes to the modify change record:
Here is a small LDIF that reproduces the error without all the 1500 members.
The text was updated successfully, but these errors were encountered: