org.apache.directory.server.core.schema.registries.synchronizers
Class SchemaSynchronizer

java.lang.Object
  extended by org.apache.directory.server.core.schema.registries.synchronizers.SchemaSynchronizer
All Implemented Interfaces:
RegistrySynchronizer

public class SchemaSynchronizer
extends java.lang.Object
implements RegistrySynchronizer

This class handle modifications made on a global schema. Modifications made on SchemaObjects are handled by the specific shcemaObject synchronizers.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.directory.server.core.schema.registries.synchronizers.RegistrySynchronizer
SCHEMA_MODIFIED, SCHEMA_UNCHANGED
 
Constructor Summary
SchemaSynchronizer(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
          Creates and initializes a new instance of Schema synchronizer
 
Method Summary
 void add(org.apache.directory.shared.ldap.entry.ServerEntry entry)
          Handles the addition of a metaSchema object to the schema partition.
 void delete(org.apache.directory.shared.ldap.entry.ServerEntry entry, boolean cascade)
          Called to react to the deletion of a metaSchema object.
 boolean modify(ModifyOperationContext opContext, org.apache.directory.shared.ldap.entry.ServerEntry targetEntry, boolean cascade)
          The only modification done on a schema element is on the m-disabled attributeType Depending in the existence of this attribute in the previous entry, we will have to update the entry or not.
 void move(org.apache.directory.shared.ldap.name.DN oriChildName, org.apache.directory.shared.ldap.name.DN newParentName, org.apache.directory.shared.ldap.entry.ServerEntry entry, boolean cascade)
          Moves are not allowed for metaSchema objects so this always throws an UNWILLING_TO_PERFORM LdapException.
 void moveAndRename(org.apache.directory.shared.ldap.name.DN oriChildName, org.apache.directory.shared.ldap.name.DN newParentName, org.apache.directory.shared.ldap.name.RDN newRn, boolean deleteOldRn, org.apache.directory.shared.ldap.entry.ServerEntry entry, boolean cascaded)
           
 void moveAndRename(org.apache.directory.shared.ldap.name.DN oriChildName, org.apache.directory.shared.ldap.name.DN newParentName, java.lang.String newRn, boolean deleteOldRn, org.apache.directory.shared.ldap.entry.ServerEntry entry, boolean cascade)
          Moves are not allowed for metaSchema objects so this always throws an UNWILLING_TO_PERFORM LdapException.
 void rename(org.apache.directory.shared.ldap.entry.ServerEntry entry, org.apache.directory.shared.ldap.name.RDN newRdn, boolean cascade)
          Responds to the rdn (commonName) of the metaSchema object being changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaSynchronizer

public SchemaSynchronizer(org.apache.directory.shared.ldap.schema.SchemaManager schemaManager)
                   throws java.lang.Exception
Creates and initializes a new instance of Schema synchronizer

Parameters:
registries - The Registries
loader - The schema loader
Throws:
java.lang.Exception - If something went wrong
Method Detail

modify

public boolean modify(ModifyOperationContext opContext,
                      org.apache.directory.shared.ldap.entry.ServerEntry targetEntry,
                      boolean cascade)
               throws java.lang.Exception
The only modification done on a schema element is on the m-disabled attributeType Depending in the existence of this attribute in the previous entry, we will have to update the entry or not.

Specified by:
modify in interface RegistrySynchronizer
Parameters:
opContext - The OperationContext, which contains the entry and the modifications to apply
targetEntry - The modified entry
cascade - Unused
Returns:
True if the modification has been done
Throws:
java.lang.Exception - If the modification failed

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.name.DN oriChildName,
                          org.apache.directory.shared.ldap.name.DN newParentName,
                          org.apache.directory.shared.ldap.name.RDN newRn,
                          boolean deleteOldRn,
                          org.apache.directory.shared.ldap.entry.ServerEntry entry,
                          boolean cascaded)
                   throws org.apache.directory.shared.ldap.exception.LdapException
Specified by:
moveAndRename in interface RegistrySynchronizer
Throws:
org.apache.directory.shared.ldap.exception.LdapException

add

public void add(org.apache.directory.shared.ldap.entry.ServerEntry entry)
         throws java.lang.Exception
Handles the addition of a metaSchema object to the schema partition.

Specified by:
add in interface RegistrySynchronizer
Parameters:
name - the dn of the new metaSchema object
entry - the attributes of the new metaSchema object
Throws:
java.lang.Exception - If the addition failed

delete

public void delete(org.apache.directory.shared.ldap.entry.ServerEntry entry,
                   boolean cascade)
            throws java.lang.Exception
Called to react to the deletion of a metaSchema object. This method simply removes the schema from the loaded schema map of the global registries.

Specified by:
delete in interface RegistrySynchronizer
Parameters:
name - the dn of the metaSchema object being deleted
entry - the attributes of the metaSchema object
Throws:
java.lang.Exception - If the deletion failed

rename

public void rename(org.apache.directory.shared.ldap.entry.ServerEntry entry,
                   org.apache.directory.shared.ldap.name.RDN newRdn,
                   boolean cascade)
            throws java.lang.Exception
Responds to the rdn (commonName) of the metaSchema object being changed. Changes all the schema entities associated with the renamed schema so they now map to a new schema name.

Specified by:
rename in interface RegistrySynchronizer
Parameters:
name - the dn of the metaSchema object renamed
entry - the entry of the metaSchema object before the rename
newRdn - the new commonName of the metaSchema object
Throws:
java.lang.Exception - If the rename failed

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.name.DN oriChildName,
                          org.apache.directory.shared.ldap.name.DN newParentName,
                          java.lang.String newRn,
                          boolean deleteOldRn,
                          org.apache.directory.shared.ldap.entry.ServerEntry entry,
                          boolean cascade)
                   throws org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException
Moves are not allowed for metaSchema objects so this always throws an UNWILLING_TO_PERFORM LdapException.

Throws:
org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException

move

public void move(org.apache.directory.shared.ldap.name.DN oriChildName,
                 org.apache.directory.shared.ldap.name.DN newParentName,
                 org.apache.directory.shared.ldap.entry.ServerEntry entry,
                 boolean cascade)
          throws org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException
Moves are not allowed for metaSchema objects so this always throws an UNWILLING_TO_PERFORM LdapException.

Specified by:
move in interface RegistrySynchronizer
Throws:
org.apache.directory.shared.ldap.exception.LdapUnwillingToPerformException


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