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 SummaryConstructors Constructor Description ContainerValueIdGenerator(@NotNull PrismObject<S> object)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerValueIdGeneratorforModifyObject(long containerIdSeq)Initializes the generator for modify object and checks that no previous CIDs are missing.longgenerateForNewObject()Method inserts IDs for prism container values without IDs and returns highest CID.intgetGenerated()booleanisOverwrittenId(Long id)longlastUsedId()longnextId()voidprocessModification(ItemDelta<?,?> modification)This checks the modification for containers without assigned CIDs and adds them.
 
- 
- 
- 
Constructor Detail- 
ContainerValueIdGeneratorpublic ContainerValueIdGenerator(@NotNull @NotNull PrismObject<S> object)
 
- 
 - 
Method Detail- 
generateForNewObjectpublic long generateForNewObject() throws SchemaExceptionMethod 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
 
 - 
forModifyObjectpublic 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
 
 - 
processModificationpublic 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
 
 - 
nextIdpublic long nextId() 
 - 
getGeneratedpublic int getGenerated() 
 - 
lastUsedIdpublic long lastUsedId() 
 - 
isOverwrittenIdpublic boolean isOverwrittenId(Long id) 
 
- 
 
-