org.apache.jackrabbit.core.util
Class ReferenceChangeTracker

java.lang.Object
  extended byorg.apache.jackrabbit.core.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
ReferenceChangeTracker()
          Creates a new instance.
 
Method Summary
 void clear()
          Resets all internal state.
 UUID getMappedUUID(UUID oldUUID)
          Returns the new UUID to which oldUUID has been mapped or null if no such mapping exists.
 Iterator getProcessedReferences()
          Returns an iterator over all processed reference properties.
 void mappedUUID(UUID oldUUID, UUID newUUID)
          Store the given uuid mapping for later lookup using getMappedUUID(UUID).
 void processedReference(Object refProp)
          Store the given reference property for later retrieval using getProcessedReferences().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceChangeTracker

public ReferenceChangeTracker()
Creates a new instance.

Method Detail

clear

public void clear()
Resets all internal state.


mappedUUID

public void mappedUUID(UUID oldUUID,
                       UUID newUUID)
Store the given uuid mapping for later lookup using getMappedUUID(UUID).

Parameters:
oldUUID - old uuid
newUUID - new uuid

processedReference

public void processedReference(Object refProp)
Store the given reference property for later retrieval using getProcessedReferences().

Parameters:
refProp - reference property

getMappedUUID

public UUID getMappedUUID(UUID oldUUID)
Returns the new UUID to which oldUUID has been mapped or null if no such mapping exists.

Parameters:
oldUUID - old uuid
Returns:
mapped new uuid or null if no such mapping exists
See Also:
mappedUUID(UUID, UUID)

getProcessedReferences

public Iterator getProcessedReferences()
Returns an iterator over all processed reference properties.

Returns:
an iterator over all processed reference properties
See Also:
processedReference(Object)


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.