org.chromattic.core
Class DomainSession

java.lang.Object
  extended by org.chromattic.core.DomainSession
Direct Known Subclasses:
DomainSessionImpl

public abstract class DomainSession
extends java.lang.Object

Version:
$Revision$
Author:
Julien Viet

Field Summary
protected  EventBroadcaster broadcaster
          .
protected  SessionWrapper sessionWrapper
          .
 
Constructor Summary
DomainSession(Domain domain, SessionWrapper sessionWrapper)
           
 
Method Summary
protected abstract  void _addMixin(EntityContext ctx, EmbeddedContext mixinCtx)
           
protected abstract  void _close()
           
protected abstract  EntityContext _copy(EntityContext parentCtx, EntityContext srcCtx, java.lang.String name)
           
protected abstract  EntityContext _copy(EntityContext srcCtx, java.lang.String name)
           
protected abstract  ObjectContext _create(java.lang.Class<?> clazz, java.lang.String name)
           
protected abstract
<E> E
_findById(java.lang.Class<E> clazz, java.lang.String id)
           
protected abstract
<E> E
_findByNode(java.lang.Class<E> clazz, javax.jcr.Node node)
           
protected abstract
<E> E
_findByPath(java.lang.Class<E> clazz, java.lang.String path)
           
protected abstract
<E> E
_findByPath(EntityContext ctx, java.lang.Class<E> clazz, java.lang.String relPath)
           
protected abstract  EntityContext _getChild(EntityContext ctx, java.lang.String name)
           
protected abstract
<T> java.util.Iterator<T>
_getChildren(EntityContext ctx, java.lang.Class<T> filterClass)
           
protected abstract  EmbeddedContext _getEmbedded(EntityContext ctx, java.lang.Class<?> embeddedClass)
           
protected abstract  EntityContext _getEntity(javax.jcr.Node node)
           
protected abstract  java.lang.String _getName(EntityContext ctx)
           
protected abstract  EntityContext _getParent(EntityContext ctx)
           
protected abstract  EntityContext _getReferenced(EntityContext referentCtx, java.lang.String name, LinkType linkType)
           
protected abstract
<T> java.util.Iterator<T>
_getReferents(EntityContext referencedCtx, java.lang.String name, java.lang.Class<T> filterClass, LinkType linkType)
           
protected abstract  javax.jcr.Node _getRoot()
           
protected abstract  void _move(EntityContext srcCtx, EntityContext dstCtx, java.lang.String dstName)
           
protected abstract  void _orderBefore(EntityContext parentCtx, EntityContext srcCtx, EntityContext dstCtx)
           
protected abstract  void _persist(EntityContext ctx, java.lang.String name)
           
protected abstract  void _persist(EntityContext parentCtx, java.lang.String name, EntityContext childCtx)
           
protected abstract  void _remove(EntityContext context)
           
protected abstract  void _removeChild(EntityContext ctx, java.lang.String name)
           
protected abstract  void _save()
           
protected abstract  void _setName(EntityContext ctx, java.lang.String name)
           
protected abstract  boolean _setReferenced(EntityContext referentCtx, java.lang.String name, EntityContext referencedCtx, LinkType linkType)
           
 void addEventListener(EventListener listener)
           
 void addMixin(EntityContext ctx, EmbeddedContext mixinCtx)
           
 void close()
           
 EntityContext copy(EntityContext parentCtx, EntityContext srcCtx, java.lang.String name)
           
 EntityContext copy(EntityContext srcCtx, java.lang.String name)
           
<O> O
create(java.lang.Class<O> clazz, java.lang.String name)
           
<O> QueryBuilder<O>
createQueryBuilder(java.lang.Class<O> fromClass)
           
<E> E
findById(java.lang.Class<E> clazz, java.lang.String id)
           
<E> E
findByNode(java.lang.Class<E> clazz, javax.jcr.Node node)
           
<E> E
findByPath(java.lang.Class<E> clazz, java.lang.String path)
           
<E> E
findByPath(EntityContext ctx, java.lang.Class<E> clazz, java.lang.String relPath)
           
 EntityContext getChild(EntityContext ctx, java.lang.String name)
           
<T> java.util.Iterator<T>
getChildren(EntityContext ctx, java.lang.Class<T> filterClass)
           
 Domain getDomain()
           
 EmbeddedContext getEmbedded(EntityContext ctx, java.lang.Class<?> embeddedClass)
           
 EntityContext getEntity(javax.jcr.Node node)
           
 javax.jcr.Session getJCRSession()
           
 java.lang.String getName(EntityContext ctx)
           
 EntityContext getParent(EntityContext ctx)
           
 EntityContext getReferenced(EntityContext referentCtx, java.lang.String name, LinkType linkType)
           
