org.apache.directory.shared.ldap.schema
Class DITContentRule

java.lang.Object
  extended by org.apache.directory.shared.ldap.schema.AbstractSchemaObject
      extended by org.apache.directory.shared.ldap.schema.DITContentRule
All Implemented Interfaces:
java.io.Serializable, SchemaObject

public class DITContentRule
extends AbstractSchemaObject

A ditContentRule specification. ditContentRules identify the content of entries of a particular structural objectClass. They specify the AUXILIARY objectClasses and additional attribute types permitted to appear, or excluded from appearing in entries of the indicated STRUCTURAL objectClass.

According to ldapbis [MODELS]:

  4.1.6. DIT Content Rules
  
    A DIT content rule is a "rule governing the content of entries of a
    particular structural object class" [X.501].
  
    For DIT entries of a particular structural object class, a DIT content
    rule specifies which auxiliary object classes the entries are allowed
    to belong to and which additional attributes (by type) are required,
    allowed or not allowed to appear in the entries.
  
    The list of precluded attributes cannot include any attribute listed
    as mandatory in rule, the structural object class, or any of the
    allowed auxiliary object classes.
  
    Each content rule is identified by the object identifier, as well as
    any short names (descriptors), of the structural object class it
    applies to.
  
    An entry may only belong to auxiliary object classes listed in the
    governing content rule.
  
    An entry must contain all attributes required by the object classes
    the entry belongs to as well as all attributed required by the
    governing content rule.
  
    An entry may contain any non-precluded attributes allowed by the
    object classes the entry belongs to as well as all attributes allowed
    by the governing content rule.
  
    An entry cannot include any attribute precluded by the governing
    content rule.
  
    An entry is governed by (if present and active in the subschema) the
    DIT content rule which applies to the structural object class of the
    entry (see Section 2.4.2).  If no active rule is present for the
    entry's structural object class, the entry's content is governed by
    the structural object class (and possibly other aspects of user and
    system schema).
 
    DIT content rule descriptions are written according to the ABNF:
 
      DITContentRuleDescription = LPAREN WSP
          numericoid                ; object identifier
          [ SP "NAME" SP qdescrs ]  ; short names (descriptors)
          [ SP "DESC" SP qdstring ] ; description
          [ SP "OBSOLETE" ]         ; not active
          [ SP "AUX" SP oids ]      ; auxiliary object classes
          [ SP "MUST" SP oids ]     ; attribute types
          [ SP "MAY" SP oids ]      ; attribute types
          [ SP "NOT" SP oids ]      ; attribute types
          extensions WSP RPAREN     ; extensions
 
    where:
 
      [numericoid] is the object identifier of the structural object class
          associated with this DIT content rule;
      NAME [qdescrs] are short names (descriptors) identifying this DIT
          content rule;
      DESC [qdstring] is a short descriptive string;
      OBSOLETE indicates this DIT content rule use is not active;
      AUX specifies a list of auxiliary object classes which entries
          subject to this DIT content rule may belong to;
      MUST, MAY, and NOT specify lists of attribute types which are
          required, allowed, or precluded, respectively, from appearing in
          entries subject to this DIT content rule; and
      [extensions] describe extensions.
 

Version:
$Rev: 927122 $
Author:
Apache Directory Project
See Also:
RFC 2252 Section 5.4.3, ldapbis [MODELS], DescriptionUtils.getDescription(DITContentRule), Serialized Form

Field Summary
static long serialVersionUID
          The serialVersionUID
 
Fields inherited from class org.apache.directory.shared.ldap.schema.AbstractSchemaObject
description, extensions, isEnabled, isObsolete, isReadOnly, locked, names, objectType, oid, schemaName, specification
 
Constructor Summary
DITContentRule(java.lang.String oid)
          Creates a DITContentRule object using a unique OID.
 
