use of org.opends.messages.MessageBuilder in project midpoint by Evolveum.
the class OpenDJController method executeRenameChange.
public ChangeRecordEntry executeRenameChange(String filename) throws LDIFException, IOException {
LDIFImportConfig importConfig = new LDIFImportConfig(filename);
LDIFReader ldifReader = new LDIFReader(importConfig);
ChangeRecordEntry entry = ldifReader.readChangeRecord(false);
if (!(entry instanceof ModifyDNChangeRecordEntry)) {
throw new LDIFException(new MessageBuilder("Could not execute rename..Bad change").toMessage());
}
ModifyDNOperation modifyOperation = getInternalConnection().processModifyDN((ModifyDNChangeRecordEntry) entry);
if (ResultCode.SUCCESS != modifyOperation.getResultCode()) {
throw new RuntimeException("LDAP operation error: " + modifyOperation.getResultCode() + ": " + modifyOperation.getErrorMessage());
}
return entry;
}
Aggregations