Package org.apache.jackrabbit.core.util
Class ReferenceChangeTracker
- java.lang.Object
-
- org.apache.jackrabbit.core.util.ReferenceChangeTracker
-
public class ReferenceChangeTracker extends Object
Simple helper class that can be used to keep track of node id mappings (e.g. if the id of an imported or copied node is mapped to a new id) and processed (e.g. imported or copied) reference properties that might need correcting depending on the id mappings.
-
-
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.NodeId
getMappedId(NodeId oldId)
Returns the new node id to whicholdId
has been mapped ornull
if no such mapping exists.Iterator<Object>
getProcessedReferences()
Returns an iterator over all processed reference properties.void
mappedId(NodeId oldId, NodeId newId)
Store the given id mapping for later lookup using
.getMappedId(NodeId)
void
processedReference(Object refProp)
Store the given reference property for later retrieval using
.getProcessedReferences()
boolean
removeReferences(List<Object> processedReferences)
Remove the given references that have already been processed from the references list.
-
-
-
Method Detail
-
clear
public void clear()
Resets all internal state.
-
mappedId
public void mappedId(NodeId oldId, NodeId newId)
Store the given id mapping for later lookup using
.getMappedId(NodeId)
- Parameters:
oldId
- old node idnewId
- new node id
-
processedReference
public void processedReference(Object refProp)
Store the given reference property for later retrieval using
.getProcessedReferences()
- Parameters:
refProp
- reference property
-
getMappedId
public NodeId getMappedId(NodeId oldId)
Returns the new node id to whicholdId
has been mapped ornull
if no such mapping exists.- Parameters:
oldId
- old node id- Returns:
- mapped new id or
null
if no such mapping exists - See Also:
mappedId(NodeId, NodeId)
-
getProcessedReferences
public Iterator<Object> getProcessedReferences()
Returns an iterator over all processed reference properties.- Returns:
- an iterator over all processed reference properties
- See Also:
processedReference(Object)
-
-