org.chromattic.core.jcr
Class AbstractLinkManager

java.lang.Object
  extended by org.chromattic.core.jcr.AbstractLinkManager
Direct Known Subclasses:
PathLinkManager, ReferenceLinkManager

public abstract class AbstractLinkManager
extends Object

The reference manager takes care of managing references between nodes. The main reason is that JCR reference management is a bit weird about the usage of Node#getReferences(). The goal of this class is to manage one to many relationships between nodes and their consistency.

The life time of this object is valid from the beginning of the session until the session or a portion of the session is saved. When a session is saved, the clear operation will reset the state of the reference manager.

Version:
$Revision$
Author:
Julien Viet

Field Summary
protected  javax.jcr.Session session
          .
 
Constructor Summary
AbstractLinkManager(javax.jcr.Session session)
           
 
Method Summary
protected abstract  javax.jcr.Node _getReferenced(javax.jcr.Property property)
           
protected abstract  Iterator<javax.jcr.Node> _getReferents(javax.jcr.Node referenced, String propertyName)
           
protected abstract  void _setReferenced(javax.jcr.Node referent, String propertyName, javax.jcr.Node referenced)
           
 void clear()
           
 javax.jcr.Node getReferenced(javax.jcr.Node referent, String propertyName)
           
 Iterator<javax.jcr.Node> getReferents(javax.jcr.Node referenced, String propertyName)
           
 javax.jcr.Node setReferenced(javax.jcr.Node referent, String propertyName, javax.jcr.Node referenced)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected final javax.jcr.Session session
.

Constructor Detail

AbstractLinkManager

public AbstractLinkManager(javax.jcr.Session session)
Method Detail

getReferents

public Iterator<javax.jcr.Node> getReferents(javax.jcr.Node referenced,
                                             String propertyName)
                                      throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getReferenced

protected abstract javax.jcr.Node _getReferenced(javax.jcr.Property property)
                                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_setReferenced

protected abstract void _setReferenced(javax.jcr.Node referent,
                                       String propertyName,
                                       javax.jcr.Node referenced)
                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getReferents

protected abstract Iterator<javax.jcr.Node> _getReferents(javax.jcr.Node referenced,
                                                          String propertyName)
                                                   throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getReferenced

public javax.jcr.Node getReferenced(javax.jcr.Node referent,
                                    String propertyName)
                             throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

setReferenced

public javax.jcr.Node setReferenced(javax.jcr.Node referent,
                                    String propertyName,
                                    javax.jcr.Node referenced)
                             throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

clear

public void clear()


Copyright © 2009 eXo Platform SAS. All Rights Reserved.