Interface ObjectDelta<O extends Objectable>

    • Method Detail

      • accept

        void accept​(Visitor visitor,
                    boolean includeOldValues)
      • setChangeType

        void setChangeType​(ChangeType changeType)
      • isAdd

        static boolean isAdd​(ObjectDelta<?> objectDelta)
      • isAdd

        boolean isAdd()
      • isDelete

        static boolean isDelete​(ObjectDelta<?> objectDelta)
      • isDelete

        boolean isDelete()
      • isModify

        static boolean isModify​(ObjectDelta<?> objectDelta)
      • isModify

        boolean isModify()
      • setOid

        void setOid​(String oid)
      • setPrismContext

        void setPrismContext​(PrismContext prismContext)
      • setObjectToAdd

        void setObjectToAdd​(PrismObject<O> objectToAdd)
      • addModification

        <D extends ItemDelta> D addModification​(D itemDelta)
        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.
      • containsModification

        boolean containsModification​(ItemDelta itemDelta)
      • addModifications

        void addModifications​(ItemDelta<?,​?>... itemDeltas)
      • findItemDelta

        <IV extends PrismValue,​ID extends ItemDefinitionItemDelta<IV,​ID> findItemDelta​(ItemPath itemPath)
        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.
      • hasItemDelta

        boolean hasItemDelta​(ItemPath propertyPath)
      • hasItemOrSubitemDelta

        boolean hasItemOrSubitemDelta​(ItemPath propertyPath)
      • hasCompleteDefinition

        boolean hasCompleteDefinition()
      • getObjectTypeClass

        Class<O> getObjectTypeClass()
      • setObjectTypeClass

        void setObjectTypeClass​(Class<O> objectTypeClass)
      • findPropertyDelta

        <X> PropertyDelta<X> findPropertyDelta​(ItemPath parentPath,
                                               QName propertyName)
        Top-level path is assumed.
      • findItemDeltasSubPath

        Collection<? extends ItemDelta<?,​?>> findItemDeltasSubPath​(ItemPath itemPath)
        Returns all item deltas at or below a specified path.
      • removeModification

        <D extends ItemDelta> void removeModification​(ItemDelta<?,​?> itemDelta)
      • removeReferenceModification

        void removeReferenceModification​(ItemPath itemPath)
      • removeContainerModification

        void removeContainerModification​(ItemPath itemName)
      • removePropertyModification

        void removePropertyModification​(ItemPath itemPath)
      • isEmpty

        boolean isEmpty()
      • normalize

        void normalize()
      • merge

        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.
        Throws:
        SchemaException
      • computeChangedObject

        PrismObject<O> computeChangedObject​(PrismObject<O> objectOld)
                                     throws SchemaException
        Applies this object delta to specified object, returns updated object. It leaves the original object unchanged.
        Parameters:
        objectOld - object before change
        Returns:
        object with applied changes or null if the object should not exit (was deleted)
        Throws:
        SchemaException
      • swallow

        void swallow​(ItemDelta<?,​?> newItemDelta)
              throws SchemaException
        Incorporates the property delta into the existing property deltas (regardless of the change type).
        Throws:
        SchemaException
      • addModificationReplaceProperty

        <X> PropertyDelta<X> addModificationReplaceProperty​(ItemPath propertyPath,
                                                            X... propertyValues)
      • addModificationAddProperty

        <X> void addModificationAddProperty​(ItemPath propertyPath,
                                            X... propertyValues)
      • addModificationDeleteProperty

        <X> void addModificationDeleteProperty​(ItemPath propertyPath,
                                               X... propertyValues)
      • checkConsistence

        void checkConsistence()
      • checkConsistence

        void checkConsistence​(boolean requireOid,
                              boolean requireDefinition,
                              boolean prohibitRaw)
      • checkConsistence

        void checkConsistence​(boolean requireOid,
                              boolean requireDefinition,
                              boolean prohibitRaw,
                              ConsistencyCheckScope scope)
      • assertDefinitions

        void assertDefinitions​(boolean tolerateRawElements,
                               String sourceDescription)
                        throws SchemaException
        Assert that all the items has appropriate definition.
        Throws:
        SchemaException
      • equivalent

        boolean equivalent​(ObjectDelta other)
      • toDebugType

        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.
        Returns:
      • isEmpty

        static boolean isEmpty​(ObjectDelta delta)
      • subtract

        ObjectDelta<O> subtract​(@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.
        Parameters:
        paths -
        Returns:
      • subtract

        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'. If yes, it removes it. TODO consider changing return value to 'incremental delta' (or null)
        Parameters:
        itemPath -
        value -
        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
        List<ItemPath> getModifiedItems()
      • getDeletedValuesFor

        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).
      • clear

        void clear()
      • isImmutable

        boolean isImmutable()
      • setImmutable

        void setImmutable​(boolean immutable)