org.chromattic.core.jcr
Class SessionWrapperImpl

java.lang.Object
  extended by org.chromattic.core.jcr.SessionWrapperImpl
All Implemented Interfaces:
SessionWrapper

public class SessionWrapperImpl
extends Object
implements SessionWrapper

Version:
$Revision$
Author:
Julien Viet

Field Summary
 javax.jcr.Session session
          .
 
Constructor Summary
SessionWrapperImpl(SessionLifeCycle sessionLifeCycle, javax.jcr.Session session, boolean hasPropertyOptimized, boolean hasNodeOptimized)
           
 
Method Summary
 javax.jcr.Node addNode(javax.jcr.Node parentNode, String relPath, String primartyNodeTypeName, List<String> mixinNodeTypeNames)
           
 void cleanReferencesForRemoval(javax.jcr.Node node)
          Need to find a way to optimized this method as it forces us to visit the entire children hierarchy.
 void close()
           
 boolean equals(Object obj)
           
 javax.jcr.Node getChild(javax.jcr.Node parentNode, String name)
           
 Iterator<javax.jcr.Node> getChildren(javax.jcr.Node parentNode)
           
 javax.jcr.Node getNode(javax.jcr.Node node, String relPath)
           
 javax.jcr.Node getNodeByUUID(String uuid)
           
 javax.jcr.nodetype.NodeType getNodeType(String nodeTypeName)
           
 javax.jcr.Node getParent(javax.jcr.Node childNode)
           
 javax.jcr.Property getProperty(javax.jcr.Node node, String relPath)
           
 javax.jcr.Node getReferenced(javax.jcr.Node referent, String propertyName, LinkType linkType)
           
 Iterator<javax.jcr.Node> getReferents(javax.jcr.Node referenced, String propertyName, LinkType linkType)
           
 javax.jcr.Session getSession()
           
 int hashCode()
           
 void move(javax.jcr.Node srcNode, javax.jcr.Node dstNode)
           
 void orderBefore(javax.jcr.Node parentNode, javax.jcr.Node srcNode, javax.jcr.Node dstNode)
           
 void remove(javax.jcr.Node node)
          Remove a node recursively in order to have one remove event generated for every descendants of the node in order to keep the contexts state corrects.
 void save()
           
 javax.jcr.Node setReferenced(javax.jcr.Node referent, String propertyName, javax.jcr.Node referenced, LinkType linkType)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

public final javax.jcr.Session session
.

Constructor Detail

SessionWrapperImpl

public SessionWrapperImpl(SessionLifeCycle sessionLifeCycle,
                          javax.jcr.Session session,
                          boolean hasPropertyOptimized,
                          boolean hasNodeOptimized)
Method Detail

getProperty

public javax.jcr.Property getProperty(javax.jcr.Node node,
                                      String relPath)
                               throws javax.jcr.RepositoryException
Specified by:
getProperty in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getNode

public javax.jcr.Node getNode(javax.jcr.Node node,
                              String relPath)
                       throws javax.jcr.RepositoryException
Specified by:
getNode in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getNodeType

public javax.jcr.nodetype.NodeType getNodeType(String nodeTypeName)
                                        throws javax.jcr.RepositoryException
Specified by:
getNodeType in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

addNode

public javax.jcr.Node addNode(javax.jcr.Node parentNode,
                              String relPath,
                              String primartyNodeTypeName,
                              List<String> mixinNodeTypeNames)
                       throws javax.jcr.RepositoryException
Specified by:
addNode in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

move

public void move(javax.jcr.Node srcNode,
                 javax.jcr.Node dstNode)
          throws javax.jcr.RepositoryException
Specified by:
move in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

orderBefore

public void orderBefore(javax.jcr.Node parentNode,
                        javax.jcr.Node srcNode,
                        javax.jcr.Node dstNode)
                 throws javax.jcr.RepositoryException
Specified by:
orderBefore in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getNodeByUUID

public javax.jcr.Node getNodeByUUID(String uuid)
                             throws javax.jcr.RepositoryException
Specified by:
getNodeByUUID in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getParent

public javax.jcr.Node getParent(javax.jcr.Node childNode)
                         throws javax.jcr.RepositoryException
Specified by:
getParent in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getChildren

public Iterator<javax.jcr.Node> getChildren(javax.jcr.Node parentNode)
                                     throws javax.jcr.RepositoryException
Specified by:
getChildren in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getChild

public javax.jcr.Node getChild(javax.jcr.Node parentNode,
                               String name)
                        throws javax.jcr.RepositoryException
Specified by:
getChild in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

remove

public void remove(javax.jcr.Node node)
            throws javax.jcr.RepositoryException
Remove a node recursively in order to have one remove event generated for every descendants of the node in order to keep the contexts state corrects. It also remove all existing references to that node.

Specified by:
remove in interface SessionWrapper
Parameters:
node - the node to remove
Throws:
javax.jcr.RepositoryException - any repository exception

cleanReferencesForRemoval

public void cleanReferencesForRemoval(javax.jcr.Node node)
                               throws javax.jcr.RepositoryException
Need to find a way to optimized this method as it forces us to visit the entire children hierarchy.

Parameters:
node - the node to be removed
Throws:
javax.jcr.RepositoryException - any repository exception

save

public void save()
          throws javax.jcr.RepositoryException
Specified by:
save in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getReferenced

public javax.jcr.Node getReferenced(javax.jcr.Node referent,
                                    String propertyName,
                                    LinkType linkType)
                             throws javax.jcr.RepositoryException
Specified by:
getReferenced in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

setReferenced

public javax.jcr.Node setReferenced(javax.jcr.Node referent,
                                    String propertyName,
                                    javax.jcr.Node referenced,
                                    LinkType linkType)
                             throws javax.jcr.RepositoryException
Specified by:
setReferenced in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

getReferents

public Iterator<javax.jcr.Node> getReferents(javax.jcr.Node referenced,
                                             String propertyName,
                                             LinkType linkType)
                                      throws javax.jcr.RepositoryException
Specified by:
getReferents in interface SessionWrapper
Throws:
javax.jcr.RepositoryException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getSession

public javax.jcr.Session getSession()
Specified by:
getSession in interface SessionWrapper

close

public void close()
Specified by:
close in interface SessionWrapper


Copyright © 2009 eXo Platform SAS. All Rights Reserved.