org.apache.portals.graffito.jcr.persistence.objectconverter
Interface BeanConverter

All Known Implementing Classes:
AbstractBeanConverterImpl, ParentBeanConverterImpl

public interface BeanConverter

Interface describing a custom bean converter.

Author:
Alexandru Popescu

Method Summary
 java.lang.Object getObject(javax.jcr.Session session, javax.jcr.Node parentNode, BeanDescriptor descriptor, java.lang.Class beanClass)
          Retrieve a bean from the repository.
 void insert(javax.jcr.Session session, javax.jcr.Node parentNode, BeanDescriptor descriptor, java.lang.Object object)
          Insert the object.
 void remove(javax.jcr.Session session, javax.jcr.Node parentNode, BeanDescriptor descriptor)
          Remove the bean from the repository.
 void update(javax.jcr.Session session, javax.jcr.Node parentNode, BeanDescriptor descriptor, java.lang.Object object)
          Update repository from bean values.
 

Method Detail

insert

void insert(javax.jcr.Session session,
            javax.jcr.Node parentNode,
            BeanDescriptor descriptor,
            java.lang.Object object)
            throws PersistenceException,
                   RepositoryException,
                   JcrMappingException
Insert the object.

Parameters:
session - the JCR session
parentNode - The parent node
mapper - available mappings
beanName - bean name to be inserter
object - bean
Throws:
PersistenceException - thrown in case the insert fails; marks a failure due to logic of the insert (parent node cannot be accessed, the insert fails, etc.)
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in PersistenceException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct

update

void update(javax.jcr.Session session,
            javax.jcr.Node parentNode,
            BeanDescriptor descriptor,
            java.lang.Object object)
            throws PersistenceException,
                   RepositoryException,
                   JcrMappingException
Update repository from bean values.

Parameters:
session - the JCR session
parentNode - The parent node
mapper - available mappings
beanName - bean name to be updated
object - bean
Throws:
PersistenceException - thrown in case the update fails; marks a failure due to logic of update (parent node cannot be accessed, the update fails, etc.)
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in PersistenceException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct

getObject

java.lang.Object getObject(javax.jcr.Session session,
                           javax.jcr.Node parentNode,
                           BeanDescriptor descriptor,
                           java.lang.Class beanClass)
                           throws PersistenceException,
                                  RepositoryException,
                                  JcrMappingException
Retrieve a bean from the repository.

Parameters:
session - the JCR session
parentNode - The parent node
mapper - available mappings
beanName - bean name to be retrieved
beanClass - class of the bean to be retrieved
Throws:
PersistenceException - thrown in case the bean cannot be retrieved or initialized; marks a failure due to logic of retrieval
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in PersistenceException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct

remove

void remove(javax.jcr.Session session,
            javax.jcr.Node parentNode,
            BeanDescriptor descriptor)
            throws PersistenceException,
                   RepositoryException,
                   JcrMappingException
Remove the bean from the repository.

Parameters:
session - the JCR session
parentNode - The parent node
mapper - available mappings
beanName - bean name to be retrieved
Throws:
PersistenceException - thrown in case the bean cannot be removed; marks a failure due to logic of removal
RepositoryException - thrown in case the underlying repository has thrown a javax.jcr.RepositoryException that is not possible to be handled or wrapped in PersistenceException; marks a repository failure
JcrMappingException - throws in case the mapping of the bean is not correct


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