org.apache.portals.graffito.jcr.persistence.collectionconverter
Interface CollectionConverter

All Known Implementing Classes:
AbstractCollectionConverterImpl, DefaultCollectionConverterImpl, MultiValueCollectionConverterImpl, NTCollectionConverterImpl

public interface CollectionConverter

Convert any kind of ManageableCollection into severals JCR nodes.

Author:
Lombart Christophe

Method Summary
 ManageableCollection getCollection(javax.jcr.Session session, javax.jcr.Node parentNode, CollectionDescriptor collectionDescriptor, java.lang.Class collectionFieldClass)
          Get a ManageableCollection from the JCR repository
 void insertCollection(javax.jcr.Session session, javax.jcr.Node parentNode, CollectionDescriptor collectionDescriptor, ManageableCollection collection)
          Insert/convert collection elements into some JCR nodes
 boolean isNull(javax.jcr.Session session, javax.jcr.Node parentNode, CollectionDescriptor collectionDescriptor, java.lang.Class collectionFieldClass)
          Check if the collection is null.
 void updateCollection(javax.jcr.Session session, javax.jcr.Node parentNode, CollectionDescriptor collectionDescriptor, ManageableCollection collection)
          Update collection elements already present in the JCR repository
 

Method Detail

insertCollection

void insertCollection(javax.jcr.Session session,
                      javax.jcr.Node parentNode,
                      CollectionDescriptor collectionDescriptor,
                      ManageableCollection collection)
                      throws PersistenceException
Insert/convert collection elements into some JCR nodes

Parameters:
session - The JCR session
parentNode - the node which will contains the collection element
collectionDescriptor - The collection descriptor
collection - the collection to insert
Throws:
PersistenceException - when it is not possible to insert the collection

updateCollection

void updateCollection(javax.jcr.Session session,
                      javax.jcr.Node parentNode,
                      CollectionDescriptor collectionDescriptor,
                      ManageableCollection collection)
                      throws PersistenceException
Update collection elements already present in the JCR repository

Parameters:
session - The JCR session
parentNode - the node which will contains the collection element
collectionDescriptor - The collection descriptor
collection - the collection to update
Throws:
PersistenceException - when it is not possible to update the collection

getCollection

ManageableCollection getCollection(javax.jcr.Session session,
                                   javax.jcr.Node parentNode,
                                   CollectionDescriptor collectionDescriptor,
                                   java.lang.Class collectionFieldClass)
                                   throws PersistenceException
Get a ManageableCollection from the JCR repository

Parameters:
session - The JCR session
parentNode - the node which contains the collection element
collectionDescriptor - The collection descriptor
collectionFieldClass - The collection class to used (ArrayList, Vector, ..)
Returns:
The collection populates with all elements found in the JCR repository
Throws:
PersistenceException - when it is not possible to retrieve the collection

isNull

boolean isNull(javax.jcr.Session session,
               javax.jcr.Node parentNode,
               CollectionDescriptor collectionDescriptor,
               java.lang.Class collectionFieldClass)
               throws PersistenceException
Check if the collection is null. This method is mainly used in the Proxy manager to return a null value or a proxy object Without proxy proxy, this method is never called.

Parameters:
session - The JCR session
parentNode - the node which contains the collection element
collectionDescriptor - The collection descriptor
collectionFieldClass - The collection class to used (ArrayList, Vector, ..)
Returns:
true if the collection contains elements.
Throws:
PersistenceException - when it is not possible to retrieve the collection


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