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 Summary
Constructors Constructor Description ContainerValueIdGenerator(@NotNull PrismObject<S> object)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerValueIdGenerator
forModifyObject(long containerIdSeq)
Initializes the generator for modify object and checks that no previous CIDs are missing.long
generateForNewObject()
Method inserts IDs for prism container values without IDs and returns highest CID.int
getGenerated()
boolean
isOverwrittenId(Long id)
long
lastUsedId()
long
nextId()
void
processModification(ItemDelta<?,?> modification)
This checks the modification for containers without assigned CIDs and adds them.
-
-
-
Constructor Detail
-
ContainerValueIdGenerator
public ContainerValueIdGenerator(@NotNull @NotNull PrismObject<S> object)
-
-
Method Detail
-
generateForNewObject
public long generateForNewObject() throws SchemaException
Method inserts IDs for prism container values without IDs and returns highest CID. This directly changes the object provided as a parameter, if necessary.- Throws:
SchemaException
-
forModifyObject
public ContainerValueIdGenerator forModifyObject(long containerIdSeq) throws SchemaException
Initializes the generator for modify object and checks that no previous CIDs are missing. This is a critical step before callingprocessModification(com.evolveum.midpoint.prism.delta.ItemDelta<?, ?>)
.- Throws:
SchemaException
-
processModification
public void processModification(ItemDelta<?,?> modification) throws SchemaException
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.- Throws:
SchemaException
-
nextId
public long nextId()
-
getGenerated
public int getGenerated()
-
lastUsedId
public long lastUsedId()
-
isOverwrittenId
public boolean isOverwrittenId(Long id)
-
-