org.apache.directory.server.core.schema
Class SchemaChecker

java.lang.Object
  extended by org.apache.directory.server.core.schema.SchemaChecker

public class SchemaChecker
extends java.lang.Object

Performs schema checks on behalf of the SchemaService. TODO: we really need to refactor this code since there's much duplication

Version:
$Rev: 493916 $, $Date: 2007-01-08 03:44:33 +0100 (Mon, 08 Jan 2007) $
Author:
Apache Directory Project

Constructor Summary
SchemaChecker()
           
 
Method Summary
static void preventRdnChangeOnModifyRemove(javax.naming.Name name, int mod, javax.naming.directory.Attribute attribute, OidRegistry oidRegistry)
          Makes sure a modify operation does not delete RDN attributes or their value.
static void preventRdnChangeOnModifyRemove(javax.naming.Name name, int mod, javax.naming.directory.Attributes attributes, OidRegistry oidRegistry)
          Makes sure a modify operation does not delete RDN attributes or their value.
static void preventRdnChangeOnModifyReplace(javax.naming.Name name, int mod, javax.naming.directory.Attribute attribute, OidRegistry oidRegistry)
          Makes sure a modify operation does not replace RDN attributes or their value.
static void preventRdnChangeOnModifyReplace(javax.naming.Name name, int mod, javax.naming.directory.Attributes attributes, OidRegistry oidRegistry)
          Makes sure a modify operation does not replace RDN attributes or their value.
static void preventStructuralClassRemovalOnModifyRemove(ObjectClassRegistry registry, javax.naming.Name name, int mod, javax.naming.directory.Attribute attribute, javax.naming.directory.Attribute entryObjectClasses)
          Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass.
static void preventStructuralClassRemovalOnModifyRemove(ObjectClassRegistry registry, javax.naming.Name name, int mod, javax.naming.directory.Attributes attributes, javax.naming.directory.Attribute entryObjectClasses)
          Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass.
static void preventStructuralClassRemovalOnModifyReplace(ObjectClassRegistry registry, javax.naming.Name name, int mod, javax.naming.directory.Attribute attribute)
          Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass.
static void preventStructuralClassRemovalOnModifyReplace(ObjectClassRegistry registry, javax.naming.Name name, int mod, javax.naming.directory.Attributes attributes)
          Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaChecker

public SchemaChecker()
Method Detail

preventStructuralClassRemovalOnModifyReplace

public static void preventStructuralClassRemovalOnModifyReplace(ObjectClassRegistry registry,
                                                                javax.naming.Name name,
                                                                int mod,
                                                                javax.naming.directory.Attribute attribute)
                                                         throws javax.naming.NamingException
Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass. At least one STRUCTURAL objectClass must be specified for the entry after modifications take effect.

Parameters:
registry - the objectClass registry to lookup ObjectClass specifications
name - the name of the entry being modified
mod - the type of modification operation being performed (should be REMOVE_ATTRIBUTE)
attribute - the attribute being modified
Throws:
javax.naming.NamingException - if modify operations leave the entry inconsistent without a STRUCTURAL objectClass

preventStructuralClassRemovalOnModifyReplace

public static void preventStructuralClassRemovalOnModifyReplace(ObjectClassRegistry registry,
                                                                javax.naming.Name name,
                                                                int mod,
                                                                javax.naming.directory.Attributes attributes)
                                                         throws javax.naming.NamingException
Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass. At least one STRUCTURAL objectClass must be specified for the entry after modifications take effect.

Parameters:
registry - the objectClass registry to lookup ObjectClass specifications
name - the name of the entry being modified
mod - the type of modification operation being performed (should be REMOVE_ATTRIBUTE)
attributes - the attributes being modified
Throws:
javax.naming.NamingException - if modify operations leave the entry inconsistent without a STRUCTURAL objectClass

preventStructuralClassRemovalOnModifyRemove

public static void preventStructuralClassRemovalOnModifyRemove(ObjectClassRegistry registry,
                                                               javax.naming.Name name,
                                                               int mod,
                                                               javax.naming.directory.Attribute attribute,
                                                               javax.naming.directory.Attribute entryObjectClasses)
                                                        throws javax.naming.NamingException
Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass. At least one STRUCTURAL objectClass must be specified for the entry after modifications take effect.

Parameters:
registry - the objectClass registry to lookup ObjectClass specifications
name - the name of the entry being modified
mod - the type of modification operation being performed (should be REMOVE_ATTRIBUTE)
attribute - the attribute being modified
entryObjectClasses - the entry being modified
Throws:
javax.naming.NamingException - if modify operations leave the entry inconsistent without a STRUCTURAL objectClass

preventStructuralClassRemovalOnModifyRemove

