Search in sources :

Example 51 with ObjectDeltaListType

use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.

the class ModelClientUtil method createAssignmentDeltaList.

@Deprecated
private static <O extends ObjectType, T extends ObjectType> ObjectDeltaListType createAssignmentDeltaList(Class<O> focusType, String focusOid, Class<T> targetType, String targetOid, ModificationTypeType modificationType) {
    AssignmentType assignment = new AssignmentType();
    ObjectReferenceType targetRef = new ObjectReferenceType();
    targetRef.setOid(targetOid);
    targetRef.setType(getTypeQName(targetType));
    assignment.setTargetRef(targetRef);
    return createModificationDeltaList(focusType, focusOid, "assignment", modificationType, assignment);
}
Also used : ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)

Example 52 with ObjectDeltaListType

use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.

the class ModelClientUtil method createModificationDeltaList.

public static <O extends ObjectType> ObjectDeltaListType createModificationDeltaList(Class<O> type, String oid, String path, ModificationTypeType modType, Object... values) {
    ObjectDeltaListType deltaList = new ObjectDeltaListType();
    ObjectDeltaType delta = new ObjectDeltaType();
    delta.setObjectType(getTypeQName(type));
    delta.setChangeType(ChangeTypeType.MODIFY);
    delta.setOid(oid);
    ItemDeltaType itemDelta = new ItemDeltaType();
    itemDelta.setPath(ModelClientUtil.createItemPathType(path));
    itemDelta.setModificationType(modType);
    itemDelta.getValue().addAll(Arrays.asList(values));
    delta.getItemDelta().add(itemDelta);
    deltaList.getDelta().add(delta);
    return deltaList;
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType) ItemDeltaType(com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType)

Example 53 with ObjectDeltaListType

use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.

the class DeleteAction method executeAction.

@Override
protected void executeAction() throws Exception {
    ModelPortType port = createModelPort();
    ModelExecuteOptionsType options = new ModelExecuteOptionsType();
    options.setForce(getParams().isForce());
    options.setRaw(getParams().isRaw());
    QName type = getParams().getType();
    ObjectDeltaType delta = createDeleteDelta(getParams().getOid(), type);
    ObjectDeltaListType deltas = createDeltaList(delta);
    try {
        ObjectDeltaOperationListType result = port.executeChanges(deltas, options);
        List<ObjectDeltaOperationType> operations = result.getDeltaOperation();
        ObjectDeltaOperationType operation = operations.get(0);
        OperationResultType resultType = operation.getExecutionResult();
        STD_OUT.info("Status: {}", resultType.getStatus());
    } catch (FaultMessage ex) {
        handleError("Couldn't delete object '" + type.getLocalPart() + "' with oid '" + getParams().getOid() + "'", ex);
    }
}
Also used : ObjectDeltaOperationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType) ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) FaultMessage(com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage) ModelPortType(com.evolveum.midpoint.xml.ns._public.model.model_3.ModelPortType) QName(javax.xml.namespace.QName) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) ModelExecuteOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)

Aggregations

ObjectDeltaListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)52 ObjectDeltaType (com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType)37 ObjectDeltaOperationListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType)31 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)17 Test (org.testng.annotations.Test)17 LogfileTestTailer (com.evolveum.midpoint.test.util.LogfileTestTailer)13 ItemDeltaType (com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType)11 ModelExecuteOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType)10 ObjectDeltaOperationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType)8 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)4 RoleType (com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType)4 FaultMessage (com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage)4 QName (javax.xml.namespace.QName)4 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)4 AbstractInitializedModelIntegrationTest (com.evolveum.midpoint.model.intest.AbstractInitializedModelIntegrationTest)3 Task (com.evolveum.midpoint.task.api.Task)3 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)3 ProtectedStringType (com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType)3 Collection (java.util.Collection)3 Document (org.w3c.dom.Document)3