blob: 7084bc2afa2019671863b1a3c3e63181e1dc453f [file] [view]
---
title: 4.2.1 - Schema Objects
navPrev: 4.2-schema-manager.html
navPrevText: 4.2 - Schema Manager
navUp: 4.2-schema-manager.html
navUpText: 4.2 - Schema Manager
navNext: 4.2.2-registries.html
navNextText: 4.2.2 - Registries
---
# 4.2.1 - Schema Objects
## Content
* [AttributeTypes](4.2.1.1-attribute-types.html)
* [ObjectClasses](4.2.1.2-object-classes.html)
* [Syntaxes](4.2.1.3-syntaxes.html)
* [MatchingRules](4.2.1.4-matching-rules.html)
* [DITContentRules](4.2.1.5-dit-content-rules.html)
* [DITStructureRules](4.2.1.6-dit-structure-rules.html)
* [MatchingRuleUses](4.2.1.7-matching-rule-uses.html)
* [NameForms](4.2.1.8-name-forms.html)
* [ApacheDS Schema Elements](4.2.1.9-apacheds-schema-elements.html)
# Introduction
LDAP defines 8 different Schema Objects, that are used to define what we can store in a LDAP server, how what we store is organized, and which constraints are applied on those elements.
In the API, we also define 3 other **SchemaObjects**, which are necessary to control the values and to compare them. They are hard coded, and can be extended if needed.
## The Schema Object list
Here are the 8 LDAP **SchemaObject**s and the 3 additional ones :
| Name | Description |
|---|---|
| **[ObjectClasses (e)](4.2.1.2-object-classes.html)** | Defines the permitted **AttributeType**s of an entry |
| **[AttributeTypes (...)](4.2.1.1-attribute-types.html)** | Defines the type of attributes we can store in an entry |
| **[Syntaxes (e)](4.2.1.3-syntaxes.html)** | Defines the syntax that is applied to the **AttributeType** values |
| **[MatchingRules (e)](4.2.1.4-matching-rules.html)** | The rules that are used to match **AttributeType**'s values |
| **[DITContentRules (e)](4.2.1.5-dit-content-rules.html)** | Defines the allowed or forbidden **AttributeType**s and **ObjectClasse**s |
| **[DITStructureRules (e)](4.2.1.6-dit-structure-rules.html)** | Defines the hierarchical relationships between entries |
| **[NameForms (e)](4.2.1.8-name-forms.html)** | Defines the **AttributeType**s that may be use in a **RDN** |
| **[MatchingRuleUses (e)](4.2.1.7-matching-rule-uses.html)** | Defines the **AttributeType**s that can be used for a **MatchingRule** |
| _**[SyntaxChecker (e)]()**_ | The function that do the check on values |
| _**[Normalizer (e)]()**_ | The function that normalize the values |
| _**[LdapComparator (e)]()**_ | The function that compare two values |
The last three elements are ApacheDS specific.
All those elements have some tight relationships. The following schema expose all the relations between all those elements :
![](images/SchemaObjects.png)
## Java Class hierarchy
Here is the relation between the various Java classes that are implementing the various **SchemaObject**s elements :
![](images/SchemaObjectHier.png)
As we can see, the 3 specific **SchemaObject**s are derived from a **LoadableSchemaObject** abstract class, which allows the developper to inject a new instance of one of those 3 **SchemaObject**s.
From teh developper point of view, the interesting methods are the following :
* equals() : checks that two **SchemaObject** instances are equals
* getDescription() : gets the DESC part of the **SchemaObject**
* getExtension(String) : gets the given extension (X-abc)
* getExtensions() : gets all the extensions for this **SchemaObject**
* getName() : gets the first name fo this **SchemaObject**
* getNames() : gets all the nales for this **SchemaObject**
* getObjectType() : gets the **SchemaObject** type
* getOid() : gets the **SchemaObject** OID
* getSchemaName() : gets the associated shcema name, if any
* getSpecification() : gets the OpenLDAP synatx specification for this **SchemaObject**
* hasExtension(String) : tells if this **SchemaObject** has some extensions
* isDisabled() : tells if this **SchemaObject** is disabled
* isEnabled() : tells if this **SchemaObject** is enabled
* isObsolete() : tells if this **SchemaObject** is obsolete and should not been used
* isReadOnly() : tells if this **SchemaObject** can't be modified
All those methods are available for all the **SchemaObject**. There are specific methods available for each specific **SchemaObject**, taht will be exposed in the dedicated pages.