public void addAccountSyncDelta(ObjectDelta<ShadowType> delta) throws SchemaException { if (syncDelta == null) { syncDelta = delta; } else { syncDelta.merge(delta); } }
public void addPrimaryDelta(ObjectDelta<O> delta) throws SchemaException { if (primaryDelta == null) { primaryDelta = delta; } else { primaryDelta.merge(delta); } }
public void addSecondaryDelta(ObjectDelta<ShadowType> delta) throws SchemaException { if (secondaryDelta == null) { secondaryDelta = delta; } else { secondaryDelta.merge(delta); } }
public void merge(ObjectTreeDeltas<T> deltasToMerge) throws SchemaException { if (deltasToMerge == null) { return; } if (focusChange != null) { focusChange.merge(deltasToMerge.focusChange); } else { focusChange = deltasToMerge.focusChange; } for (Map.Entry<ResourceShadowDiscriminator, ObjectDelta<ShadowType>> projEntry : deltasToMerge.getProjectionChangeMapEntries()) { ResourceShadowDiscriminator rsd = projEntry.getKey(); ObjectDelta<ShadowType> existingDelta = projectionChangeMap.get(rsd); ObjectDelta<ShadowType> newDelta = projEntry.getValue(); if (existingDelta != null) { existingDelta.merge(newDelta); } else { projectionChangeMap.put(rsd, newDelta); } } }
/** * Returns a delta that is a "sum" of all the deltas in the collection. * The deltas as processed as an ORDERED sequence. Therefore it correctly processes item overwrites and so on. * It also means that if there is an ADD delta it has to be first. */ public static <T extends Objectable> ObjectDelta<T> summarize(List<ObjectDelta<T>> deltas) throws SchemaException { if (deltas == null || deltas.isEmpty()) { return null; } Iterator<ObjectDelta<T>> iterator = deltas.iterator(); ObjectDelta<T> sumDelta = iterator.next().clone(); while (iterator.hasNext()) { ObjectDelta<T> nextDelta = iterator.next(); sumDelta.merge(nextDelta); } return sumDelta; }
/** * Get merged deltas from the waves up to maxWave (including). Optional initial delta may be supplied. * Negative maxWave means to merge all available waves. */ public ObjectDelta<O> getMergedDeltas(ObjectDelta<O> initialDelta, int maxWave) throws SchemaException { ObjectDelta<O> merged = null; if (initialDelta != null) { merged = initialDelta.clone(); } int waveNum = 0; for (ObjectDelta<O> delta: waves) { if (delta == null) { continue; } if (merged == null) { merged = delta.clone(); } else { merged.merge(delta); } if (maxWave >= 0 && waveNum >= maxWave) { break; } } return merged; }
/** * Extracts the delta from this projection context and also from all other projection contexts that have * equivalent discriminator. */ public static <F extends ObjectType, T> ObjectDelta<ShadowType> findAPrioriDelta(LensContext<F> context, LensProjectionContext projCtx) throws SchemaException { ObjectDelta<ShadowType> aPrioriDelta = null; for (LensProjectionContext aProjCtx: findRelatedContexts(context, projCtx)) { ObjectDelta<ShadowType> aProjDelta = aProjCtx.getDelta(); if (aProjDelta != null) { if (aPrioriDelta == null) { aPrioriDelta = aProjDelta.clone(); } else { aPrioriDelta.merge(aProjDelta); } } } return aPrioriDelta; }
public ObjectDelta<O> getAggregatedWaveDelta(int wave) throws SchemaException { ObjectDelta<O> result = null; for (int w = 0; w <= wave; w++) { ObjectDelta<O> delta = getWaveDelta(w); if (delta == null) { continue; } if (result == null) { result = delta.clone(); } else { result.merge(delta); } } LOGGER.trace("Aggregated wave delta for wave {} = {}", wave, result != null ? result.debugDump() : "(null)"); return result; }
private <F extends FocusType> void consolidateValuesModifyProjection(LensContext<F> context, LensProjectionContext accCtx, Task task, OperationResult result) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, PolicyViolationException { boolean addUnchangedValues = false; if (accCtx.getSynchronizationPolicyDecision() == SynchronizationPolicyDecision.ADD) { addUnchangedValues = true; } ObjectDelta<ShadowType> modifyDelta = consolidateValuesToModifyDelta(context, accCtx, addUnchangedValues, task, result); if (modifyDelta == null || modifyDelta.isEmpty()) { return; } ObjectDelta<ShadowType> accountSecondaryDelta = accCtx.getSecondaryDelta(); if (accountSecondaryDelta != null) { accountSecondaryDelta.merge(modifyDelta); } else { accCtx.setSecondaryDelta(modifyDelta); } }
addDelta.merge(origDelta);
operationDelta = pendingDelta; } else { operationDelta.merge(pendingDelta);
accountSecondaryDelta.merge(objectDelta); } else { projCtx.setSecondaryDelta(objectDelta);