Method Summary
 void addAuxObjectClasses(ObjectClass objectClass)
          Add an Auxiliary ObjectClass
 void addAuxObjectClassOidOids(java.lang.String oid)
          Add an Auxiliary ObjectClass Oid
 void addMayAttributeTypeOids(java.lang.String oid)
          Add an allowed AttributeType
 void addMayAttributeTypes(AttributeType attributeType)
          Add an allowed AttributeType
 void addMustAttributeTypeOids(java.lang.String oid)
          Add a required AttributeType OID
 void addMustAttributeTypes(AttributeType attributeType)
          Add a required AttributeType
 void addNotAttributeTypeOids(java.lang.String oid)
          Add a precluded AttributeType
 void addNotAttributeTypes(AttributeType attributeType)
          Add a precluded AttributeType
 void addToRegistries(Registries registries)
          Inject the DITContentRule into the registries, updating the references to other SchemaObject
 void clear()
          Clear the current SchemaObject : remove all the references to other objects, and all the Maps.
 DITContentRule copy()
          Copy a DITContentRule
 boolean equals(java.lang.Object o)
           
 java.util.List<ObjectClass> getAuxObjectClasses()
           
 java.util.List<java.lang.String> getAuxObjectClassOids()
           
 java.util.List<java.lang.String> getMayAttributeTypeOids()
           
 java.util.List<AttributeType> getMayAttributeTypes()
           
 java.util.List<java.lang.String> getMustAttributeTypeOids()
           
 java.util.List<AttributeType> getMustAttributeTypes()
           
 java.util.List<java.lang.String> getNotAttributeTypeOids()
           
 java.util.List<AttributeType> getNotAttributeTypes()
           
 void setAuxObjectClasses(java.util.List<ObjectClass> auxObjectClasses)
           
 void setAuxObjectClassOids(java.util.List<java.lang.String> auxObjectClassOids)
           
 void setMayAttributeTypeOids(java.util.List<java.lang.String> mayAttributeTypeOids)
           
 void setMayAttributeTypes(java.util.List<AttributeType> mayAttributeTypes)
          Sets the list of allowed AttributeTypes
 void setMustAttributeTypeOids(java.util.List<java.lang.String> mustAttributeTypeOids)
           
 void setMustAttributeTypes(java.util.List<AttributeType> mustAttributeTypes)
          Sets the list of required AttributeTypes
 void setNotAttributeTypeOids(java.util.List<java.lang.String> notAttributeTypeOids)
           
 void setNotAttributeTypes(java.util.List<AttributeType> notAttributeTypes)
          Sets the list of precluded AttributeTypes
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.shared.ldap.schema.AbstractSchemaObject
addExtension, addName, addToRegistries, compareOid, copy, getDescription, getExtensions, getName, getNames, getObjectType, getOid, getSchemaName, getSpecification, hashCode, isDisabled, isEnabled, isObsolete, isReadOnly, lock, registerOid, removeFromRegistries, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setOid, setReadOnly, setRegistries, setSchemaName, setSpecification
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
The serialVersionUID

See Also:
Constant Field Values
Constructor Detail

DITContentRule

public DITContentRule(java.lang.String oid)
Creates a DITContentRule object using a unique OID.

Parameters:
oid - the OID for this DITContentRule
Method Detail

getAuxObjectClassOids

public java.util.List<java.lang.String> getAuxObjectClassOids()
Returns:
the auxObjectClassOids

addAuxObjectClassOidOids

public void addAuxObjectClassOidOids(java.lang.String oid)
Add an Auxiliary ObjectClass Oid

Parameters:
oid - The ObjectClass oid

addAuxObjectClasses

public void addAuxObjectClasses(ObjectClass objectClass)
Add an Auxiliary ObjectClass

Parameters:
oid - The ObjectClass

setAuxObjectClassOids

public void setAuxObjectClassOids(java.util.List<java.lang.String> auxObjectClassOids)
Parameters:
auxObjectClassOids - the auxObjectClassOids to set

setAuxObjectClasses

public void setAuxObjectClasses(java.util.List<ObjectClass> auxObjectClasses)
Parameters:
auxObjectClasses - the auxObjectClasses to set

getAuxObjectClasses

