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);
}
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;
}
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);
}
}
Aggregations