org.chromattic.core
Class DomainSession

java.lang.Object
  extended by org.chromattic.core.DomainSession
All Implemented Interfaces:
ChromatticSession
Direct Known Subclasses:
DomainSessionImpl

public abstract class DomainSession
extends Object
implements ChromatticSession

Version:
$Revision$
Author:
Julien Viet

Field Summary
protected  EventBroadcaster broadcaster
          .
protected  SessionWrapper sessionWrapper
          .
 
Constructor Summary
protected DomainSession(Domain domain, SessionWrapper sessionWrapper)
           
 
Method Summary
protected abstract
<O> O
_create(Class<O> clazz, String name)
           
protected abstract
<O> O
_findById(Class<O> clazz, String id)
           
protected abstract
<O> O
_findByNode(Class<O> clazz, javax.jcr.Node node)
           
protected abstract
<O> O
_findByPath(EntityContext o, Class<O> clazz, String relPath)
           
protected abstract  Object _getChild(EntityContext ctx, String name)
           
protected abstract
<T> Iterator<T>
_getChildren(EntityContext ctx, Class<T> filterClass)
           
protected abstract  Object _getParent(EntityContext ctx)
           
protected abstract  Object _getReferenced(EntityContext referentCtx, String name, LinkType linkType)
           
protected abstract
<T> Iterator<T>
_getReferents(EntityContext referencedCtx, String name, Class<T> filterClass, LinkType linkType)
           
protected abstract  javax.jcr.Node _getRoot()
           
protected abstract  void _move(EntityContext srcCtx, EntityContext dstCtx)
           
protected abstract  void _orderBefore(EntityContext parentCtx, EntityContext srcCtx, EntityContext dstCtx)
           
protected abstract  String _persist(EntityContext ctx, String name)
           
protected abstract  String _persist(EntityContext parentCtx, String name, EntityContext childCtx)
           
protected abstract  void _remove(EntityContext context)
           
protected abstract  void _removeChild(EntityContext ctx, String name)
           
protected abstract  void _save()
           
protected abstract  void _setName(EntityContext ctx, String name)
           
protected abstract  boolean _setReferenced(EntityContext referentCtx, String name, EntityContext referencedCtx, LinkType linkType)
           
 void addEventListener(EventListener listener)
           
<O> O
create(Class<O> clazz)
           
<O> O
create(Class<O> clazz, String name)
           
 QueryBuilder<?> createQueryBuilder()
           
<O> O
findById(Class<O> clazz, String id)
           
<O> O
findByNode(Class<O> clazz, javax.jcr.Node node)
           
<O> O
findByPath(Class<O> clazz, String relPath)
           
<O> O
findByPath(Object o, Class<O> clazz, String relPath)
           
 Object getChild(EntityContext ctx, String name)
           
<T> Iterator<T>
getChildren(EntityContext ctx, Class<T> filterClass)
           
 Domain getDomain()
           
 String getId(Object o)
           
 javax.jcr.Session getJCRSession()
           
 String getName(EntityContext ctx)
           
 String getName(Object o)
           
 javax.jcr.Node getNode(Object o)
           
 Object getParent(EntityContext ctx)
           
 String getPath(Object o)
           
 Object getReferenced(EntityContext referentCtx, String name, LinkType linkType)
           
<T> Iterator<T>
getReferents(EntityContext referencedCtx, String name, Class<T> filterClass, LinkType linkType)
           
 javax.jcr.Node getRoot()
           
 SessionWrapper getSessionWrapper()
           
 Status getStatus(Object o)
           
<O> O
insert(Class<O> clazz, String name)
           
