Class ContainerValueIdGenerator

java.lang.Object
com.evolveum.midpoint.schema.util.cid.ContainerValueIdGenerator

public class ContainerValueIdGenerator extends Object
Generator assigning missing IDs to PCVs of multi-value containers. Originally internal to "new repo" (sqale), now used also from the lens (clockwork) - when simulating the effect of deltas on the objects during execution of operations in simulation mode.
  • Constructor Details

    • ContainerValueIdGenerator

      public ContainerValueIdGenerator(@NotNull @NotNull PrismObject<? extends ObjectType> object)
  • Method Details

    • generateForNewObject

      public long generateForNewObject()
      Method inserts IDs for prism container values without IDs and returns highest CID. This directly changes the object provided as a parameter, if necessary.
    • forModifyObject

      public ContainerValueIdGenerator forModifyObject(long containerIdSeq)
      Initializes the generator for modify object and checks that no previous CIDs are missing. This is a critical step before calling processModification(com.evolveum.midpoint.prism.delta.ItemDelta<?, ?>).
    • processModification

      public void processModification(ItemDelta<?,?> modification)
      This checks the modification for containers without assigned CIDs and adds them. This changes values inside the modification and this *must be called before the modification is applied to the prism object*. Theoretically, the changes may affect the prism object after the fact, but if any cloning is involved this may not be true, so preferably use this *before* applying the modification.
    • getGenerated

      public int getGenerated()
    • lastUsedId

      public long lastUsedId()
    • isOverwrittenId

      public boolean isOverwrittenId(Long id)