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

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

public class NameForm
extends AbstractSchemaObject

A nameForm description. NameForms define the relationship between a STRUCTURAL objectClass definition and the attributeTypes allowed to be used for the naming of an Entry of that objectClass: it defines which attributes can be used for the RDN.

According to ldapbis [MODELS]:

  4.1.7.2. Name Forms
  
   A name form "specifies a permissible RDN for entries of a particular
   structural object class.  A name form identifies a named object
   class and one or more attribute types to be used for naming (i.e.
   for the RDN).  Name forms are primitive pieces of specification
   used in the definition of DIT structure rules" [X.501].
 
   Each name form indicates the structural object class to be named,
   a set of required attribute types, and a set of allowed attributes
   types.  A particular attribute type cannot be listed in both sets.
 
   Entries governed by the form must be named using a value from each
   required attribute type and zero or more values from the allowed
   attribute types.
 
   Each name form is identified by an object identifier (OID) and,
   optionally, one or more short names (descriptors).
 
   Name form descriptions are written according to the ABNF:
 
     NameFormDescription = LPAREN WSP
         numericoid                ; object identifier
         [ SP "NAME" SP qdescrs ]  ; short names (descriptors)
         [ SP "DESC" SP qdstring ] ;String description
         [ SP "OBSOLETE" ]         ; not active
         SP "OC" SP oid            ; structural object class
         SP "MUST" SP oids         ; attribute types
         [ SP "MAY" SP oids ]      ; attribute types
         extensions WSP RPAREN     ; extensions
 
   where:
 
     [numericoid] is object identifier which identifies this name form;
     NAME [qdescrs] are short names (descriptors) identifying this name
         form;
     DESC [qdstring] is a short descriptive string;
     OBSOLETE indicates this name form is not active;
     OC identifies the structural object class this rule applies to,
     MUST and MAY specify the sets of required and allowed, respectively,
         naming attributes for this name form; and
     [extensions] describe extensions.
 
   All attribute types in the required ("MUST") and allowed ("MAY") lists
   shall be different.
 

Version:
$Rev: 928015 $
Author:
Apache Directory Project
See Also:
RFC2252 Section 6.22, ldapbis [MODELS], DescriptionUtils.getDescription(NameForm), Serialized Form

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.schema.AbstractSchemaObject
description, extensions, isEnabled, isObsolete, isReadOnly, locked, names, objectType, oid, schemaName, specification
 
Constructor Summary
NameForm(java.lang.String oid)
          Creates a new instance of MatchingRule.
 
Method Summary
 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 addToRegistries(Registries registries)
          Inject the NameForm 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.
 NameForm copy()
          Copy a NameForm
 boolean equals(java.lang.Object o)
           
 java.util.List<java.lang.String> getMayAttributeTypeOids()
          Gets all the AttributeTypes OIDs of the attribute this NameForm specifies as being usable without requirement in the given objectClass for naming: as part of the Rdn.
 java.util.List<AttributeType> getMayAttributeTypes()
          Gets all the AttributeTypes of the attribute this NameForm specifies as being useable without requirement in the given objectClass for naming: as part of the Rdn.
 java.util.List<java.lang.String> getMustAttributeTypeOids()
          Gets all the AttributeTypes OIDs of the attributes this NameForm specifies as having to be used in the given objectClass for naming: as part of the Rdn.
 java.util.List<AttributeType> getMustAttributeTypes()
          Gets all the AttributeTypes of the attributes this NameForm specifies as having to be used in the given objectClass for naming: as part of the Rdn.
 ObjectClass getStructuralObjectClass()
          Gets the STRUCTURAL ObjectClass this name form specifies naming attributes for.
 java.lang.String getStructuralObjectClassOid()
          Gets the STRUCTURAL ObjectClass this name form specifies naming attributes for.
 void setMayAttributeTypeOids(java.util.List<java.lang.String> mayAttributeTypeOids)
          Sets the list of allowed AttributeTypes
 void setMayAttributeTypes(java.util.List<AttributeType> mayAttributeTypes)
          Sets the list of allowed AttributeTypes
 void setMustAttributeTypeOids(java.util.List<java.lang.String> mustAttributeTypeOids)
          Sets the list of required AttributeTypes OIDs
 void setMustAttributeTypes(java.util.List<AttributeType> mustAttributeTypes)
          Sets the list of required AttributeTypes
 void setStructuralObjectClass(ObjectClass structuralObjectClass)
          Sets the structural object class this rule applies to
 void setStructuralObjectClassOid(java.lang.String structuralObjectClassOid)
          Sets the structural object class this rule applies to
 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
 

