Class ReferenceChangeTracker
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.xml.ReferenceChangeTracker
-
public class ReferenceChangeTracker extends java.lang.Object
Helper class 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 to be adjusted depending on the UUID mapping resulting from the import.- See Also:
ImportUUIDBehavior
-
-
Constructor Summary
Constructors Constructor Description ReferenceChangeTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Resets all internal state.@Nullable java.lang.String
get(@NotNull java.lang.String oldUUID)
Returns the new node id to whicholdUUID
has been mapped ornull
if no such mapping exists.@NotNull java.util.Iterator<java.lang.Object>
getProcessedReferences()
Returns an iterator over all processed reference properties.void
processedReference(@NotNull java.lang.Object refProp)
Store the given reference property for later retrieval usinggetProcessedReferences()
.void
put(@NotNull java.lang.String oldUUID, @NotNull java.lang.String newUUID)
Store the given id mapping for later lookup usingget(String)
.boolean
removeReferences(java.util.List<java.lang.Object> processedReferences)
Remove the given references that have already been processed from the references list.
-
-
-
Method Detail
-
get
@Nullable public @Nullable java.lang.String get(@NotNull @NotNull java.lang.String oldUUID)
Returns the new node id to whicholdUUID
has been mapped ornull
if no such mapping exists.- Parameters:
oldUUID
- old node id- Returns:
- mapped new id or
null
if no such mapping exists - See Also:
put(String, String)
-
put
public void put(@NotNull @NotNull java.lang.String oldUUID, @NotNull @NotNull java.lang.String newUUID)
Store the given id mapping for later lookup usingget(String)
.- Parameters:
oldUUID
- old node idnewUUID
- new node id
-
clear
public void clear()
Resets all internal state.
-
processedReference
public void processedReference(@NotNull @NotNull java.lang.Object refProp)
Store the given reference property for later retrieval usinggetProcessedReferences()
.- Parameters:
refProp
- reference property
-
getProcessedReferences
@NotNull public @NotNull java.util.Iterator<java.lang.Object> getProcessedReferences()
Returns an iterator over all processed reference properties.- Returns:
- an iterator over all processed reference properties
- See Also:
processedReference(Object)
-
removeReferences
public boolean removeReferences(java.util.List<java.lang.Object> processedReferences)
Remove the given references that have already been processed from the references list.- Parameters:
processedReferences
- List of processed references to be removed.- Returns:
true
if the internal list of references changed.
-
-