org.apache.jackrabbit.ocm.nodemanagement.impl.jeceira
Class NodeTypeManagerImpl

java.lang.Object
  extended by org.apache.jackrabbit.ocm.nodemanagement.impl.jeceira.NodeTypeManagerImpl
All Implemented Interfaces:
NodeTypeManager

public class NodeTypeManagerImpl
extends Object
implements NodeTypeManager

This is the NodeTypeManager implementation for Jeceira.

Author:
Oliver Kiessler

Constructor Summary
NodeTypeManagerImpl()
          Creates a new instance of NodeTypeManagerImpl.
 
Method Summary
 void createNamespace(Session session, String namespace, String namespaceUri)
          Creates a new namespace in the repository.
 void createNodeTypeFromClass(Session session, Class clazz, String jcrNodeType, boolean reflectSuperClasses)
          This method creates a JCR node type from a given Java Bean class by using reflection.
 void createNodeTypes(Session session, ClassDescriptor[] classDescriptors)
          This method creates JCR node types based on ClassDescriptor objects which are created by a jcr-mapping Mapper implementation.
 void createNodeTypes(Session session, MappingDescriptor mappingDescriptor)
          This method creates JCR node types based on the MappingDescriptor object which is created by a jcr-mapping Mapper implementation.
 void createNodeTypesFromConfiguration(Session session, InputStream jcrRepositoryConfigurationFile)
          This method creates JCR node types from a JCR vendor specific configuration file.
 void createNodeTypesFromMappingFiles(Session session, InputStream[] mappingXmlFiles)
          This method creates JCR node types based on jcr-mapping xml files.
 void createSingleNodeType(Session session, ClassDescriptor classDescriptor)
          This method creates a single JCR node type identified by its ClassDescriptor read from the jcr mapping file.
 void createSingleNodeTypeFromMappingFile(Session session, InputStream mappingXmlFile, String jcrNodeType)
          This method creates a single JCR node type identified by its jcrNodeType name defined in a jcr-mapping xml file.
 List getAllPrimaryNodeTypeNames(Session session)
          Returns a list of all JCR node types.
 List getPrimaryNodeTypeNames(Session session, String namespace)
          Returns the names of all node types in the repository identified by a given namespace.
 void removeNodeTypes(Session session, InputStream[] mappingXmlFiles)
           
 void removeNodeTypesFromConfiguration(Session session, InputStream jcrRepositoryConfigurationFile)
          This method removes JCR node types from a JCR vendor specific configuration file
 void removeNodeTypesFromMappingFile(Session session, InputStream[] mappingXmlFiles)
          This method removes all JCR node types that are defined in one to many jcr-mapping XML files.
 void removeSingleNodeType(Session session, String jcrNodeType)
          This method removes a single JCR node type identified by its jcrNodeType name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeTypeManagerImpl

public NodeTypeManagerImpl()
Creates a new instance of NodeTypeManagerImpl.

Method Detail

createNamespace

public void createNamespace(Session session,
                            String namespace,
                            String namespaceUri)
                     throws NamespaceCreationException
Description copied from interface: NodeTypeManager
Creates a new namespace in the repository.

Specified by:
createNamespace in interface NodeTypeManager
namespace - Namespace
namespaceUri - Full namespace URI
Throws:
NamespaceCreationException
See Also:
NodeTypeManager.createNamespace(javax.jcr.Session, java.lang.String, java.lang.String)

createNodeTypes

public void createNodeTypes(Session session,
                            MappingDescriptor mappingDescriptor)
                     throws NodeTypeCreationException
Description copied from interface: NodeTypeManager
This method creates JCR node types based on the MappingDescriptor object which is created by a jcr-mapping Mapper implementation. A Mapper reads one to many jcr mapping XML File.

Specified by:
createNodeTypes in interface NodeTypeManager
Parameters:
session - Repository session
mappingDescriptor - Mapping descriptor object created by jcr-mapping
Throws:
NodeTypeCreationException - NodeTypeCreationException

createNodeTypes

public void createNodeTypes(Session session,
                            ClassDescriptor[] classDescriptors)
                     throws NodeTypeCreationException
Description copied from interface: NodeTypeManager
This method creates JCR node types based on ClassDescriptor objects which are created by a jcr-mapping Mapper implementation. A Mapper reads one to many jcr mapping XML File.

Specified by:
createNodeTypes in interface NodeTypeManager
Parameters:
session - Repository session
classDescriptors - Array of ClassDescriptor objects created by jcr-mapping
Throws:
NodeTypeCreationException - NodeTypeCreationException

createNodeTypesFromMappingFiles

public void createNodeTypesFromMappingFiles(Session session,
                                            InputStream[] mappingXmlFiles)
                                     throws NodeTypeCreationException
Description copied from interface: NodeTypeManager
This method creates JCR node types based on jcr-mapping xml files.

Specified by:
createNodeTypesFromMappingFiles in interface NodeTypeManager
Parameters:
session - Repository session
mappingXmlFiles - InputStreams to jcr-mapping xml files
Throws:
NodeTypeCreationException - NodeTypeCreationException

