org.xcmis.spi.basic
Class BasicTypeManager

java.lang.Object
  extended by org.xcmis.spi.basic.BasicTypeManager
All Implemented Interfaces:
TypeManager

public abstract class BasicTypeManager
extends Object
implements TypeManager

Basic Type Manager


Field Summary
protected  Map<String,Set<String>> typeChildren
           
protected  Map<String,TypeDefinition> types
           
 
Constructor Summary
BasicTypeManager()
           
 
Method Summary
 String addType(TypeDefinition type)
          Add new type in repository.
 ItemsIterator<TypeDefinition> getTypeChildren(String typeId, boolean includePropertyDefinitions)
          Iterator over object types.
 TypeDefinition getTypeDefinition(String typeId, boolean includePropertyDefinition)
          Get type definition for type typeId .
 void removeType(String typeId)
          Remove type definition for type typeId .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

types

protected final Map<String,TypeDefinition> types

typeChildren

protected final Map<String,Set<String>> typeChildren
Constructor Detail

BasicTypeManager

public BasicTypeManager()
Method Detail

addType

public String addType(TypeDefinition type)
               throws StorageException
Add new type in repository. 2.1.3 Object-Type A repository MAY define additional object-types beyond the CMIS Base Object-Types Implementation Compatibility: MAY be implemented.

Specified by:
addType in interface TypeManager
Parameters:
type - the type definition
Returns:
ID of added type
Throws:
StorageException - if type can't be added cause to storage internal problem

getTypeChildren

public ItemsIterator<TypeDefinition> getTypeChildren(String typeId,
                                                     boolean includePropertyDefinitions)
                                              throws TypeNotFoundException
Iterator over object types.

Specified by:
getTypeChildren in interface TypeManager
Parameters:
typeId - the type id, if not null then return only specified Object Type and its direct descendant. If null then return base types
includePropertyDefinitions - true if property definition should be included false otherwise
Returns:
set of base types or specified object type and its direct children
Throws:
TypeNotFoundException - if type typeId does not exist

getTypeDefinition

public TypeDefinition getTypeDefinition(String typeId,
                                        boolean includePropertyDefinition)
                                 throws TypeNotFoundException
Get type definition for type typeId .

Specified by:
getTypeDefinition in interface TypeManager
Parameters:
typeId - type Id
includePropertyDefinition - if true property definition should be included
Returns:
type definition
Throws:
TypeNotFoundException - if type typeId does not exist

removeType

public void removeType(String typeId)
                throws TypeNotFoundException,
                       ConstraintException,
                       StorageException
Remove type definition for type typeId .

Specified by:
removeType in interface TypeManager
Parameters:
typeId - type Id
Throws:
TypeNotFoundException - if type typeId not found in repository
ConstraintException - if removing type violates a storage constraint. For example, if storage already contains object of this type
StorageException - if type can't be added cause to storage internal problem


Copyright © 2011 eXo Platform SAS. All Rights Reserved.