public static void preventStructuralClassRemovalOnModifyRemove(ObjectClassRegistry registry,
                                                               javax.naming.Name name,
                                                               int mod,
                                                               javax.naming.directory.Attributes attributes,
                                                               javax.naming.directory.Attribute entryObjectClasses)
                                                        throws javax.naming.NamingException
Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass. At least one STRUCTURAL objectClass must be specified for the entry after modifications take effect.

Parameters:
registry - the objectClass registry to lookup ObjectClass specifications
name - the name of the entry being modified
mod - the type of modification operation being performed (should be REMOVE_ATTRIBUTE)
attributes - the attributes being modified
entryObjectClasses - the entry being modified
Throws:
javax.naming.NamingException - if modify operations leave the entry inconsistent without a STRUCTURAL objectClass

preventRdnChangeOnModifyReplace

public static void preventRdnChangeOnModifyReplace(javax.naming.Name name,
                                                   int mod,
                                                   javax.naming.directory.Attribute attribute,
                                                   OidRegistry oidRegistry)
                                            throws javax.naming.NamingException
Makes sure a modify operation does not replace RDN attributes or their value. According to section 4.6 of RFC 2251 a modify operation cannot be used to remove Rdn attributes as seen below:

     The Modify Operation cannot be used to remove from an entry any of
     its distinguished values, those values which form the entry's
     relative distinguished name.  An attempt to do so will result in the
     server returning the error notAllowedOnRDN.  The Modify DN Operation
     described in section 4.9 is used to rename an entry.
 

Parameters:
name - the distinguished name of the attribute being modified
mod - the modification operation being performed (should be REPLACE_ATTRIBUTE )
attribute - the attribute being modified
Throws:
javax.naming.NamingException - if the modify operation is removing an Rdn attribute

preventRdnChangeOnModifyReplace

public static void preventRdnChangeOnModifyReplace(javax.naming.Name name,
                                                   int mod,
                                                   javax.naming.directory.Attributes attributes,
                                                   OidRegistry oidRegistry)
                                            throws javax.naming.NamingException
Makes sure a modify operation does not replace RDN attributes or their value. According to section 4.6 of RFC 2251 a modify operation cannot be used to remove Rdn attributes as seen below:

     The Modify Operation cannot be used to remove from an entry any of
     its distinguished values, those values which form the entry's
     relative distinguished name.  An attempt to do so will result in the
     server returning the error notAllowedOnRDN.  The Modify DN Operation
     described in section 4.9 is used to rename an entry.
 

Parameters:
name - the distinguished name of the attribute being modified
mod - the modification operation being performed (should be REPLACE_ATTRIBUTE )
attributes - the attributes being modified
Throws:
javax.naming.NamingException - if the modify operation is removing an Rdn attribute

preventRdnChangeOnModifyRemove

public static void preventRdnChangeOnModifyRemove(javax.naming.Name name,
                                                  int mod,
                                                  javax.naming.directory.Attribute attribute,
                                                  OidRegistry oidRegistry)
                                           throws javax.naming.NamingException
Makes sure a modify operation does not delete RDN attributes or their value. According to section 4.6 of RFC 2251 a modify operation cannot be used to remove Rdn attributes as seen below:

     The Modify Operation cannot be used to remove from an entry any of
     its distinguished values, those values which form the entry's
     relative distinguished name.  An attempt to do so will result in the
     server returning the error notAllowedOnRDN.  The Modify DN Operation
     described in section 4.9 is used to rename an entry.
 

Parameters:
name - the distinguished name of the attribute being modified
mod - the modification operation being performed (should be REMOVE_ATTRIBUTE )
attribute - the attribute being modified
Throws:
javax.naming.NamingException - if the modify operation is removing an Rdn attribute

preventRdnChangeOnModifyRemove

public static void preventRdnChangeOnModifyRemove(javax.naming.Name name,
                                                  int mod,
                                                  javax.naming.directory.Attributes attributes,
                                                  OidRegistry oidRegistry)
                                           throws javax.naming.NamingException
Makes sure a modify operation does not delete RDN attributes or their value. According to section 4.6 of RFC 2251 a modify operation cannot be used to remove Rdn attributes as seen below:

     The Modify Operation cannot be used to remove from an entry any of
     its distinguished values, those values which form the entry's
     relative distinguished name.  An attempt to do so will result in the
     server returning the error notAllowedOnRDN.  The Modify DN Operation
     described in section 4.9 is used to rename an entry.
 

Parameters:
name - the distinguished name of the attribute being modified
mod - the modification operation being performed (should be REMOVE_ATTRIBUTE )
attributes - the attributes being modified
Throws:
javax.naming.NamingException - if the modify operation is removing an Rdn attribute


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