org.apache.jackrabbit.ocm.manager.objectconverter
Interface ObjectConverter

All Known Implementing Classes:
ObjectConverterImpl

public interface ObjectConverter

Convert any kind of beans into JCR nodes & properties

Version:
$Id: Exp $
Author:
Lombart Christophe

Method Summary
 Object getObject(Session session, Class clazz, String path)
          Retrieve an object from the JCR repo
 Object getObject(Session session, String path)
          Retrieve an object from the JCR repo
 String getPath(Session session, Object object)
          Get the object JCR path
 void insert(Session session, Node parentNode, String nodeName, Object object)
          Insert the object
 void insert(Session session, Object object)
          Insert the object
 void retrieveAllMappedAttributes(Session session, Object object)
          Retrieve all mapped attributes for the given persistent object.
 void retrieveMappedAttribute(Session session, Object object, String attributeName)
          Retrieve the specified attribute for the given persistent object.
 void update(Session session, Node objectNode, Object object)
          Update the object
 void update(Session session, Node parentNode, String nodeName, Object object)
          Update the object
 void update(Session session, Object object)
          Update the object
 void update(Session session, String uuId, Object object)
          Update the object
 

Method Detail

insert

void insert(Session session,
            Object object)
            throws ObjectContentManagerException
Insert the object

Parameters:
session - the JCR session
object - the object to insert
Throws:
ObjectContentManagerException - when it is not possible to insert the object

update

void update(Session session,
            Object object)
            throws ObjectContentManagerException
Update the object

Parameters:
session - the JCR session
object - the object to update
Throws:
ObjectContentManagerException - when it is not possible to update the object

getObject

Object getObject(Session session,
                 String path)
                 throws ObjectContentManagerException
Retrieve an object from the JCR repo

Parameters:
session - The JCR session
clazz - The class assigned to the object to retrieve
path - the JCR path
Returns:
The object found or null
Throws:
ObjectContentManagerException - when it is not possible to retrieve the object

getObject

Object getObject(Session session,
                 Class clazz,
                 String path)
                 throws ObjectContentManagerException
Retrieve an object from the JCR repo

Parameters:
session - The JCR session
clazz - The class assigned to the object to retrieve
path - the JCR path
Returns:
The object found or null
Throws:
ObjectContentManagerException - when it is not possible to retrieve the object

retrieveMappedAttribute

void retrieveMappedAttribute(Session session,
                             Object object,
                             String attributeName)
Retrieve the specified attribute for the given persistent object. this attribute is either a bean or a collection. This method is usefull if the corresponding descriptor has an autoRetrieve="false"

Parameters:
session - The JCR session
object - The persistent object
attributeName - The name of the attribute to retrieve

retrieveAllMappedAttributes

void retrieveAllMappedAttributes(Session session,
                                 Object object)
Retrieve all mapped attributes for the given persistent object.

Parameters:
session - The JCR session
object - The persistent object

insert

void insert(Session session,
            Node parentNode,
            String nodeName,
            Object object)
            throws ObjectContentManagerException
Insert the object

Parameters:
session - the JCR session
parentNode - The parent node used to store the new JCR element (object)
nodeName - The node name used to store the object
object - the object to insert
Throws:
ObjectContentManagerException - when it is not possible to insert the object

update

void update(Session session,
            Node objectNode,
            Object object)
            throws ObjectContentManagerException
Update the object

Parameters:
session - the JCR session
objectNode - The node to store the object
object - the object to update
Throws:
ObjectContentManagerException - when it is not possible to update the object

update

void update(Session session,
            Node parentNode,
            String nodeName,
            Object object)
            throws ObjectContentManagerException
Update the object

Parameters:
session - the JCR session
parentNode - The parent node used to store the new JCR element (object)
nodeName - The node name used to store the object
object - the object to update
Throws:
ObjectContentManagerException - when it is not possible to update the object

update

void update(Session session,
            String uuId,
            Object object)
Update the object

Parameters:
session - the JCR session
uuId - The UUID of the node to get updated.
object - the object to update
Throws:
ObjectContentManagerException - when it is not possible to update the object

getPath

String getPath(Session session,
               Object object)
               throws ObjectContentManagerException
Get the object JCR path

Parameters:
session - the JCR session
object - the object for which the path has to be retrieve
Returns:
the object JCR path
Throws:
ObjectContentManagerException - when it is not possible to retrieve the object path


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