public ObjectDelta<O> getDelta() { if (odo == null) { return null; } return odo.getObjectDelta(); }
public boolean hasDelta() { return odo != null && odo.getObjectDelta() != null; }
public void addVariableDefinitions(Map<QName, Object> extraVariables, @NotNull Collection<QName> exceptFor) { for (Entry<QName, Object> entry : extraVariables.entrySet()) { if (QNameUtil.matchAny(entry.getKey(), exceptFor)) { continue; } Object value = entry.getValue(); if (!areDeltasAllowed() && value instanceof ObjectDeltaObject<?>) { ObjectDeltaObject<?> odo = (ObjectDeltaObject<?>)value; if (odo.getObjectDelta() != null) { throw new IllegalArgumentException("Cannot use variables with deltas in addVariableDefinitions. Use addVariableDefinitionsOld or addVariableDefinitionsNew."); } value = odo.getOldObject(); } variables.put(entry.getKey(), value); } }
@Override public void shortDump(StringBuilder sb) { sb.append("odo="); if (odo == null) { sb.append("null"); } else { sb.append("("); sb.append(odo.getOldObject()).append(","); sb.append(odo.getObjectDelta()).append(","); sb.append(odo.getNewObject()); sb.append(")"); } sb.append(","); shortDumpElement(sb, "target", target); shortDumpElement(sb, "relation", relation); if (orderConstraints != null) { sb.append("orderConstraints="); SchemaDebugUtil.shortDumpOrderConstraintsList(sb, orderConstraints); sb.append(", "); } if (sb.length() > 1) { sb.setLength(sb.length() - 2); } }
private boolean hasDeltas(ExpressionVariables variables) { for (Entry<QName,Object> entry: variables.entrySet()) { Object value = entry.getValue(); if (value instanceof ObjectDeltaObject<?>) { if (((ObjectDeltaObject<?>)value).getObjectDelta() != null && !((ObjectDeltaObject<?>)value).getObjectDelta().isEmpty()) { return true; } } else if (value instanceof ItemDeltaItem<?,?>) { if (((ItemDeltaItem<?,?>)value).getDelta() != null && !((ItemDeltaItem<?,?>)value).getDelta().isEmpty()) { return true; } } } return false; }
return false; if (odo.getObjectDelta() != null && odo.getObjectDelta().isModify()) { if (autz.keepZoneOfControl()) { PrismObject<O> oldObject = odo.getOldObject();
Collection<ItemDelta<?,?>> itemDeltas = computeItemDeltas(outputTripleMap, itemDefinitionsMap, focusOdo.getObjectDelta(), focusOdo.getNewObject(), focusDefinition, contextDesc);
consolidator.setIvwoTriple(triple); consolidator.setItemDefinition(itemDefinition); consolidator.setAprioriItemDelta(getAprioriItemDelta(focusOdo.getObjectDelta(), path)); consolidator.setItemContainer(focusOdo.getNewObject()); consolidator.setValueMatcher(null);
ObjectDeltaObject<AH> focusOdo = focusContext.getObjectDeltaObject(); Collection<ItemDelta<?,?>> focusDeltas = objectTemplateProcessor.computeItemDeltas(focusOutputTripleMap, null, focusOdo.getObjectDelta(), focusOdo.getNewObject(), focusContext.getObjectDefinition(), "focus mappings in assignments of "+focusContext.getHumanReadableName()); LOGGER.trace("Computed focus deltas: {}", focusDeltas);
protected AssignmentEvaluator<UserType> createAssignmentEvaluator(ObjectDeltaObject<UserType> focusOdo) throws ObjectNotFoundException, SchemaException { LensContext<UserType> lensContext = createLensContext(UserType.class); LensFocusContext<UserType> focusContext = lensContext.getOrCreateFocusContext(); focusContext.setObjectOld(focusOdo.getOldObject()); focusContext.setPrimaryDelta(focusOdo.getObjectDelta()); focusContext.setObjectCurrent(focusOdo.getOldObject()); focusContext.setObjectNew(focusOdo.getNewObject()); return new AssignmentEvaluator.Builder<UserType>() .repository(repositoryService) .focusOdo(focusOdo) .objectResolver(objectResolver) .systemObjectCache(systemObjectCache) .relationRegistry(relationRegistry) .prismContext(prismContext) .activationComputer(activationComputer) .now(clock.currentTimeXMLGregorianCalendar()) .mappingFactory(mappingFactory) .mappingEvaluator(mappingEvaluator) .lensContext(lensContext) .build(); }