Constructor Detail

NameForm

public NameForm(java.lang.String oid)
Creates a new instance of MatchingRule.

Parameters:
oid - The MatchingRule OID
registries - The Registries reference
Method Detail

addToRegistries

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

Parameters:
registries - The Registries
Throws:
LdapException

getStructuralObjectClassOid

public java.lang.String getStructuralObjectClassOid()
Gets the STRUCTURAL ObjectClass this name form specifies naming attributes for.

Returns:
the ObjectClass's oid this NameForm is for

getStructuralObjectClass

public ObjectClass getStructuralObjectClass()
Gets the STRUCTURAL ObjectClass this name form specifies naming attributes for.

Returns:
the ObjectClass this NameForm is for
Throws:
LdapException - If the structuralObjectClass is invalid

setStructuralObjectClassOid

public void setStructuralObjectClassOid(java.lang.String structuralObjectClassOid)
Sets the structural object class this rule applies to

Parameters:
structuralObjectClass - the structural object class to set

setStructuralObjectClass

public void setStructuralObjectClass(ObjectClass structuralObjectClass)
Sets the structural object class this rule applies to

Parameters:
structuralObjectClass - the structural object class to set

getMustAttributeTypeOids

public java.util.List<java.lang.String> getMustAttributeTypeOids()
Gets all the AttributeTypes OIDs of the attributes this NameForm specifies as having to be used in the given objectClass for naming: as part of the Rdn.

Returns:
the AttributeTypes OIDs of the must use attributes
Throws:
LdapException - if there is a failure resolving one AttributeTyoe

getMustAttributeTypes

public java.util.List<AttributeType> getMustAttributeTypes()
Gets all the AttributeTypes of the attributes this NameForm specifies as having to be used in the given objectClass for naming: as part of the Rdn.

Returns:
the AttributeTypes of the must use attributes

setMustAttributeTypeOids

public void setMustAttributeTypeOids(java.util.List<java.lang.String> mustAttributeTypeOids)
Sets the list of required AttributeTypes OIDs

Parameters:
mustAttributeTypeOids - the list of required AttributeTypes OIDs

setMustAttributeTypes

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

Parameters:
mayAttributeTypes - the list of required AttributeTypes

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

getMayAttributeTypeOids

public java.util.List<java.lang.String> getMayAttributeTypeOids()
Gets all the AttributeTypes OIDs of the attribute this NameForm specifies as being usable without requirement in the given objectClass for naming: as part of the Rdn.

Returns:
the AttributeTypes OIDs of the may use attributes
Throws:
LdapException - if there is a failure resolving one AttributeTyoe

getMayAttributeTypes

public java.util.List<AttributeType> getMayAttributeTypes()
Gets all the AttributeTypes of the attribute this NameForm specifies as being useable without requirement in the given objectClass for naming: as part of the Rdn.

Returns:
the AttributeTypes of the may use attributes

setMayAttributeTypeOids

public void setMayAttributeTypeOids(java.util.List<java.lang.String> mayAttributeTypeOids)
Sets the list of allowed AttributeTypes

Parameters:
mayAttributeTypeOids - the list of allowed AttributeTypes

setMayAttributeTypes

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

Parameters:
mayAttributeTypes - the list of allowed AttributeTypes

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

toString

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

copy

public NameForm copy()
Copy a NameForm

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.