org.apache.chemistry.opencmis.inmemory
Class TypeManagerImpl

java.lang.Object
  extended by org.apache.chemistry.opencmis.inmemory.TypeManagerImpl
All Implemented Interfaces:
TypeManager

public class TypeManagerImpl
extends java.lang.Object
implements TypeManager

Class that manages a type system for a repository types can be added, the inheritance can be managed and type can be retrieved for a given type id.

Author:
Jens

Constructor Summary
TypeManagerImpl()
           
 
Method Summary
 void addTypeDefinition(TypeDefinition cmisType)
          Add a type to the type system.
 void clearTypeSystem()
          Remove all types from the type system.
 java.lang.String getPropertyIdForQueryName(TypeDefinition typeDefinition, java.lang.String propQueryName)
          retrieve the property id from a type for a given property query name
 java.util.List<TypeDefinitionContainer> getRootTypes()
          return a list of the root types as defined in the CMIS spec (for document, folder, policy and relationship
 TypeDefinitionContainer getTypeById(java.lang.String typeId)
          return a type definition from the type definition id
 TypeDefinition getTypeByQueryName(java.lang.String typeQueryName)
          return a type definition from the type query name or null if not found
 java.util.Collection<TypeDefinitionContainer> getTypeDefinitionList()
          return a list of all types known in this repository
 void initTypeSystem(java.util.List<TypeDefinition> typesList)
          Initialize the type system with the given types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeManagerImpl

public TypeManagerImpl()
Method Detail

getTypeById

public TypeDefinitionContainer getTypeById(java.lang.String typeId)
Description copied from interface: TypeManager
return a type definition from the type definition id

Specified by:
getTypeById in interface TypeManager
Parameters:
typeId - id of the type definition
Returns:
type definition for this id

getTypeByQueryName

public TypeDefinition getTypeByQueryName(java.lang.String typeQueryName)
Description copied from interface: TypeManager
return a type definition from the type query name or null if not found

Specified by:
getTypeByQueryName in interface TypeManager
Parameters:
typeQueryName - query name of the type definition
Returns:
type definition for this query name

getTypeDefinitionList

public java.util.Collection<TypeDefinitionContainer> getTypeDefinitionList()
Description copied from interface: TypeManager
return a list of all types known in this repository

Specified by:
getTypeDefinitionList in interface TypeManager
Returns:

getRootTypes

public java.util.List<TypeDefinitionContainer> getRootTypes()
Description copied from interface: TypeManager
return a list of the root types as defined in the CMIS spec (for document, folder, policy and relationship

Specified by:
getRootTypes in interface TypeManager
Returns:

initTypeSystem

public void initTypeSystem(java.util.List<TypeDefinition> typesList)
Initialize the type system with the given types. This list must not contain the CMIS default types. The default type are always contained by default.

Parameters:
typesList - list of types to add to the repository

addTypeDefinition

public void addTypeDefinition(TypeDefinition cmisType)
Add a type to the type system. Add all properties from inherited types, add type to children of parent types.

Parameters:
repositoryId - repository to which the type is added
cmisType - new type to add

clearTypeSystem

public void clearTypeSystem()
Remove all types from the type system. After this call only the default CMIS types are present in the type system. Use this method with care, its mainly intended for unit tests

Parameters:
repositoryId -

getPropertyIdForQueryName

public java.lang.String getPropertyIdForQueryName(TypeDefinition typeDefinition,
                                                  java.lang.String propQueryName)
Description copied from interface: TypeManager
retrieve the property id from a type for a given property query name

Specified by:
getPropertyIdForQueryName in interface TypeManager
Parameters:
typeDefinition - type definition containing query name
propQueryName - query name of property
Returns:
property id of property or null if not found


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.