<O> O
insert(Object parent, Class<O> clazz, String name)
           
 void move(EntityContext srcCtx, EntityContext dstCtx)
           
 void orderBefore(EntityContext parentCtx, EntityContext srcCtx, EntityContext dstCtx)
           
 String persist(EntityContext parentCtx, EntityContext childCtx, String name)
           
 String persist(Object o)
           
 String persist(Object parent, Object child)
           
 String persist(Object parent, Object child, String name)
           
 String persist(Object o, String relPath)
           
 void remove(EntityContext context)
           
 void remove(Object o)
           
 void removeChild(EntityContext ctx, String name)
           
 void save()
           
 void setName(EntityContext ctx, String name)
           
 boolean setReferenced(EntityContext referentCtx, String name, EntityContext referencedCtx, LinkType linkType)
           
 EntityContext unwrap(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.chromattic.api.ChromatticSession
close
 

Field Detail

broadcaster

protected final EventBroadcaster broadcaster
.


sessionWrapper

protected final SessionWrapper sessionWrapper
.

Constructor Detail

DomainSession

protected DomainSession(Domain domain,
                        SessionWrapper sessionWrapper)
Method Detail

_setName

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

_persist

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

_persist

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

_create

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

_findById

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

_findByNode

protected abstract <O> O _findByNode(Class<O> 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 Object _getReferenced(EntityContext referentCtx,
                                         String name,
                                         LinkType linkType)
                                  throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

_setReferenced

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

_getReferents

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

_removeChild

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

_getChild

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

_getChildren

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

_getParent

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

_findByPath

protected abstract <O> O _findByPath(EntityContext o,
                                     Class<O> clazz,
                                     String relPath)
                          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)
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getDomain

public final Domain getDomain()

getJCRSession

public final javax.jcr.Session getJCRSession()
Specified by:
getJCRSession in interface ChromatticSession

getId

public final String getId(Object o)
                   throws UndeclaredRepositoryException
Specified by:
getId in interface ChromatticSession
Throws:
UndeclaredRepositoryException

getName

public final String getName(Object o)
                     throws UndeclaredRepositoryException
Specified by:
getName in interface ChromatticSession
Throws:
UndeclaredRepositoryException

getPath

public final String getPath(Object o)
                     throws UndeclaredRepositoryException
Specified by:
getPath in interface ChromatticSession
Throws:
UndeclaredRepositoryException

create

public final <O> O create(Class<O> clazz)
               throws NullPointerException,
                      IllegalArgumentException
Specified by:
create in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException

create

public final <O> O create(Class<O> clazz,
                          String name)
               throws NullPointerException,
                      IllegalArgumentException
Specified by:
create in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException

insert

public final <O> O insert(Object parent,
                          Class<O> clazz,
                          String name)
               throws NullPointerException,
                      IllegalArgumentException,
                      ChromatticException
Specified by:
insert in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException
ChromatticException

insert

public final <O> O insert(Class<O> clazz,
                          String name)
               throws NullPointerException,
                      IllegalArgumentException,
                      UndeclaredRepositoryException
Specified by:
insert in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException
UndeclaredRepositoryException

persist

public final String persist(Object parent,
                            Object child,
                            String name)
                     throws NullPointerException,
                            IllegalArgumentException,
                            ChromatticException
Specified by:
persist in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException
ChromatticException

persist

public final String persist(Object parent,
                            Object child)
                     throws NullPointerException,
                            IllegalArgumentException,
                            ChromatticException
Specified by:
persist in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException
ChromatticException

persist

public final String persist(Object o)
                     throws NullPointerException,
                            IllegalArgumentException,
                            ChromatticException
Specified by:
persist in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException
ChromatticException

persist

public final String persist(Object o,
                            String relPath)
                     throws NullPointerException,
                            IllegalArgumentException,
                            ChromatticException
Specified by:
persist in interface ChromatticSession
Throws:
NullPointerException
IllegalArgumentException
ChromatticException

findByNode

public final <O> O findByNode(Class<O> clazz,
                              javax.jcr.Node node)
                   throws UndeclaredRepositoryException
Specified by:
findByNode in interface ChromatticSession
Throws:
UndeclaredRepositoryException

findById

public final <O> O findById(Class<O> clazz,
                            String id)
                 throws UndeclaredRepositoryException
Specified by:
findById in interface ChromatticSession
Throws:
UndeclaredRepositoryException

findByPath

public final <O> O findByPath(Object o,
                              Class<O> clazz,
                              String relPath)
                   throws ChromatticException
Specified by:
findByPath in interface ChromatticSession
Throws:
ChromatticException

findByPath

public final <O> O findByPath(Class<O> clazz,
                              String relPath)
                   throws ChromatticException
Specified by:
findByPath in interface ChromatticSession
Throws:
ChromatticException

save

public final void save()
                throws UndeclaredRepositoryException
Specified by:
save in interface ChromatticSession
Throws:
UndeclaredRepositoryException

getStatus

public final Status getStatus(Object o)
                       throws UndeclaredRepositoryException
Specified by:
getStatus in interface ChromatticSession
Throws:
UndeclaredRepositoryException

remove

public final void remove(Object o)
                  throws UndeclaredRepositoryException
Specified by:
remove in interface ChromatticSession
Throws:
UndeclaredRepositoryException

createQueryBuilder

public QueryBuilder<?> createQueryBuilder()
                                   throws ChromatticException
Specified by:
createQueryBuilder in interface ChromatticSession
Throws:
ChromatticException

getNode

public final javax.jcr.Node getNode(Object o)

getName

public final String getName(EntityContext ctx)
                     throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

setName

public final void setName(EntityContext ctx,
                          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)
          throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

remove

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

getReferenced

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

setReferenced

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

removeChild

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

getChild

public final Object getChild(EntityContext ctx,
                             String name)
                      throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getChildren

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

getParent

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

getReferents

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

unwrap

public final EntityContext unwrap(Object o)

persist

public final String persist(EntityContext parentCtx,
                            EntityContext childCtx,
                            String name)
                     throws UndeclaredRepositoryException
Throws:
UndeclaredRepositoryException

getRoot

public final javax.jcr.Node getRoot()

getSessionWrapper

public SessionWrapper getSessionWrapper()

addEventListener

public void addEventListener(EventListener listener)
Specified by:
addEventListener in interface ChromatticSession


Copyright © 2009 eXo Platform SAS. All Rights Reserved.