use of com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType 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.prism.xml.ns._public.types_3.ItemDeltaType in project midpoint by Evolveum.
the class ModelClientUtil method createRoleAssignmentDelta.
public static <O extends ObjectType> ObjectDeltaType createRoleAssignmentDelta(Class<O> focusType, String focusOid, ModificationTypeType modType, String... roleOids) {
ItemDeltaType assignmentDelta = new ItemDeltaType();
assignmentDelta.setModificationType(modType);
assignmentDelta.setPath(ModelClientUtil.createItemPathType("assignment"));
for (String roleOid : roleOids) {
assignmentDelta.getValue().add(createRoleAssignment(roleOid));
}
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(focusType));
deltaType.setChangeType(ChangeTypeType.MODIFY);
deltaType.setOid(focusOid);
deltaType.getItemDelta().add(assignmentDelta);
return deltaType;
}
use of com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType in project midpoint by Evolveum.
the class ModelClientUtil method createConstructionAssignmentDelta.
public static <O extends ObjectType> ObjectDeltaType createConstructionAssignmentDelta(Class<O> focusType, String focusOid, ModificationTypeType modType, String resourceOid, ShadowKindType kind, String intent) {
ItemDeltaType assignmentDelta = new ItemDeltaType();
assignmentDelta.setModificationType(modType);
assignmentDelta.setPath(ModelClientUtil.createItemPathType("assignment"));
assignmentDelta.getValue().add(createConstructionAssignment(resourceOid, kind, intent));
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(focusType));
deltaType.setChangeType(ChangeTypeType.MODIFY);
deltaType.setOid(focusOid);
deltaType.getItemDelta().add(assignmentDelta);
return deltaType;
}
use of com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType in project midpoint by Evolveum.
the class ModifyAssignmentAspect method requestToDelta.
private ObjectDelta<? extends ObjectType> requestToDelta(ModelContext<?> modelContext, ApprovalRequest<AssignmentModification> approvalRequest, String objectOid) throws SchemaException {
List<ItemDelta> modifications = new ArrayList<>();
Class<? extends ObjectType> focusClass = primaryChangeAspectHelper.getFocusClass(modelContext);
for (ItemDeltaType itemDeltaType : approvalRequest.getItemToApprove().getModifications()) {
modifications.add(DeltaConvertor.createItemDelta(itemDeltaType, focusClass, prismContext));
}
return ObjectDelta.createModifyDelta(objectOid, modifications, focusClass, ((LensContext) modelContext).getPrismContext());
}
use of com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType in project midpoint by Evolveum.
the class AbstractManualResourceTest method findPendingOperation.
private PendingOperationType findPendingOperation(PrismObject<ShadowType> shadow, OperationResultStatusType expectedResult, ItemPath itemPath) {
List<PendingOperationType> pendingOperations = shadow.asObjectable().getPendingOperation();
for (PendingOperationType pendingOperation : pendingOperations) {
OperationResultStatusType result = pendingOperation.getResultStatus();
if (result == null) {
result = OperationResultStatusType.IN_PROGRESS;
}
if (pendingOperation.getResultStatus() != expectedResult) {
continue;
}
if (itemPath == null) {
return pendingOperation;
}
ObjectDeltaType delta = pendingOperation.getDelta();
assertNotNull("No delta in pending operation in " + shadow, delta);
for (ItemDeltaType itemDelta : delta.getItemDelta()) {
ItemPath deltaPath = itemDelta.getPath().getItemPath();
if (itemPath.equivalent(deltaPath)) {
return pendingOperation;
}
}
}
return null;
}
Aggregations