Search in sources :

Example 6 with ChangeRecordEntry

use of org.opends.server.util.ChangeRecordEntry 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;
}
Also used : ChangeRecordEntry(org.opends.server.util.ChangeRecordEntry) ModifyChangeRecordEntry(org.opends.server.util.ModifyChangeRecordEntry) ModifyDNChangeRecordEntry(org.opends.server.util.ModifyDNChangeRecordEntry) LDIFImportConfig(org.opends.server.types.LDIFImportConfig) LDIFReader(org.opends.server.util.LDIFReader) ModifyOperation(org.opends.server.core.ModifyOperation)

Example 7 with ChangeRecordEntry

use of org.opends.server.util.ChangeRecordEntry 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;
}
Also used : ChangeRecordEntry(org.opends.server.util.ChangeRecordEntry) ModifyChangeRecordEntry(org.opends.server.util.ModifyChangeRecordEntry) ModifyDNChangeRecordEntry(org.opends.server.util.ModifyDNChangeRecordEntry) InputStream(java.io.InputStream) LDIFImportConfig(org.opends.server.types.LDIFImportConfig) LDIFReader(org.opends.server.util.LDIFReader) ModifyOperation(org.opends.server.core.ModifyOperation)

Aggregations

ChangeRecordEntry (org.opends.server.util.ChangeRecordEntry)7 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)4 PrismAsserts.assertEqualsPolyString (com.evolveum.midpoint.prism.util.PrismAsserts.assertEqualsPolyString)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)4 Task (com.evolveum.midpoint.task.api.Task)4 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)4 Test (org.testng.annotations.Test)4 LDIFImportConfig (org.opends.server.types.LDIFImportConfig)3 LDIFReader (org.opends.server.util.LDIFReader)3 ModifyChangeRecordEntry (org.opends.server.util.ModifyChangeRecordEntry)3 ModifyDNChangeRecordEntry (org.opends.server.util.ModifyDNChangeRecordEntry)3 Checker (com.evolveum.midpoint.test.Checker)2 ObjectChecker (com.evolveum.midpoint.test.ObjectChecker)2 ObjectListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType)2 GenericObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType)2 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)2 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)2 SelectorQualifiedGetOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)2 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)2