org.apache.jackrabbit.jcr2spi.util
Class ReferenceChangeTracker

java.lang.Object
  extended by 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
ReferenceChangeTracker()
          Creates a new instance.
 
Method Summary
 void clear()
          Resets all internal state.
 QValue getMappedReference(QValue oldReference, QValueFactory factory)
          Returns the new UUID to which oldUUID has been mapped or null if no such mapping exists.
 Iterator<PropertyState> getReferences()
           
 void mappedUUIDs(String oldUUID, String newUUID)
          Store the given uuid mapping for later lookup using #adjustReferences(UpdatableItemStateManager, ItemStateValidator).
 void processedReference(PropertyState refPropertyState)
          Store the given reference property for later resolution.
 
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.


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 which oldUUID has been mapped or null if no such mapping exists.

Parameters:
oldReference - old uuid represented by the given QValue.
factory -
Returns:
mapped new QValue of the reference value or null if 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()


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