Class ReferenceChangeTracker

java.lang.Object
org.apache.jackrabbit.oak.spi.xml.ReferenceChangeTracker

public class ReferenceChangeTracker extends 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:
  • Constructor Details

    • ReferenceChangeTracker

      public ReferenceChangeTracker()
  • Method Details

    • get

      @Nullable public @Nullable String get(@NotNull @NotNull String oldUUID)
      Returns the new node id to which oldUUID has been mapped or null if no such mapping exists.
      Parameters:
      oldUUID - old node id
      Returns:
      mapped new id or null if no such mapping exists
      See Also:
    • put

      public void put(@NotNull @NotNull String oldUUID, @NotNull @NotNull String newUUID)
      Store the given id mapping for later lookup using get(String).
      Parameters:
      oldUUID - old node id
      newUUID - new node id
    • clear

      public void clear()
      Resets all internal state.
    • processedReference

      public void processedReference(@NotNull @NotNull Object refProp)
      Store the given reference property for later retrieval using getProcessedReferences().
      Parameters:
      refProp - reference property
    • getProcessedReferences

      @NotNull public @NotNull Iterator<Object> getProcessedReferences()
      Returns an iterator over all processed reference properties.
      Returns:
      an iterator over all processed reference properties
      See Also:
    • removeReferences

      public boolean removeReferences(List<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.