Class ReferenceChangeTracker
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.util.ReferenceChangeTracker
-
public class ReferenceChangeTracker extends Object
Simple helper class that can be used to keep track of uuid mappings (e.g. if the uuid of an imported or copied node is mapped to a new uuid) and processed (e.g. imported or copied) reference properties that might need correcting depending on the uuid mappings.
-
-
Constructor Summary
Constructors Constructor Description ReferenceChangeTracker()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Resets all internal state.QValuegetMappedReference(QValue oldReference, QValueFactory factory)Returns the new UUID to whicholdUUIDhas been mapped ornullif no such mapping exists.Iterator<PropertyState>getReferences()voidmappedUUIDs(String oldUUID, String newUUID)Store the given uuid mapping for later lookup using#adjustReferences(UpdatableItemStateManager, ItemStateValidator).voidprocessedReference(PropertyState refPropertyState)Store the given reference property for later resolution.
-
-
-
Method Detail
-
clear
public void clear()
Resets all internal state.
-
mappedUUIDs
public void mappedUUIDs(String oldUUID, String newUUID)
Store the given uuid mapping for later lookup using#adjustReferences(UpdatableItemStateManager, ItemStateValidator).- Parameters:
oldUUID-newUUID-
-
getMappedReference
public QValue getMappedReference(QValue oldReference, QValueFactory factory)
Returns the new UUID to whicholdUUIDhas been mapped ornullif no such mapping exists.- Parameters:
oldReference- old uuid represented by the givenQValue.factory-- Returns:
- mapped new QValue of the reference value or
nullif no such mapping exists - See Also:
mappedUUIDs(String,String)
-
processedReference
public void processedReference(PropertyState refPropertyState)
Store the given reference property for later resolution.- Parameters:
refPropertyState- reference property state
-
getReferences
public Iterator<PropertyState> getReferences()
-
-