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

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


    }


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


    }


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

        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
        String newOid = ( String ) newRdn.getValue();
        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        checkOidIsUnique( newOid );
        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries, schema.getSchemaName() );

        if ( ! schema.isDisabled() )
        {
            objectClassRegistry.unregister( oldOc.getOid() );
            objectClassRegistry.register( oc );
        }
        else
View Full Code Here

    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
        ServerEntry entry, boolean cascade ) throws Exception
    {
        checkNewParent( newParentName );
        Schema oldSchema = getSchema( oriChildName );
        ObjectClass oldOc = factory.getObjectClass( entry, targetRegistries, oldSchema.getSchemaName() );
        Set<ServerEntry> dependees = dao.listObjectClassDependents( oldOc );
       
        if ( dependees != null && dependees.size() > 0 )
        {
            throw new LdapOperationNotSupportedException( "The objectClass with OID " + oldOc.getOid()
                + " cannot be deleted until all entities"
                + " using this objectClass 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 ) newRdn.getValue();
        checkOidIsUnique( newOid );
        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries, newSchema.getSchemaName() );

        if ( ! oldSchema.isDisabled() )
        {
            objectClassRegistry.unregister( oldOc.getOid() );
        }
        unregisterOids( oldOc.getOid() );
       
        if ( ! newSchema.isDisabled() )
        {
            objectClassRegistry.register( oc );
        }
        else
        {
View Full Code Here

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

        Schema newSchema = getSchema( newParentName );
        ObjectClass oc = factory.getObjectClass( entry, targetRegistries, newSchema.getSchemaName() );
       
        if ( ! oldSchema.isDisabled() )
        {
            objectClassRegistry.unregister( oldAt.getOid() );
        }
       
        if ( ! newSchema.isDisabled() )
        {
            objectClassRegistry.register( oc );
        }
    }
View Full Code Here

    }


    public void add( ObjectClass oc ) throws Exception
    {
        Schema schema = loader.getSchema( oc.getSchema() );
        if ( ! schema.isDisabled() )
        {
            objectClassRegistry.register( oc );
        }
        else
        {
View Full Code Here

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

    }


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

    }

   
    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws Exception
    {
        Schema schema = getSchema( name );
        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, schema.getSchemaName() );
        Set<ServerEntry> dependees = dao.listMatchingRuleDependents( oldMr );
       
        if ( dependees != null && dependees.size() > 0 )
        {
            throw new LdapOperationNotSupportedException( "The matchingRule with OID " + oldMr.getOid()
                + " cannot be deleted until all entities"
                + " using this matchingRule 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 );
        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, schema.getSchemaName() );

        if ( ! schema.isDisabled() )
        {
            matchingRuleRegistry.unregister( oldMr.getOid() );
            matchingRuleRegistry.register( mr );
        }
        else
View Full Code Here

    public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
        ServerEntry entry, boolean cascade ) throws Exception
    {
        checkNewParent( newParentName );
        Schema oldSchema = getSchema( oriChildName );
        MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, oldSchema.getSchemaName() );
        Set<ServerEntry> dependees = dao.listMatchingRuleDependents( oldMr );
       
        if ( dependees != null && dependees.size() > 0 )
        {
            throw new LdapOperationNotSupportedException( "The matchingRule with OID " + oldMr.getOid()
                + " cannot be deleted until all entities"
                + " using this matchingRule 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 ) newRdn.getValue();
        checkOidIsUnique( newOid );
       
        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, newSchema.getSchemaName() );

        if ( ! oldSchema.isDisabled() )
        {
            matchingRuleRegistry.unregister( oldMr.getOid() );
        }
        unregisterOids( oldMr.getOid() );

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

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

        Schema newSchema = getSchema( newParentName );
        MatchingRule mr = factory.getMatchingRule( entry, targetRegistries, newSchema.getSchemaName() );
       
        if ( ! oldSchema.isDisabled() )
        {
            matchingRuleRegistry.unregister( oldMr.getOid() );
        }
       
        if ( ! newSchema.isDisabled() )
        {
            matchingRuleRegistry.register( mr );
        }
    }
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.