<T> java.util.Iterator<T>
getReferents(EntityContext referencedCtx, java.lang.String name, java.lang.Class<T> filterClass, LinkType linkType)
           
 javax.jcr.Node getRoot()
           
 SessionWrapper getSessionWrapper()
           
 void move(EntityContext srcCtx, EntityContext dstCtx, java.lang.String dstName)
           
 void orderBefore(EntityContext parentCtx, EntityContext srcCtx, EntityContext dstCtx)
           
 void persist(EntityContext parentCtx, EntityContext childCtx, java.lang.String name)
           
 void persist(EntityContext ctx, java.lang.String name)
           
 void remove(EntityContext context)
           
 void removeChild(EntityContext ctx, java.lang.String name)
           
 void save()
           
 void setName(EntityContext ctx, java.lang.String name)
           
 boolean setReferenced(EntityContext referentCtx, java.lang.String name, EntityContext referencedCtx, LinkType linkType)
           
 EntityContext unwrapEntity(java.lang.Object o)
          Unwraps the object to an entity context
 EmbeddedContext unwrapMixin(java.lang.Object o)
          Unwraps the object to an embedded context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

broadcaster

protected final EventBroadcaster broadcaster
.


sessionWrapper

protected final SessionWrapper sessionWrapper
.

Constructor Detail

DomainSession

public DomainSession(Domain domain,
                     SessionWrapper sessionWrapper)
Method Detail

_setName

protected abstract void _setName(EntityContext ctx,
                                 java.lang.String name)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_persist

protected abstract void _persist(EntityContext ctx,
                                 java.lang.String name)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_persist

protected abstract void _persist(EntityContext parentCtx,
                                 java.lang.String name,
                                 EntityContext childCtx)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_copy

protected abstract EntityContext _copy(EntityContext srcCtx,
                                       java.lang.String name)
                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_copy

protected abstract EntityContext _copy(EntityContext parentCtx,
                                       EntityContext srcCtx,
                                       java.lang.String name)
                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_create

protected abstract ObjectContext _create(java.lang.Class<?> clazz,
                                         java.lang.String name)
                                  throws java.lang.NullPointerException,
                                         java.lang.IllegalArgumentException,
                                         javax.jcr.RepositoryException
Throws:
java.lang.NullPointerException
java.lang.IllegalArgumentException
javax.jcr.RepositoryException

_findById

protected abstract <E> E _findById(java.lang.Class<E> clazz,
                                   java.lang.String id)
                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_findByNode

protected abstract <E> E _findByNode(java.lang.Class<E> clazz,
                                     javax.jcr.Node node)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_save

protected abstract void _save()
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_remove

protected abstract void _remove(EntityContext context)
                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getReferenced

protected abstract EntityContext _getReferenced(EntityContext referentCtx,
                                                java.lang.String name,
                                                LinkType linkType)
                                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_setReferenced

protected abstract boolean _setReferenced(EntityContext referentCtx,
                                          java.lang.String name,
                                          EntityContext referencedCtx,
                                          LinkType linkType)
                                   throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getReferents

protected abstract <T> java.util.Iterator<T> _getReferents(EntityContext referencedCtx,
                                                           java.lang.String name,
                                                           java.lang.Class<T> filterClass,
                                                           LinkType linkType)
                                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_removeChild

protected abstract void _removeChild(EntityContext ctx,
                                     java.lang.String name)
                              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getChild

protected abstract EntityContext _getChild(EntityContext ctx,
                                           java.lang.String name)
                                    throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getChildren

protected abstract <T> java.util.Iterator<T> _getChildren(EntityContext ctx,
                                                          java.lang.Class<T> filterClass)
                                               throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getParent

protected abstract EntityContext _getParent(EntityContext ctx)
                                     throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_findByPath

protected abstract <E> E _findByPath(EntityContext ctx,
                                     java.lang.Class<E> clazz,
                                     java.lang.String relPath)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_findByPath

protected abstract <E> E _findByPath(java.lang.Class<E> clazz,
                                     java.lang.String path)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_orderBefore

protected abstract void _orderBefore(EntityContext parentCtx,
                                     EntityContext srcCtx,
                                     EntityContext dstCtx)
                              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getRoot

protected abstract javax.jcr.Node _getRoot()
                                    throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_move

protected abstract void _move(EntityContext srcCtx,
                              EntityContext dstCtx,
                              java.lang.String dstName)
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_addMixin

protected abstract void _addMixin(EntityContext ctx,
                                  EmbeddedContext mixinCtx)
                           throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getEmbedded

protected abstract EmbeddedContext _getEmbedded(EntityContext ctx,
                                                java.lang.Class<?> embeddedClass)
                                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getEntity

