Class ObjectDeltaImpl<O extends Objectable>
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.delta.ObjectDeltaImpl<O>
-
- All Implemented Interfaces:
ObjectDelta<O>
,Freezable
,PathVisitable
,PrismContextSensitive
,Visitable
,DebugDumpable
,Serializable
,Cloneable
- Direct Known Subclasses:
ShadowCoordinatesQualifiedObjectDeltaImpl
public class ObjectDeltaImpl<O extends Objectable> extends AbstractFreezable implements ObjectDelta<O>
- See Also:
ObjectDelta
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.delta.ObjectDelta
ObjectDelta.FactorOutResultMulti<T extends Objectable>, ObjectDelta.FactorOutResultSingle<T extends Objectable>
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description ObjectDeltaImpl(Class<O> objectTypeClass, ChangeType changeType, PrismContext prismContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
void
accept(Visitor visitor, boolean includeOldValues)
void
accept(Visitor visitor, ItemPath path, boolean recursive)
<D extends ItemDelta>
DaddModification(D itemDelta)
Adds modification (itemDelta) and returns the modification that was added.<C extends Containerable>
voidaddModificationAddContainer(ItemPath propertyPath, C... containerables)
<C extends Containerable>
voidaddModificationAddContainer(ItemPath propertyPath, PrismContainerValue<C>... containerValues)
<X> void
addModificationAddProperty(ItemPath propertyPath, X... propertyValues)
void
addModificationAddReference(ItemPath path, PrismReferenceValue... refValues)
<C extends Containerable>
voidaddModificationDeleteContainer(ItemPath propertyPath, C... containerables)
<C extends Containerable>
voidaddModificationDeleteContainer(ItemPath propertyPath, PrismContainerValue<C>... containerValues)
<X> void
addModificationDeleteProperty(ItemPath propertyPath, X... propertyValues)
void
addModificationDeleteReference(ItemPath path, PrismReferenceValue... refValues)
<C extends Containerable>
voidaddModificationReplaceContainer(ItemPath propertyPath, PrismContainerValue<C>... containerValues)
<X> PropertyDelta<X>
addModificationReplaceProperty(ItemPath propertyPath, X... propertyValues)
void
addModificationReplaceReference(ItemPath path, PrismReferenceValue... refValues)
void
addModifications(ItemDelta<?,?>... itemDeltas)
void
addModifications(Collection<? extends ItemDelta> itemDeltas)
void
applyDefinition(PrismObjectDefinition<O> objectDefinition, boolean force)
void
applyDefinitionIfPresent(PrismObjectDefinition<O> definition, boolean tolerateNoDefinition)
void
applyTo(PrismObject<O> targetObject)
Applies this object delta to specified object, returns updated object.void
assertDefinitions()
void
assertDefinitions(boolean tolerateRawElements)
void
assertDefinitions(boolean tolerateRawElements, Supplier<String> sourceDescriptionSupplier)
Assert that all the items has appropriate definition.void
assertDefinitions(Supplier<String> sourceDescription)
void
checkConsistence()
void
checkConsistence(boolean requireOid, boolean requireDefinition, boolean prohibitRaw)
void
checkConsistence(boolean requireOid, boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope)
void
checkConsistence(ConsistencyCheckScope scope)
protected void
checkIdentifierConsistence(boolean requireOid)
void
clear()
ObjectDeltaImpl<O>
clone()
Deep clone.PrismObject<O>
computeChangedObject(PrismObject<O> objectOld)
Applies this object delta to specified object, returns updated object.boolean
containsAllModifications(Collection<? extends ItemDelta<?,?>> itemDeltas, EquivalenceStrategy strategy)
boolean
containsModification(ItemDelta itemDelta, EquivalenceStrategy strategy)
protected void
copyValues(ObjectDeltaImpl<O> clone)
static <O extends Objectable>
ObjectDeltaImpl<O>createAddDelta(PrismObject<O> objectToAdd)
<C extends Containerable>
ContainerDelta<C>createContainerModification(ItemPath path)
<C extends Containerable>
ContainerDelta<C>createContainerModification(ItemPath path, PrismContainerDefinition<C> containerDefinition)
static <O extends Objectable>
ObjectDeltaImpl<O>createDeleteDelta(Class<O> type, String oid, PrismContext prismContext)
static <O extends Objectable>
ObjectDeltaImpl<O>createEmptyDeleteDelta(Class<O> type, String oid, PrismContext prismContext)
static <O extends Objectable>
ObjectDeltaImpl<O>createEmptyDelta(Class<O> type, String oid, PrismContext prismContext, ChangeType changeType)
static <O extends Objectable>
ObjectDeltaImpl<O>createEmptyModifyDelta(Class<O> type, String oid, PrismContext prismContext)
<X> PropertyDelta<X>
createPropertyModification(ItemPath path)
<C> PropertyDelta<C>
createPropertyModification(ItemPath path, PrismPropertyDefinition propertyDefinition)
ReferenceDelta
createReferenceModification(ItemPath refPath)
ReferenceDelta
createReferenceModification(ItemPath path, PrismReferenceDefinition referenceDefinition)
ReferenceDelta
createReferenceModification(QName name, PrismReferenceDefinition referenceDefinition)
ObjectDeltaImpl<O>
createReverseDelta()
String
debugDump(int indent)
protected String
debugIdentifiers()
protected String
debugName()
boolean
deleteModification(ItemDelta<?,?> itemDelta)
Deletes a modification, if it exists in a given MODIFY delta.boolean
equals(Object obj)
boolean
equivalent(ObjectDelta o)
@NotNull ObjectDelta.FactorOutResultSingle<O>
factorOut(Collection<? extends ItemPath> paths, boolean cloneDelta)
@NotNull ObjectDelta.FactorOutResultMulti<O>
factorOutValues(ItemPath path, boolean cloneDelta)
<X extends Containerable>
ContainerDelta<X>findContainerDelta(ItemPath propertyPath)
<IV extends PrismValue,ID extends ItemDefinition>
ItemDelta<IV,ID>findItemDelta(ItemPath itemPath)
TODO specify this method!<IV extends PrismValue,ID extends ItemDefinition>
ItemDelta<IV,ID>findItemDelta(ItemPath itemPath, boolean strict)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>,DD extends ItemDelta<IV,ID>>
DDfindItemDelta(ItemPath propertyPath, Class<DD> deltaType, Class<I> itemType, boolean strict)
@NotNull Collection<? extends ItemDelta<?,?>>
findItemDeltasSubPath(ItemPath itemPath)
Returns all item deltas at or below a specified path.<IV extends PrismValue,ID extends ItemDefinition>
Collection<PartiallyResolvedDelta<IV,ID>>findPartial(ItemPath propertyPath)
<X> PropertyDelta<X>
findPropertyDelta(ItemPath propertyPath)
<X> PropertyDelta<X>
findPropertyDelta(ItemPath parentPath, QName propertyName)
Top-level path is assumed.ReferenceDelta
findReferenceModification(ItemPath itemPath)
ChangeType
getChangeType()
List<PrismValue>
getDeletedValuesFor(ItemPath itemPath)
Limitations: (1) For DELETE object delta, we don't know what values were in the object's item.@NotNull Collection<? extends ItemDelta<?,?>>
getModifications()
@NotNull List<ItemPath>
getModifiedItems()
List<PrismValue>
getNewValuesFor(ItemPath itemPath)
PrismObject<O>
getObjectToAdd()
Class<O>
getObjectTypeClass()
String
getOid()
PrismContext
getPrismContext()
boolean
hasCompleteDefinition()
int
hashCode()
boolean
hasItemDelta(ItemPath propertyPath)
boolean
hasItemOrSubitemDelta(ItemPath propertyPath)
boolean
isAdd()
boolean
isDelete()
boolean
isEmpty()
boolean
isModify()
boolean
isRedundant(PrismObject<O> object, @NotNull ParameterizedEquivalenceStrategy plusStrategy, @NotNull ParameterizedEquivalenceStrategy minusStrategy, boolean assumeMissingItems)
Check if delta is redundant w.r.t.void
merge(ObjectDelta<O> deltaToMerge)
Merge provided delta into this delta.void
mergeModification(ItemDelta<?,?> modificationToMerge)
void
mergeModifications(Collection<? extends ItemDelta> modificationsToMerge)
ObjectDeltaImpl<O>
narrow(PrismObject<O> existingObject, @NotNull ParameterizedEquivalenceStrategy plusStrategy, @NotNull ParameterizedEquivalenceStrategy minusStrategy, boolean assumeMissingItems)
void
normalize()
protected void
performFreeze()
void
removeContainerModification(ItemPath itemName)
void
removeEstimatedOldValues()
void
removeModification(ItemDelta<?,?> itemDelta)
void
removeOperationalItems()
void
removePropertyModification(ItemPath itemPath)
void
removeReferenceModification(ItemPath itemPath)
void
revive(PrismContext prismContext)
void
setChangeType(ChangeType changeType)
void
setObjectToAdd(PrismObject<O> objectToAdd)
void
setObjectTypeClass(Class<O> objectTypeClass)
void
setOid(String oid)
void
setPrismContext(PrismContext prismContext)
boolean
subtract(@NotNull ItemPath itemPath, @NotNull PrismValue value, boolean fromMinusSet, boolean dryRun)
Checks if the delta tries to add (or set) a 'value' for the item identified by 'itemPath'.ObjectDeltaImpl<O>
subtract(@NotNull Collection<ItemPath> paths)
Returns modifications that are related to the given paths; removes them from the original delta.void
swallow(ItemDelta<?,?> newItemDelta)
Incorporates the property delta into the existing property deltas (regardless of the change type).void
swallow(List<ItemDelta<?,?>> itemDeltas)
String
toDebugType()
Returns short string identification of object type.String
toString()
-
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze
-
Methods inherited from interface com.evolveum.midpoint.prism.delta.ObjectDelta
isImmutable
-
-
-
-
Constructor Detail
-
ObjectDeltaImpl
public ObjectDeltaImpl(Class<O> objectTypeClass, ChangeType changeType, PrismContext prismContext)
-
-
Method Detail
-
accept
public void accept(Visitor visitor)
- Specified by:
accept
in interfaceVisitable<O extends Objectable>
-
accept
public void accept(Visitor visitor, boolean includeOldValues)
- Specified by:
accept
in interfaceObjectDelta<O extends Objectable>
-
accept
public void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
accept
in interfaceObjectDelta<O extends Objectable>
- Specified by:
accept
in interfacePathVisitable
-
getChangeType
public ChangeType getChangeType()
- Specified by:
getChangeType
in interfaceObjectDelta<O extends Objectable>
-
setChangeType
public void setChangeType(ChangeType changeType)
- Specified by:
setChangeType
in interfaceObjectDelta<O extends Objectable>
-
isAdd
public boolean isAdd()
- Specified by:
isAdd
in interfaceObjectDelta<O extends Objectable>
-
isDelete
public boolean isDelete()
- Specified by:
isDelete
in interfaceObjectDelta<O extends Objectable>
-
isModify
public boolean isModify()
- Specified by:
isModify
in interfaceObjectDelta<O extends Objectable>
-
getOid
public String getOid()
- Specified by:
getOid
in interfaceObjectDelta<O extends Objectable>
-
setOid
public void setOid(String oid)
- Specified by:
setOid
in interfaceObjectDelta<O extends Objectable>
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfacePrismContextSensitive
-
setPrismContext
public void setPrismContext(PrismContext prismContext)
- Specified by:
setPrismContext
in interfaceObjectDelta<O extends Objectable>
-
getObjectToAdd
public PrismObject<O> getObjectToAdd()
- Specified by:
getObjectToAdd
in interfaceObjectDelta<O extends Objectable>
-
setObjectToAdd
public void setObjectToAdd(PrismObject<O> objectToAdd)
- Specified by:
setObjectToAdd
in interfaceObjectDelta<O extends Objectable>
-
getModifications
@NotNull public @NotNull Collection<? extends ItemDelta<?,?>> getModifications()
- Specified by:
getModifications
in interfaceObjectDelta<O extends Objectable>
-
addModification
public <D extends ItemDelta> D addModification(D itemDelta)
Description copied from interface:ObjectDelta
Adds modification (itemDelta) and returns the modification that was added. NOTE: the modification that was added may be different from the modification that was passed into this method! E.g. in case if two modifications must be merged to keep the delta consistent. Therefore always use the returned modification after this method is invoked.- Specified by:
addModification
in interfaceObjectDelta<O extends Objectable>
-
deleteModification
public boolean deleteModification(ItemDelta<?,?> itemDelta)
Description copied from interface:ObjectDelta
Deletes a modification, if it exists in a given MODIFY delta. (Throws an exception if the delta is not a MODIFY one.)- Specified by:
deleteModification
in interfaceObjectDelta<O extends Objectable>
- Returns:
- true if the modification was found and removed
-
containsModification
public boolean containsModification(ItemDelta itemDelta, EquivalenceStrategy strategy)
- Specified by:
containsModification
in interfaceObjectDelta<O extends Objectable>
-
containsAllModifications
public boolean containsAllModifications(Collection<? extends ItemDelta<?,?>> itemDeltas, EquivalenceStrategy strategy)
- Specified by:
containsAllModifications
in interfaceObjectDelta<O extends Objectable>
-
addModifications
public void addModifications(Collection<? extends ItemDelta> itemDeltas)
- Specified by:
addModifications
in interfaceObjectDelta<O extends Objectable>
-
addModifications
public void addModifications(ItemDelta<?,?>... itemDeltas)
- Specified by:
addModifications
in interfaceObjectDelta<O extends Objectable>
-
findItemDelta
public <IV extends PrismValue,ID extends ItemDefinition> ItemDelta<IV,ID> findItemDelta(ItemPath itemPath)
Description copied from interface:ObjectDelta
TODO specify this method!An attempt:
Given this ADD or MODIFY object delta OD, finds an item delta ID such that "ID has the same effect on an item specified by itemPath as OD" (simply said).
More precisely, - if OD is ADD delta: ID is ADD delta that adds values of the item present in the object being added - if OD is MODIFY delta: ID is such delta that: 1. Given ANY object O, let O' be O after application of OD. 2. Let I be O(itemPath), I' be O'(itemPath). 3. Then I' is the same as I after application of ID. ID is null if no such item delta exists - or cannot be found easily.
Problem: - If OD contains more than one modification that affects itemPath the results from findItemDelta can be differ from the above definition.
- Specified by:
findItemDelta
in interfaceObjectDelta<O extends Objectable>
-
findItemDelta
public <IV extends PrismValue,ID extends ItemDefinition> ItemDelta<IV,ID> findItemDelta(ItemPath itemPath, boolean strict)
- Specified by:
findItemDelta
in interfaceObjectDelta<O extends Objectable>
-
findItemDelta
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>,DD extends ItemDelta<IV,ID>> DD findItemDelta(ItemPath propertyPath, Class<DD> deltaType, Class<I> itemType, boolean strict)
- Specified by:
findItemDelta
in interfaceObjectDelta<O extends Objectable>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition> Collection<PartiallyResolvedDelta<IV,ID>> findPartial(ItemPath propertyPath)
- Specified by:
findPartial
in interfaceObjectDelta<O extends Objectable>
-
hasItemDelta
public boolean hasItemDelta(ItemPath propertyPath)
- Specified by:
hasItemDelta
in interfaceObjectDelta<O extends Objectable>
-
hasItemOrSubitemDelta
public boolean hasItemOrSubitemDelta(ItemPath propertyPath)
- Specified by:
hasItemOrSubitemDelta
in interfaceObjectDelta<O extends Objectable>
-
hasCompleteDefinition
public boolean hasCompleteDefinition()
- Specified by:
hasCompleteDefinition
in interfaceObjectDelta<O extends Objectable>
-
getObjectTypeClass
public Class<O> getObjectTypeClass()
- Specified by:
getObjectTypeClass
in interfaceObjectDelta<O extends Objectable>
-
setObjectTypeClass
public void setObjectTypeClass(Class<O> objectTypeClass)
- Specified by:
setObjectTypeClass
in interfaceObjectDelta<O extends Objectable>
-
performFreeze
protected void performFreeze()
- Overrides:
performFreeze
in classAbstractFreezable
-
findPropertyDelta
public <X> PropertyDelta<X> findPropertyDelta(ItemPath parentPath, QName propertyName)
Top-level path is assumed.- Specified by:
findPropertyDelta
in interfaceObjectDelta<O extends Objectable>
-
findPropertyDelta
public <X> PropertyDelta<X> findPropertyDelta(ItemPath propertyPath)
- Specified by:
findPropertyDelta
in interfaceObjectDelta<O extends Objectable>
-
findContainerDelta
public <X extends Containerable> ContainerDelta<X> findContainerDelta(ItemPath propertyPath)
- Specified by:
findContainerDelta
in interfaceObjectDelta<O extends Objectable>
-
findReferenceModification
public ReferenceDelta findReferenceModification(ItemPath itemPath)
- Specified by:
findReferenceModification
in interfaceObjectDelta<O extends Objectable>
-
findItemDeltasSubPath
@NotNull public @NotNull Collection<? extends ItemDelta<?,?>> findItemDeltasSubPath(ItemPath itemPath)
Returns all item deltas at or below a specified path.- Specified by:
findItemDeltasSubPath
in interfaceObjectDelta<O extends Objectable>
-
removeModification
public void removeModification(ItemDelta<?,?> itemDelta)
- Specified by:
removeModification
in interfaceObjectDelta<O extends Objectable>
-
removeReferenceModification
public void removeReferenceModification(ItemPath itemPath)
- Specified by:
removeReferenceModification
in interfaceObjectDelta<O extends Objectable>
-
removeContainerModification
public void removeContainerModification(ItemPath itemName)
- Specified by:
removeContainerModification
in interfaceObjectDelta<O extends Objectable>
-
removePropertyModification
public void removePropertyModification(ItemPath itemPath)
- Specified by:
removePropertyModification
in interfaceObjectDelta<O extends Objectable>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceObjectDelta<O extends Objectable>
-
normalize
public void normalize()
- Specified by:
normalize
in interfaceObjectDelta<O extends Objectable>
-
narrow
public ObjectDeltaImpl<O> narrow(PrismObject<O> existingObject, @NotNull @NotNull ParameterizedEquivalenceStrategy plusStrategy, @NotNull @NotNull ParameterizedEquivalenceStrategy minusStrategy, boolean assumeMissingItems)
- Specified by:
narrow
in interfaceObjectDelta<O extends Objectable>
-
applyDefinitionIfPresent
public void applyDefinitionIfPresent(PrismObjectDefinition<O> definition, boolean tolerateNoDefinition) throws SchemaException
- Specified by:
applyDefinitionIfPresent
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
clone
public ObjectDeltaImpl<O> clone()
Deep clone.- Specified by:
clone
in interfaceObjectDelta<O extends Objectable>
- Overrides:
clone
in classObject
-
copyValues
protected void copyValues(ObjectDeltaImpl<O> clone)
-
merge
public void merge(ObjectDelta<O> deltaToMerge) throws SchemaException
Merge provided delta into this delta. This delta is assumed to be chronologically earlier, delta in the parameter is assumed to come chronologicaly later.- Specified by:
merge
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
mergeModifications
public void mergeModifications(Collection<? extends ItemDelta> modificationsToMerge) throws SchemaException
- Specified by:
mergeModifications
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
mergeModification
public void mergeModification(ItemDelta<?,?> modificationToMerge) throws SchemaException
- Specified by:
mergeModification
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
swallow
public void swallow(ItemDelta<?,?> newItemDelta) throws SchemaException
Incorporates the property delta into the existing property deltas (regardless of the change type).TODO incorporate equivalence strategy
- Specified by:
swallow
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
applyTo
public void applyTo(PrismObject<O> targetObject) throws SchemaException
Description copied from interface:ObjectDelta
Applies this object delta to specified object, returns updated object. It modifies the provided object.- Specified by:
applyTo
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
computeChangedObject
public PrismObject<O> computeChangedObject(PrismObject<O> objectOld) throws SchemaException
Applies this object delta to specified object, returns updated object. It leaves the original object unchanged.- Specified by:
computeChangedObject
in interfaceObjectDelta<O extends Objectable>
- Parameters:
objectOld
- object before change- Returns:
- object with applied changes or null if the object should not exit (was deleted)
- Throws:
SchemaException
-
swallow
public void swallow(List<ItemDelta<?,?>> itemDeltas) throws SchemaException
- Specified by:
swallow
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
createPropertyModification
public <X> PropertyDelta<X> createPropertyModification(ItemPath path)
- Specified by:
createPropertyModification
in interfaceObjectDelta<O extends Objectable>
-
createPropertyModification
public <C> PropertyDelta<C> createPropertyModification(ItemPath path, PrismPropertyDefinition propertyDefinition)
- Specified by:
createPropertyModification
in interfaceObjectDelta<O extends Objectable>
-
createReferenceModification
public ReferenceDelta createReferenceModification(QName name, PrismReferenceDefinition referenceDefinition)
-
createReferenceModification
public ReferenceDelta createReferenceModification(ItemPath path, PrismReferenceDefinition referenceDefinition)
- Specified by:
createReferenceModification
in interfaceObjectDelta<O extends Objectable>
-
createContainerModification
public <C extends Containerable> ContainerDelta<C> createContainerModification(ItemPath path)
- Specified by:
createContainerModification
in interfaceObjectDelta<O extends Objectable>
-
createContainerModification
public <C extends Containerable> ContainerDelta<C> createContainerModification(ItemPath path, PrismContainerDefinition<C> containerDefinition)
- Specified by:
createContainerModification
in interfaceObjectDelta<O extends Objectable>
-
addModificationReplaceProperty
@SafeVarargs public final <X> PropertyDelta<X> addModificationReplaceProperty(ItemPath propertyPath, X... propertyValues)
- Specified by:
addModificationReplaceProperty
in interfaceObjectDelta<O extends Objectable>
-
addModificationAddProperty
@SafeVarargs public final <X> void addModificationAddProperty(ItemPath propertyPath, X... propertyValues)
- Specified by:
addModificationAddProperty
in interfaceObjectDelta<O extends Objectable>
-
addModificationDeleteProperty
public <X> void addModificationDeleteProperty(ItemPath propertyPath, X... propertyValues)
- Specified by:
addModificationDeleteProperty
in interfaceObjectDelta<O extends Objectable>
-
addModificationAddContainer
public <C extends Containerable> void addModificationAddContainer(ItemPath propertyPath, C... containerables) throws SchemaException
- Specified by:
addModificationAddContainer
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
addModificationAddContainer
public <C extends Containerable> void addModificationAddContainer(ItemPath propertyPath, PrismContainerValue<C>... containerValues)
- Specified by:
addModificationAddContainer
in interfaceObjectDelta<O extends Objectable>
-
addModificationDeleteContainer
public <C extends Containerable> void addModificationDeleteContainer(ItemPath propertyPath, C... containerables) throws SchemaException
- Specified by:
addModificationDeleteContainer
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
addModificationDeleteContainer
public <C extends Containerable> void addModificationDeleteContainer(ItemPath propertyPath, PrismContainerValue<C>... containerValues)
- Specified by:
addModificationDeleteContainer
in interfaceObjectDelta<O extends Objectable>
-
addModificationReplaceContainer
public <C extends Containerable> void addModificationReplaceContainer(ItemPath propertyPath, PrismContainerValue<C>... containerValues)
- Specified by:
addModificationReplaceContainer
in interfaceObjectDelta<O extends Objectable>
-
addModificationAddReference
public void addModificationAddReference(ItemPath path, PrismReferenceValue... refValues)
- Specified by:
addModificationAddReference
in interfaceObjectDelta<O extends Objectable>
-
addModificationDeleteReference
public void addModificationDeleteReference(ItemPath path, PrismReferenceValue... refValues)
- Specified by:
addModificationDeleteReference
in interfaceObjectDelta<O extends Objectable>
-
addModificationReplaceReference
public void addModificationReplaceReference(ItemPath path, PrismReferenceValue... refValues)
- Specified by:
addModificationReplaceReference
in interfaceObjectDelta<O extends Objectable>
-
createReferenceModification
public ReferenceDelta createReferenceModification(ItemPath refPath)
- Specified by:
createReferenceModification
in interfaceObjectDelta<O extends Objectable>
-
createEmptyModifyDelta
public static <O extends Objectable> ObjectDeltaImpl<O> createEmptyModifyDelta(Class<O> type, String oid, PrismContext prismContext)
-
createEmptyDeleteDelta
public static <O extends Objectable> ObjectDeltaImpl<O> createEmptyDeleteDelta(Class<O> type, String oid, PrismContext prismContext)
-
createEmptyDelta
public static <O extends Objectable> ObjectDeltaImpl<O> createEmptyDelta(Class<O> type, String oid, PrismContext prismContext, ChangeType changeType)
-
createAddDelta
public static <O extends Objectable> ObjectDeltaImpl<O> createAddDelta(PrismObject<O> objectToAdd)
-
createDeleteDelta
public static <O extends Objectable> ObjectDeltaImpl<O> createDeleteDelta(Class<O> type, String oid, PrismContext prismContext)
-
createReverseDelta
public ObjectDeltaImpl<O> createReverseDelta() throws SchemaException
- Specified by:
createReverseDelta
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
checkConsistence
public void checkConsistence()
- Specified by:
checkConsistence
in interfaceObjectDelta<O extends Objectable>
-
checkConsistence
public void checkConsistence(ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceObjectDelta<O extends Objectable>
-
checkConsistence
public void checkConsistence(boolean requireOid, boolean requireDefinition, boolean prohibitRaw)
- Specified by:
checkConsistence
in interfaceObjectDelta<O extends Objectable>
-
checkConsistence
public void checkConsistence(boolean requireOid, boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceObjectDelta<O extends Objectable>
-
checkIdentifierConsistence
protected void checkIdentifierConsistence(boolean requireOid)
-
assertDefinitions
public void assertDefinitions() throws SchemaException
- Specified by:
assertDefinitions
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(Supplier<String> sourceDescription) throws SchemaException
- Specified by:
assertDefinitions
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(boolean tolerateRawElements) throws SchemaException
- Specified by:
assertDefinitions
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(boolean tolerateRawElements, Supplier<String> sourceDescriptionSupplier) throws SchemaException
Assert that all the items has appropriate definition.- Specified by:
assertDefinitions
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
revive
public void revive(PrismContext prismContext) throws SchemaException
- Specified by:
revive
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
applyDefinition
public void applyDefinition(PrismObjectDefinition<O> objectDefinition, boolean force) throws SchemaException
- Specified by:
applyDefinition
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
equivalent
public boolean equivalent(ObjectDelta o)
- Specified by:
equivalent
in interfaceObjectDelta<O extends Objectable>
-
debugName
protected String debugName()
-
debugIdentifiers
protected String debugIdentifiers()
-
toDebugType
public String toDebugType()
Returns short string identification of object type. It should be in a form suitable for log messages. There is no requirement for the type name to be unique, but it rather has to be compact. E.g. short element names are preferred to long QNames or URIs.- Specified by:
toDebugType
in interfaceObjectDelta<O extends Objectable>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
subtract
public ObjectDeltaImpl<O> subtract(@NotNull @NotNull Collection<ItemPath> paths)
Returns modifications that are related to the given paths; removes them from the original delta. Applicable only to modify deltas. Currently compares paths by "equals" predicate -- in the future we might want to treat sub/super/equivalent paths! So consider this method highly experimental.- Specified by:
subtract
in interfaceObjectDelta<O extends Objectable>
-
factorOut
@NotNull public @NotNull ObjectDelta.FactorOutResultSingle<O> factorOut(Collection<? extends ItemPath> paths, boolean cloneDelta)
- Specified by:
factorOut
in interfaceObjectDelta<O extends Objectable>
-
factorOutValues
@NotNull public @NotNull ObjectDelta.FactorOutResultMulti<O> factorOutValues(ItemPath path, boolean cloneDelta) throws SchemaException
- Specified by:
factorOutValues
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
subtract
public boolean subtract(@NotNull @NotNull ItemPath itemPath, @NotNull @NotNull PrismValue value, boolean fromMinusSet, boolean dryRun)
Checks if the delta tries to add (or set) a 'value' for the item identified by 'itemPath'. If yes, it removes it.TODO consider changing return value to 'incremental delta' (or null)
- Specified by:
subtract
in interfaceObjectDelta<O extends Objectable>
- Parameters:
dryRun
- only testing if value could be subtracted; not changing anything- Returns:
- true if the delta originally contained an instruction to add (or set) 'itemPath' to 'value'.
-
getModifiedItems
@NotNull public @NotNull List<ItemPath> getModifiedItems()
- Specified by:
getModifiedItems
in interfaceObjectDelta<O extends Objectable>
-
getNewValuesFor
public List<PrismValue> getNewValuesFor(ItemPath itemPath)
- Specified by:
getNewValuesFor
in interfaceObjectDelta<O extends Objectable>
-
getDeletedValuesFor
public List<PrismValue> getDeletedValuesFor(ItemPath itemPath)
Limitations: (1) For DELETE object delta, we don't know what values were in the object's item. (2) For REPLACE item delta, we don't know what values were in the object's item (but these deltas are quite rare for multivalued items; and eventually there will be normalized into ADD+DELETE form) (3) For DELETE item delta for PrismContainers, content of items deleted might not be known (only ID could be provided on PCVs).- Specified by:
getDeletedValuesFor
in interfaceObjectDelta<O extends Objectable>
-
clear
public void clear()
- Specified by:
clear
in interfaceObjectDelta<O extends Objectable>
-
isRedundant
public boolean isRedundant(PrismObject<O> object, @NotNull @NotNull ParameterizedEquivalenceStrategy plusStrategy, @NotNull @NotNull ParameterizedEquivalenceStrategy minusStrategy, boolean assumeMissingItems) throws SchemaException
Description copied from interface:ObjectDelta
Check if delta is redundant w.r.t. given object - i.e. if its application would have no visible effect on that object.- Specified by:
isRedundant
in interfaceObjectDelta<O extends Objectable>
- Throws:
SchemaException
-
removeOperationalItems
@Experimental public void removeOperationalItems()
- Specified by:
removeOperationalItems
in interfaceObjectDelta<O extends Objectable>
-
removeEstimatedOldValues
@Experimental public void removeEstimatedOldValues()
- Specified by:
removeEstimatedOldValues
in interfaceObjectDelta<O extends Objectable>
-
-