Package org.apache.directory.server.schema.bootstrap

Examples of org.apache.directory.server.schema.bootstrap.Schema


    protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade )
        throws Exception
    {
        String oid = getOid( entry );
        Schema schema = getSchema( name );
        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, schema.getSchemaName() );
       
        if ( ! schema.isDisabled() )
        {
            attributeTypeRegistry.unregister( oid );
            attributeTypeRegistry.register( at );
           
            return SCHEMA_MODIFIED;
View Full Code Here


    }
   
   
    public void add( AttributeType at ) throws Exception
    {
        Schema schema = dao.getSchema( at.getSchema() );
        if ( ! schema.isDisabled() )
        {
            attributeTypeRegistry.register( at );
        }
        else
        {
View Full Code Here

        LdapDN parentDn = ( LdapDN ) name.clone();
        parentDn.remove( parentDn.size() - 1 );
        checkNewParent( parentDn );
        checkOidIsUnique( entry );
       
        Schema schema = getSchema( name );
        AttributeType at = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName() );
        add( at );
    }
View Full Code Here

    }


    public void delete( AttributeType at, boolean cascade ) throws Exception
    {
        Schema schema = loader.getSchema( at.getSchema() );
        if ( ! schema.isDisabled() )
        {
            attributeTypeRegistry.unregister( at.getOid() );
        }
        unregisterOids( at.getOid() );
    }
View Full Code Here

    }


    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws Exception
    {
        Schema schema = getSchema( name );
        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName() );
        Set<ServerEntry> dependees = dao.listAttributeTypeDependents( oldAt );
       
        if ( dependees != null && dependees.size() > 0 )
        {
            throw new LdapOperationNotSupportedException( "The attributeType with OID " + oldAt.getOid()
                + " cannot be deleted until all entities"
                + " using this attributeType have also been deleted.  The following dependees exist: "
                + getOids( dependees ),
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
        String newOid = ( String ) newRdn.getValue();
        checkOidIsUnique( newOid );
        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, schema.getSchemaName() );

        if ( ! schema.isDisabled() )
        {
            attributeTypeRegistry.unregister( oldAt.getOid() );
            attributeTypeRegistry.register( at );
        }
        else
View Full Code Here

    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
        ServerEntry entry, boolean cascade ) throws Exception
    {
        checkNewParent( newParentName );
        Schema oldSchema = getSchema( oriChildName );
        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, oldSchema.getSchemaName() );
        Set<ServerEntry> dependees = dao.listAttributeTypeDependents( oldAt );
       
        if ( dependees != null && dependees.size() > 0 )
        {
            throw new LdapOperationNotSupportedException( "The attributeType with OID " + oldAt.getOid()
                + " cannot be deleted until all entities"
                + " using this attributeType have also been deleted.  The following dependees exist: "
                + getOids( dependees ),
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        Schema newSchema = getSchema( newParentName );
        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
        String newOid = ( String ) newRn.getValue();
        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        checkOidIsUnique( newOid );
        AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, newSchema.getSchemaName() );

        if ( ! oldSchema.isDisabled() )
        {
            attributeTypeRegistry.unregister( oldAt.getOid() );
        }
        unregisterOids( oldAt.getOid() );

        if ( ! newSchema.isDisabled() )
        {
            attributeTypeRegistry.register( at );
        }
        else
        {
View Full Code Here

    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade )
        throws Exception
    {
        checkNewParent( newParentName );
        Schema oldSchema = getSchema( oriChildName );
        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, oldSchema.getSchemaName() );
        Set<ServerEntry> dependees = dao.listAttributeTypeDependents( oldAt );
       
        if ( dependees != null && dependees.size() > 0 )
        {
            throw new LdapOperationNotSupportedException( "The attributeType with OID " + oldAt.getOid()
                + " cannot be deleted until all entities"
                + " using this attributeType have also been deleted.  The following dependees exist: "
                + getOids( dependees ),
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        Schema newSchema = getSchema( newParentName );
        AttributeType at = factory.getAttributeType( entry, targetRegistries, newSchema.getSchemaName() );
       
        if ( ! oldSchema.isDisabled() )
        {
            attributeTypeRegistry.unregister( oldAt.getOid() );
        }
       
        if ( ! newSchema.isDisabled() )
        {
            attributeTypeRegistry.register( at );
        }
    }
View Full Code Here

   
    protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade ) throws Exception
    {
        String oid = getOid( entry );
        Normalizer normalizer = factory.getNormalizer( targetEntry, targetRegistries );
        Schema schema = getSchema( name );
       
        if ( ! schema.isDisabled() )
        {
            normalizerRegistry.unregister( oid );
            NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(),
                targetEntry );
            normalizerRegistry.register( normalizerDescription, normalizer );
           
            return SCHEMA_MODIFIED;
        }
View Full Code Here

        parentDn.remove( parentDn.size() - 1 );
        checkNewParent( parentDn );
        checkOidIsUniqueForNormalizer( entry );
       
        Normalizer normalizer = factory.getNormalizer( entry, targetRegistries );
        Schema schema = getSchema( name );
       
        if ( ! schema.isDisabled() )
        {
            NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(), entry );
            normalizerRegistry.register( normalizerDescription, normalizer );
        }
    }
View Full Code Here

        if ( normalizerDescription.getExtensions().get( MetaSchemaConstants.X_SCHEMA ) != null )
        {
            schemaName = normalizerDescription.getExtensions().get( MetaSchemaConstants.X_SCHEMA ).get( 0 );
        }
       
        Schema schema = loader.getSchema( schemaName );
       
        if ( ! schema.isDisabled() )
        {
            normalizerRegistry.register( normalizerDescription, normalizer );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.schema.bootstrap.Schema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.