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

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

public class DITStructureRule
extends AbstractSchemaObject

A dITStructureRule definition. A dITStructureRules is a rule governing the structure of the DIT by specifying a permitted superior to subordinate entry relationship. A structure rule relates a nameForm, and therefore a STRUCTURAL objectClass, to superior dITStructureRules. This permits entries of the STRUCTURAL objectClass identified by the nameForm to exist in the DIT as subordinates to entries governed by the indicated superior dITStructureRules. Hence dITStructureRules only apply to structural object classes.

According to ldapbis [MODELS]:

  DIT structure rule descriptions are written according to the ABNF:
  
    DITStructureRuleDescription = LPAREN WSP
        ruleid                    ; rule identifier
        [ SP "NAME" SP qdescrs ]  ; short names (descriptors)
        [ SP "DESC" SP qdstring ] ; description
        [ SP "OBSOLETE" ]         ; not active
        SP "FORM" SP oid          ; NameForm
        [ SP "SUP" ruleids ]      ; superior rules
        extensions WSP RPAREN     ; extensions
 
    ruleids = ruleid / ( LPAREN WSP ruleidlist WSP RPAREN )
 
    ruleidlist = ruleid *( SP ruleid )
 
    ruleid = number
 
  where:
    [ruleid] is the rule identifier of this DIT structure rule;
    NAME [qdescrs] are short names (descriptors) identifying this DIT
        structure rule;
    DESC [qdstring] is a short descriptive string;
    OBSOLETE indicates this DIT structure rule use is not active;
    FORM is specifies the name form associated with this DIT structure
        rule;
    SUP identifies superior rules (by rule id); and
    [extensions] describe extensions.
  
  If no superior rules are identified, the DIT structure rule applies
  to an autonomous administrative point (e.g. the root vertex of the
  subtree controlled by the subschema) [X.501].
 

Version:
$Rev: 927122 $
Author:
Apache Directory Project
See Also:
RFC2252 Section 6.33, ldapbis [MODELS], DescriptionUtils.getDescription(DITStructureRule), 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
DITStructureRule(int ruleId)
          Creates a new instance of DITStructureRule
 
Method Summary
 void addSuperRule(java.lang.Integer superRule)
          Adds a new superior RuleId
 void clear()
          Clear the current SchemaObject : remove all the references to other objects, and all the Maps.
 DITStructureRule copy()
          Copy a DITStructureRule
 boolean equals(java.lang.Object o)
           
 java.lang.String getForm()
           
 java.lang.String getOid()
          The DSR does not have an OID, so throw an exception
 int getRuleId()
           
 java.util.List<java.lang.Integer> getSuperRules()
           
 void setForm(java.lang.String form)
          Sets the associated NameForm's OID
 void setRuleId(int ruleId)
          Sets the rule identifier of this DIT structure rule;
 void setSuperRules(java.util.List<java.lang.Integer> superRules)
          Sets the list of superior RuleIds
 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, 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

DITStructureRule

public DITStructureRule(int ruleId)
Creates a new instance of DITStructureRule

Method Detail

getForm

public java.lang.String getForm()
Returns:
The associated NameForm's OID

setForm

public void setForm(java.lang.String form)
Sets the associated NameForm's OID

Parameters:
form - The NameForm's OID

getRuleId

public int getRuleId()
Returns:
The Rule ID

setRuleId

public void setRuleId(int ruleId)
Sets the rule identifier of this DIT structure rule;

Parameters:
ruleId - the rule identifier of this DIT structure rule;

getSuperRules

public java.util.List<java.lang.Integer> getSuperRules()
Returns:
The list of superiors RuleIDs

setSuperRules

public void setSuperRules(java.util.List<java.lang.Integer> superRules)
Sets the list of superior RuleIds

Parameters:
superRules - the list of superior RuleIds

addSuperRule

public void addSuperRule(java.lang.Integer superRule)
Adds a new superior RuleId

Parameters:
superRule - The superior RuleID to add

getOid

public java.lang.String getOid()
The DSR does not have an OID, so throw an exception

Specified by:
getOid in interface SchemaObject
Overrides:
getOid in class AbstractSchemaObject
Returns:
an OID for this SchemaObject or its MatchingRule if this SchemaObject is a MatchingRuleUse object

toString

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

copy

public DITStructureRule copy()
Copy a DITStructureRule

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.