protected abstract EntityContext _getEntity(javax.jcr.Node node)
                                     throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_getName

protected abstract java.lang.String _getName(EntityContext ctx)
                                      throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_close

protected abstract void _close()
                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getDomain

public Domain getDomain()

getJCRSession

public javax.jcr.Session getJCRSession()

createQueryBuilder

public <O> QueryBuilder<O> createQueryBuilder(java.lang.Class<O> fromClass)
                                   throws ChromatticException
Throws:
ChromatticException

addEventListener

public void addEventListener(EventListener listener)

close

public void close()

getEmbedded

public EmbeddedContext getEmbedded(EntityContext ctx,
                                   java.lang.Class<?> embeddedClass)
                            throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

save

public void save()
          throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

findById

public <E> E findById(java.lang.Class<E> clazz,
                      java.lang.String id)
           throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

findByPath

public <E> E findByPath(EntityContext ctx,
                        java.lang.Class<E> clazz,
                        java.lang.String relPath)
             throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

findByPath

public <E> E findByPath(java.lang.Class<E> clazz,
                        java.lang.String path)
             throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

findByNode

public <E> E findByNode(java.lang.Class<E> clazz,
                        javax.jcr.Node node)
             throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

persist

public void persist(EntityContext ctx,
                    java.lang.String name)
             throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

copy

public EntityContext copy(EntityContext srcCtx,
                          java.lang.String name)
                   throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

copy

public EntityContext copy(EntityContext parentCtx,
                          EntityContext srcCtx,
                          java.lang.String name)
                   throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

create

public <O> O create(java.lang.Class<O> clazz,
                    java.lang.String name)
         throws java.lang.NullPointerException,
                java.lang.IllegalArgumentException,
                UndeclaredRepositoryException
Throws:
java.lang.NullPointerException
java.lang.IllegalArgumentException
UndeclaredRepositoryException

getName

public java.lang.String getName(EntityContext ctx)
                         throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

addMixin

public void addMixin(EntityContext ctx,
                     EmbeddedContext mixinCtx)
              throws ChromatticException
Throws:
ChromatticException

setName

public final void setName(EntityContext ctx,
                          java.lang.String name)
                   throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

orderBefore

public final void orderBefore(EntityContext parentCtx,
                              EntityContext srcCtx,
                              EntityContext dstCtx)

move

public void move(EntityContext srcCtx,
                 EntityContext dstCtx,
                 java.lang.String dstName)
          throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

remove

public final void remove(EntityContext context)
                  throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getReferenced

public final EntityContext getReferenced(EntityContext referentCtx,
                                         java.lang.String name,
                                         LinkType linkType)
                                  throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

setReferenced

public final boolean setReferenced(EntityContext referentCtx,
                                   java.lang.String name,
                                   EntityContext referencedCtx,
                                   LinkType linkType)
                            throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

removeChild

public final void removeChild(EntityContext ctx,
                              java.lang.String name)
                       throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getEntity

public final EntityContext getEntity(javax.jcr.Node node)
                              throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getChild

public final EntityContext getChild(EntityContext ctx,
                                    java.lang.String name)
                             throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getChildren

public final <T> java.util.Iterator<T> getChildren(EntityContext ctx,
                                                   java.lang.Class<T> filterClass)
                                        throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getParent

public final EntityContext getParent(EntityContext ctx)
                              throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getReferents

public final <T> java.util.Iterator<T> getReferents(EntityContext referencedCtx,
                                                    java.lang.String name,
                                                    java.lang.Class<T> filterClass,
                                                    LinkType linkType)
                                         throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

unwrapEntity

public final EntityContext unwrapEntity(java.lang.Object o)
                                 throws java.lang.NullPointerException,
                                        java.lang.IllegalArgumentException
Unwraps the object to an entity context

Parameters:
o - the object to unwrap
Returns:
the related entity context
Throws:
java.lang.NullPointerException - if the object is null
java.lang.IllegalArgumentException - if the object is not a proxy

unwrapMixin

public final EmbeddedContext unwrapMixin(java.lang.Object o)
Unwraps the object to an embedded context

Parameters:
o - the object to unwrap
Returns:
the related embedded context
Throws:
java.lang.NullPointerException - if the object is null
java.lang.IllegalArgumentException - if the object is not a proxy

persist

public final void persist(EntityContext parentCtx,
                          EntityContext childCtx,
                          java.lang.String name)
                   throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getRoot

public final javax.jcr.Node getRoot()

getSessionWrapper

public SessionWrapper getSessionWrapper()


Copyright © 2011 eXo Platform SAS. All Rights Reserved.