createSingleNodeType

public void createSingleNodeType(Session session,
                                 ClassDescriptor classDescriptor)
                          throws NodeTypeCreationException
Description copied from interface: NodeTypeManager
This method creates a single JCR node type identified by its ClassDescriptor read from the jcr mapping file.

Specified by:
createSingleNodeType in interface NodeTypeManager
Parameters:
session - Repository session
classDescriptor - ClassDescriptor object created by jcr-mapping
Throws:
NodeTypeCreationException - NodeTypeCreationException

createSingleNodeTypeFromMappingFile

public void createSingleNodeTypeFromMappingFile(Session session,
                                                InputStream mappingXmlFile,
                                                String jcrNodeType)
                                         throws NodeTypeCreationException
Description copied from interface: NodeTypeManager
This method creates a single JCR node type identified by its jcrNodeType name defined in a jcr-mapping xml file.

Specified by:
createSingleNodeTypeFromMappingFile in interface NodeTypeManager
Parameters:
session - Repository session
mappingXmlFile - InputStream to a jcr-mapping xml file
jcrNodeType - Name of the class that needs to be created identified by its jcrNodeType name
Throws:
NodeTypeCreationException - NodeTypeCreationException

createNodeTypeFromClass

public void createNodeTypeFromClass(Session session,
                                    Class clazz,
                                    String jcrNodeType,
                                    boolean reflectSuperClasses)
                             throws NodeTypeCreationException
Description copied from interface: NodeTypeManager
This method creates a JCR node type from a given Java Bean class by using reflection. It creates required JCR property definitions from primitive Java class properties using the same property name. Non-primitive class properties are skipped.

Specified by:
createNodeTypeFromClass in interface NodeTypeManager
Parameters:
session - Repository session
clazz - Java class
jcrNodeType - Name of JCR node type (including namespace)
reflectSuperClasses - If true, all base classes are also reflected
Throws:
NodeTypeCreationException - NodeTypeCreationException

createNodeTypesFromConfiguration

public void createNodeTypesFromConfiguration(Session session,
                                             InputStream jcrRepositoryConfigurationFile)
                                      throws OperationNotSupportedException,
                                             NodeTypeCreationException
Description copied from interface: NodeTypeManager
This method creates JCR node types from a JCR vendor specific configuration file.

Specified by:
createNodeTypesFromConfiguration in interface NodeTypeManager
Parameters:
session - Repository session
Throws:
OperationNotSupportedException - OperationNotSupportedException
NodeTypeCreationException - NodeTypeCreationException
See Also:
NodeTypeManager.createNodeTypesFromConfiguration(javax.jcr.Session, java.io.InputStream)

removeNodeTypes

public void removeNodeTypes(Session session,
                            InputStream[] mappingXmlFiles)
                     throws NodeTypeRemovalException
Throws:
NodeTypeRemovalException

removeSingleNodeType

public void removeSingleNodeType(Session session,
                                 String jcrNodeType)
                          throws NodeTypeRemovalException
Description copied from interface: NodeTypeManager
This method removes a single JCR node type identified by its jcrNodeType name.

Specified by:
removeSingleNodeType in interface NodeTypeManager
Parameters:
session - Repository session
Throws:
NodeTypeRemovalException - NodeTypeRemovalException

getPrimaryNodeTypeNames

public List getPrimaryNodeTypeNames(Session session,
                                    String namespace)
Description copied from interface: NodeTypeManager
Returns the names of all node types in the repository identified by a given namespace.

Specified by:
getPrimaryNodeTypeNames in interface NodeTypeManager
namespace - Name of nodetypes to return
Returns:
list of matching JCR node types

getAllPrimaryNodeTypeNames

public List getAllPrimaryNodeTypeNames(Session session)
Description copied from interface: NodeTypeManager
Returns a list of all JCR node types.

Specified by:
getAllPrimaryNodeTypeNames in interface NodeTypeManager
Returns:
list of all JCR node types

removeNodeTypesFromConfiguration

public void removeNodeTypesFromConfiguration(Session session,
                                             InputStream jcrRepositoryConfigurationFile)
                                      throws NodeTypeRemovalException
Description copied from interface: NodeTypeManager
This method removes JCR node types from a JCR vendor specific configuration file

Specified by:
removeNodeTypesFromConfiguration in interface NodeTypeManager
Parameters:
session - Repository session
jcrRepositoryConfigurationFile - the file that contains the node type definition
Throws:
NodeTypeRemovalException

removeNodeTypesFromMappingFile

public void removeNodeTypesFromMappingFile(Session session,
                                           InputStream[] mappingXmlFiles)
                                    throws NodeTypeRemovalException
Description copied from interface: NodeTypeManager
This method removes all JCR node types that are defined in one to many jcr-mapping XML files.

Specified by:
removeNodeTypesFromMappingFile in interface NodeTypeManager
Parameters:
session - Repository session
mappingXmlFiles - InputStreams to jcr-mapping xml file
Throws:
NodeTypeRemovalException - NodeTypeRemovalException


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