use of org.opends.server.util.LDIFReader in project midpoint by Evolveum.
the class OpenDJController method addEntry.
public void addEntry(String ldif) throws IOException, LDIFException {
LDIFImportConfig importConfig = new LDIFImportConfig(IOUtils.toInputStream(ldif, "utf-8"));
LDIFReader ldifReader = new LDIFReader(importConfig);
Entry ldifEntry = ldifReader.readEntry();
addEntry(ldifEntry);
}
use of org.opends.server.util.LDIFReader in project midpoint by Evolveum.
the class OpenDJController method executeLdifChange.
public ChangeRecordEntry executeLdifChange(File file) throws IOException, LDIFException {
LDIFImportConfig importConfig = new LDIFImportConfig(file.getPath());
LDIFReader ldifReader = new LDIFReader(importConfig);
ChangeRecordEntry entry = ldifReader.readChangeRecord(false);
ModifyOperation modifyOperation = getInternalConnection().processModify((ModifyChangeRecordEntry) entry);
if (ResultCode.SUCCESS != modifyOperation.getResultCode()) {
throw new RuntimeException("LDAP operation error: " + modifyOperation.getResultCode() + ": " + modifyOperation.getErrorMessage());
}
return entry;
}
use of org.opends.server.util.LDIFReader in project midpoint by Evolveum.
the class OpenDJController method executeLdifChange.
public ChangeRecordEntry executeLdifChange(String ldif) throws IOException, LDIFException {
InputStream ldifInputStream = IOUtils.toInputStream(ldif, "UTF-8");
LDIFImportConfig importConfig = new LDIFImportConfig(ldifInputStream);
LDIFReader ldifReader = new LDIFReader(importConfig);
ChangeRecordEntry entry = ldifReader.readChangeRecord(false);
ModifyOperation modifyOperation = getInternalConnection().processModify((ModifyChangeRecordEntry) entry);
if (ResultCode.SUCCESS != modifyOperation.getResultCode()) {
throw new RuntimeException("LDAP operation error: " + modifyOperation.getResultCode() + ": " + modifyOperation.getErrorMessage());
}
return entry;
}
Aggregations