public static void applyTo(Collection<? extends ItemDelta> deltas, PrismContainerValue propertyContainerValue) throws SchemaException { for (ItemDelta delta : deltas) { delta.applyTo(propertyContainerValue); } }
public static <O extends Objectable> void applyTo( PrismObject<O> targetObject, Collection<? extends ItemDelta<?,?>> modifications) throws SchemaException { for (ItemDelta itemDelta : modifications) { itemDelta.applyTo(targetObject); } } }
public static void applyTo(Collection<? extends ItemDelta> deltas, PrismContainer propertyContainer) throws SchemaException { for (ItemDelta delta : deltas) { delta.applyTo(propertyContainer); } }
private static <O extends Objectable> void applyTo(PrismObject<O> targetObject, Collection<? extends ItemDelta<?, ?>> modifications, ParameterizedEquivalenceStrategy strategy) throws SchemaException { for (ItemDelta itemDelta : modifications) { itemDelta.applyTo(targetObject, strategy); } }
@Override public void addModifications(Collection<ItemDelta<?, ?>> deltas) throws SchemaException { for (ItemDelta<?, ?> delta : deltas) { addPendingModification(delta); delta.applyTo(taskPrism); } }
@Override public void addModification(ItemDelta<?, ?> delta) throws SchemaException { addPendingModification(delta); delta.applyTo(taskPrism); }
@Override public void addModificationImmediate(ItemDelta<?, ?> delta, OperationResult parentResult) throws SchemaException, ObjectAlreadyExistsException, ObjectNotFoundException { addPendingModification(delta); delta.applyTo(taskPrism); savePendingModifications(parentResult); }
public void mergeModification(ItemDelta<?,?> modificationToMerge) throws SchemaException { if (changeType == ChangeType.ADD) { modificationToMerge.applyTo(objectToAdd); } else if (changeType == ChangeType.MODIFY) { // We use 'strict' finding mode because of MID-4690 (TODO) ItemDelta existingModification = findModification(modificationToMerge.getPath(), ItemDelta.class, true); if (existingModification == null) { addModification(modificationToMerge.clone()); } else { existingModification.merge(modificationToMerge); } } // else it is DELETE. There's nothing to do. Merging anything to delete is still delete }
/** * Incorporates the property delta into the existing property deltas * (regardless of the change type). */ public void swallow(ItemDelta<?,?> newItemDelta) throws SchemaException { checkMutability(); if (changeType == ChangeType.MODIFY) { // TODO: check for conflict addModification(newItemDelta); } else if (changeType == ChangeType.ADD) { Item item = objectToAdd.findOrCreateItem(newItemDelta.getPath(), newItemDelta.getItemClass()); newItemDelta.applyTo(item); } // nothing to do for DELETE }
private void swallowIntoValues(Collection<AssignmentType> assignments, AssignmentType assignmentToFind, List<ItemDelta<?, ?>> modifications) throws SchemaException { for (AssignmentType assignment : assignments) { PrismContainerValue<?> pcv = assignment.asPrismContainerValue(); PrismContainerValue<?> pcvToFind = assignmentToFind.asPrismContainerValue(); if (pcv.representsSameValue(pcvToFind, false) || pcv.equals(pcvToFind, EquivalenceStrategy.REAL_VALUE_CONSIDER_DIFFERENT_IDS)) { // TODO what if ID of the assignment being added is changed in repo? Hopefully it will be not. for (ItemDelta<?, ?> modification : modifications) { ItemPath newParentPath = modification.getParentPath().rest(2); // killing assignment + ID ItemDelta<?, ?> pathRelativeModification = modification.cloneWithChangedParentPath(newParentPath); pathRelativeModification.applyTo(pcv); } return; } } // TODO change to warning throw new IllegalStateException("We have 'plus' assignment to modify but it couldn't be found in assignment delta. Assignment=" + assignmentToFind + ", new assignments=" + assignments); }
/** * Applies this object delta to specified object, returns updated object. * It leaves the original object unchanged. * * @param objectOld object before change * @return object with applied changes or null if the object should not exit (was deleted) */ public PrismObject<O> computeChangedObject(PrismObject<O> objectOld) throws SchemaException { if (objectOld == null) { if (getChangeType() == ChangeType.ADD) { objectOld = getObjectToAdd(); return objectOld.clone(); } else { //throw new IllegalStateException("Cannot apply "+getChangeType()+" delta to a null old object"); // This seems to be quite OK return null; } } if (getChangeType() == ChangeType.DELETE) { return null; } // MODIFY change PrismObject<O> objectNew = objectOld.clone(); for (ItemDelta modification : modifications) { modification.applyTo(objectNew); } return objectNew; }
public void update(ItemDelta<?, ?> itemDelta) throws SchemaException { if (delta == null) { delta = getAnyObject().getPrismContext().deltaFactory().object() .createModifyDelta(getAnyObject().getOid(), itemDelta, getAnyObject().getCompileTimeClass() ); } else { delta.swallow(itemDelta); itemDelta.applyTo(newObject); } }
delta.applyTo(aCase.asPrismContainerValue());
LookupTableRowType rowType = row.toJAXB(); delta.setParentPath(ItemPath.EMPTY_PATH); delta.applyTo(rowType.asPrismContainerValue()); if (!QNameUtil.match(name, LookupTableRowType.F_LAST_CHANGE_TIMESTAMP)) {
delta.applyTo(objectToAdd);
itemDelta.applyTo(target);
itemDelta.applyTo(shadowAfter);