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 SchemaInterceptor. TODO: we really need to refactor this code since there's much duplication

Version:
$Rev: 927839 $, $Date: 2010-03-26 14:25:10 +0100 (Fri, 26 Mar 2010) $
Author:
Apache Directory Project

Constructor Summary
SchemaChecker()
           
 
Method Summary
static void preventRdnChangeOnModifyRemove(org.apache.directory.shared.ldap.name.DN name, org.apache.directory.shared.ldap.entry.ModificationOperation mod, org.apache.directory.shared.ldap.entry.EntryAttribute attribute, org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
          Makes sure a modify operation does not delete RDN attributes or their value.
static void preventRdnChangeOnModifyRemove(org.apache.directory.shared.ldap.name.DN name, org.apache.directory.shared.ldap.entry.ModificationOperation mod, org.apache.directory.shared.ldap.entry.ServerEntry entry, org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
          Makes sure a modify operation does not delete RDN attributes or their value.
static void preventRdnChangeOnModifyReplace(org.apache.directory.shared.ldap.name.DN name, org.apache.directory.shared.ldap.entry.ModificationOperation mod, org.apache.directory.shared.ldap.entry.EntryAttribute attribute, org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
          Makes sure a modify operation does not replace RDN attributes or their value.
static void preventRdnChangeOnModifyReplace(org.apache.directory.shared.ldap.name.DN name, org.apache.directory.shared.ldap.entry.ModificationOperation mod, org.apache.directory.shared.ldap.entry.ServerEntry entry, org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
          Makes sure a modify operation does not replace RDN attributes or their value.
static void preventStructuralClassRemovalOnModifyRemove(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager, org.apache.directory.shared.ldap.name.DN name, org.apache.directory.shared.ldap.entry.ModificationOperation mod, org.apache.directory.shared.ldap.entry.EntryAttribute attribute, org.apache.directory.shared.ldap.entry.EntryAttribute entryObjectClasses)
          Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass.
static void preventStructuralClassRemovalOnModifyReplace(org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry registry, org.apache.directory.shared.ldap.name.DN name, org.apache.directory.shared.ldap.entry.ModificationOperation mod, org.apache.directory.shared.ldap.entry.ServerEntry entry)
          Makes sure modify operations do not leave the entry without a STRUCTURAL objectClass.
static void preventStructuralClassRemovalOnModifyReplace(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager, org.apache.directory.shared.ldap.name.DN name, org.apache.directory.shared.ldap.entry.ModificationOperation mod, org.apache.directory.shared.ldap.entry.EntryAttribute attribute)
          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(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager,
                                                                org.apache.directory.shared.ldap.name.DN name,
                                                                org.apache.directory.shared.ldap.entry.ModificationOperation mod,
                                                                org.apache.directory.shared.ldap.entry.EntryAttribute attribute)
                                                         throws org.apache.directory.shared.ldap.exception.LdapException
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:
org.apache.directory.shared.ldap.exception.LdapException - if modify operations leave the entry inconsistent without a STRUCTURAL objectClass

preventStructuralClassRemovalOnModifyReplace

public static void preventStructuralClassRemovalOnModifyReplace(org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry registry,
                                                                org.apache.directory.shared.ldap.name.DN name,
                                                                org.apache.directory.shared.ldap.entry.ModificationOperation mod,
                                                                org.apache.directory.shared.ldap.entry.ServerEntry entry)
                                                         throws org.apache.directory.shared.ldap.exception.LdapException
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)
entry - the entry being modified
Throws:
org.apache.directory.shared.ldap.exception.LdapException - if modify operations leave the entry inconsistent without a STRUCTURAL objectClass

preventStructuralClassRemovalOnModifyRemove

public static void preventStructuralClassRemovalOnModifyRemove(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager,
                                                               org.apache.directory.shared.ldap.name.DN name,
                                                               org.apache.directory.shared.ldap.entry.ModificationOperation mod,
                                                               org.apache.directory.shared.ldap.entry.EntryAttribute attribute,
                                                               org.apache.directory.shared.ldap.entry.EntryAttribute entryObjectClasses)
                                                        throws org.apache.directory.shared.ldap.exception.LdapException
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:
org.apache.directory.shared.ldap.exception.LdapException - if modify operations leave the entry inconsistent without a STRUCTURAL objectClass

preventRdnChangeOnModifyReplace

public static void preventRdnChangeOnModifyReplace(org.apache.directory.shared.ldap.name.DN name,
                                                   org.apache.directory.shared.ldap.entry.ModificationOperation mod,
                                                   org.apache.directory.shared.ldap.entry.EntryAttribute attribute,
                                                   org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
                                            throws org.apache.directory.shared.ldap.exception.LdapException
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
oidRegistry -
Throws:
org.apache.directory.shared.ldap.exception.LdapException - if the modify operation is removing an Rdn attribute

preventRdnChangeOnModifyReplace

public static void preventRdnChangeOnModifyReplace(org.apache.directory.shared.ldap.name.DN name,
                                                   org.apache.directory.shared.ldap.entry.ModificationOperation mod,
                                                   org.apache.directory.shared.ldap.entry.ServerEntry entry,
                                                   org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
                                            throws org.apache.directory.shared.ldap.exception.LdapException
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 )
entry -
oidRegistry -
Throws:
org.apache.directory.shared.ldap.exception.LdapException - if the modify operation is removing an Rdn attribute

preventRdnChangeOnModifyRemove

public static void preventRdnChangeOnModifyRemove(org.apache.directory.shared.ldap.name.DN name,
                                                  org.apache.directory.shared.ldap.entry.ModificationOperation mod,
                                                  org.apache.directory.shared.ldap.entry.EntryAttribute attribute,
                                                  org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
                                           throws org.apache.directory.shared.ldap.exception.LdapException
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:
org.apache.directory.shared.ldap.exception.LdapException - if the modify operation is removing an Rdn attribute

preventRdnChangeOnModifyRemove

public static void preventRdnChangeOnModifyRemove(org.apache.directory.shared.ldap.name.DN name,
                                                  org.apache.directory.shared.ldap.entry.ModificationOperation mod,
                                                  org.apache.directory.shared.ldap.entry.ServerEntry entry,
                                                  org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
                                           throws org.apache.directory.shared.ldap.exception.LdapException
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 )
entry -
oidRegistry -
Throws:
org.apache.directory.shared.ldap.exception.LdapException - if the modify operation is removing an Rdn attribute


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