public java.util.List<ObjectClass> getAuxObjectClasses()
Returns:
the auxObjectClasses

getMayAttributeTypeOids

public java.util.List<java.lang.String> getMayAttributeTypeOids()
Returns:
the mayAttributeTypeOids

addMayAttributeTypeOids

public void addMayAttributeTypeOids(java.lang.String oid)
Add an allowed AttributeType

Parameters:
oid - The attributeType oid

addMayAttributeTypes

public void addMayAttributeTypes(AttributeType attributeType)
Add an allowed AttributeType

Parameters:
attributeType - The attributeType

setMayAttributeTypeOids

public void setMayAttributeTypeOids(java.util.List<java.lang.String> mayAttributeTypeOids)
Parameters:
mayAttributeTypeOids - the mayAttributeTypeOids to set

setMayAttributeTypes

public void setMayAttributeTypes(java.util.List<AttributeType> mayAttributeTypes)
Sets the list of allowed AttributeTypes

Parameters:
mayAttributeTypes - the list of allowed AttributeTypes

getMayAttributeTypes

public java.util.List<AttributeType> getMayAttributeTypes()
Returns:
the mayAttributeTypes

getMustAttributeTypeOids

public java.util.List<java.lang.String> getMustAttributeTypeOids()
Returns:
the mustAttributeTypeOids

addMustAttributeTypeOids

public void addMustAttributeTypeOids(java.lang.String oid)
Add a required AttributeType OID

Parameters:
oid - The attributeType OID

addMustAttributeTypes

public void addMustAttributeTypes(AttributeType attributeType)
Add a required AttributeType

Parameters:
attributeType - The attributeType

setMustAttributeTypeOids

public void setMustAttributeTypeOids(java.util.List<java.lang.String> mustAttributeTypeOids)
Parameters:
mustAttributeTypeOids - the mustAttributeTypeOids to set

setMustAttributeTypes

public void setMustAttributeTypes(java.util.List<AttributeType> mustAttributeTypes)
Sets the list of required AttributeTypes

Parameters:
mayAttributeTypes - the list of required AttributeTypes

getMustAttributeTypes

public java.util.List<AttributeType> getMustAttributeTypes()
Returns:
the mustAttributeTypes

getNotAttributeTypeOids

public java.util.List<java.lang.String> getNotAttributeTypeOids()
Returns:
the notAttributeTypeOids

addNotAttributeTypeOids

public void addNotAttributeTypeOids(java.lang.String oid)
Add a precluded AttributeType

Parameters:
oid - The attributeType oid

addNotAttributeTypes

public void addNotAttributeTypes(AttributeType attributeType)
Add a precluded AttributeType

Parameters:
attributeType - The attributeType

setNotAttributeTypeOids

public void setNotAttributeTypeOids(java.util.List<java.lang.String> notAttributeTypeOids)
Parameters:
notAttributeTypeOids - the notAttributeTypeOids to set

setNotAttributeTypes

public void setNotAttributeTypes(java.util.List<AttributeType> notAttributeTypes)
Sets the list of precluded AttributeTypes

Parameters:
mayAttributeTypes - the list of precluded AttributeTypes

getNotAttributeTypes

public java.util.List<AttributeType> getNotAttributeTypes()
Returns:
the notAttributeTypes

addToRegistries

public void addToRegistries(Registries registries)
                     throws LdapException
Inject the DITContentRule into the registries, updating the references to other SchemaObject

Parameters:
registries - The Registries
Throws:
If - the addition failed
LdapException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

copy

public DITContentRule copy()
Copy a DITContentRule

Specified by:
copy in interface SchemaObject
Specified by:
copy in class AbstractSchemaObject
Returns:
The copied SchemaObject

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface SchemaObject
Overrides:
equals in class AbstractSchemaObject
See Also:
Object.equals(Object)

clear

public void clear()
Clear the current SchemaObject : remove all the references to other objects, and all the Maps.

Specified by:
clear in interface SchemaObject
Overrides:
clear in class AbstractSchemaObject


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.