Class TypeManagerImpl

  • All Implemented Interfaces:
    org.apache.chemistry.opencmis.server.support.TypeManager

    public class TypeManagerImpl
    extends Object
    implements org.apache.chemistry.opencmis.server.support.TypeManager
    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.

    Structures are not copied when returned.

    • Field Detail

      • DEFAULT_MAX_TYPE_CHILDREN

        public static final int DEFAULT_MAX_TYPE_CHILDREN
        See Also:
        Constant Field Values
      • typesMap

        protected Map<String,​org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer> typesMap
    • Constructor Detail

      • TypeManagerImpl

        public TypeManagerImpl()
    • Method Detail

      • getTypeById

        public org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer getTypeById​(String typeId)
        Specified by:
        getTypeById in interface org.apache.chemistry.opencmis.server.support.TypeManager
      • getTypeDefinition

        public org.apache.chemistry.opencmis.commons.definitions.TypeDefinition getTypeDefinition​(String typeId)
      • hasType

        public boolean hasType​(String typeId)
        Checks if a type is known.
        Parameters:
        typeId - the type id
        Returns:
        true if known
        Since:
        5.9.3
      • getTypeByQueryName

        public org.apache.chemistry.opencmis.commons.definitions.TypeDefinition getTypeByQueryName​(String typeQueryName)
        Specified by:
        getTypeByQueryName in interface org.apache.chemistry.opencmis.server.support.TypeManager
      • getTypeChildren

        public org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionList getTypeChildren​(String typeId,
                                                                                                    Boolean includePropertyDefinitions,
                                                                                                    BigInteger maxItems,
                                                                                                    BigInteger skipCount)
      • getTypeDescendants

        public List<org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer> getTypeDescendants​(String typeId,
                                                                                                                  int depth,
                                                                                                                  Boolean includePropertyDefinitions)
      • getTypeDefinitionList

        public Collection<org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer> getTypeDefinitionList()
        Specified by:
        getTypeDefinitionList in interface org.apache.chemistry.opencmis.server.support.TypeManager
      • getRootTypes

        public List<org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer> getRootTypes()
        Specified by:
        getRootTypes in interface org.apache.chemistry.opencmis.server.support.TypeManager
      • addTypeDefinition

        public void addTypeDefinition​(org.apache.chemistry.opencmis.commons.definitions.TypeDefinition type,
                                      boolean addInheritedProperties)
        Add a type to the type system. Add type to children of parent types. If specified, add all properties from inherited types.,
        Specified by:
        addTypeDefinition in interface org.apache.chemistry.opencmis.server.support.TypeManager
        Parameters:
        type - new type to add
      • addTypeDefinition

        public void addTypeDefinition​(org.apache.chemistry.opencmis.commons.definitions.TypeDefinition type)
      • getPropertyIdForQueryName

        public String getPropertyIdForQueryName​(org.apache.chemistry.opencmis.commons.definitions.TypeDefinition typeDefinition,
                                                String propQueryName)
        Specified by:
        getPropertyIdForQueryName in interface org.apache.chemistry.opencmis.server.support.TypeManager
      • getPropertyIdForQueryName

        public String getPropertyIdForQueryName​(String propQueryName)
      • addInheritedProperties

        protected void addInheritedProperties​(Map<String,​org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>> propDefs,
                                              org.apache.chemistry.opencmis.commons.definitions.TypeDefinition type)
      • addInheritedPropertyDefinitions

        protected void addInheritedPropertyDefinitions​(Map<String,​org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>> propDefs,
                                                       Map<String,​org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?>> superPropDefs)
      • cloneTypes

        protected static List<org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer> cloneTypes​(List<org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer> types,
                                                                                                                    int depth,
                                                                                                                    boolean includePropertyDefinitions)
        Returns a clone of a types tree.

        Removes properties on the clone if requested, cuts the children of the clone if the depth is exceeded.

      • updateTypeDefinition

        public void updateTypeDefinition​(org.apache.chemistry.opencmis.commons.definitions.TypeDefinition typeDefinition)
        Specified by:
        updateTypeDefinition in interface org.apache.chemistry.opencmis.server.support.TypeManager
      • deleteTypeDefinition

        public void deleteTypeDefinition​(String typeId)
        Specified by:
        deleteTypeDefinition in interface org.apache.chemistry.opencmis.server.support.TypeManager