Package org.apache.directory.shared.ldap.schema.parsers

Examples of org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription


    }


    private NormalizerDescription getNormalizerDescription( String schemaName, ServerEntry entry ) throws Exception
    {
        NormalizerDescription description = new NormalizerDescription( getOid( entry ) );
        List<String> values = new ArrayList<String>();
        values.add( schemaName );
        description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
        description.setFqcn( entry.get( fqcnAT ).getString() );

        EntryAttribute desc = entry.get( descAT );
        if ( desc != null && desc.size() > 0 )
        {
            description.setDescription( desc.getString() );
        }

        EntryAttribute bytecode = entry.get( byteCodeAT );

        if ( bytecode != null && bytecode.size() > 0 )
        {
            byte[] bytes = bytecode.getBytes();
            description.setBytecode( new String( Base64.encode( bytes ) ) );
        }

        return description;
    }
View Full Code Here


        // check first to see if it is present in the subschemaSubentry
        // -------------------------------------------------------------------
       
        Attributes attrs = getSubschemaSubentryAttributes();
        Attribute attrTypes = attrs.get( "normalizers" );
        NormalizerDescription normalizerDescription = null;
       
        for ( int i = 0; i < attrTypes.size(); i++ )
        {
            String desc = ( String ) attrTypes.get( i );
           
            if ( desc.indexOf( oid ) != -1 )
            {
                normalizerDescription = normalizerDescriptionSchemaParser.parseNormalizerDescription( desc );
                break;
            }
        }
    
        if ( isPresent )
        {
            assertNotNull( normalizerDescription );
            assertEquals( oid, normalizerDescription.getOid() );
        }
        else
        {
            assertNull( normalizerDescription );
        }
View Full Code Here

            ClonedServerEntry result = list.get();
            LdapDN resultDN = result.getDn();
            resultDN.normalize( atRegistry.getNormalizerMapping() );
            ServerEntry attrs = lookupPartition( resultDN );
            Normalizer normalizer = factory.getNormalizer( attrs, targetRegistries );
            NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(), attrs );
            targetRegistries.getNormalizerRegistry().register( normalizerDescription, normalizer );
        }
    }
View Full Code Here

    }

   
    private NormalizerDescription getNormalizerDescription( String schemaName, ServerEntry entry ) throws Exception
    {
        NormalizerDescription description = new NormalizerDescription();
        description.setNumericOid( getOid( entry ) );
        List<String> values = new ArrayList<String>();
        values.add( schemaName );
        description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
        description.setFqcn( entry.get( fqcnAT ).getString() );
       
        EntryAttribute desc = entry.get( descAT );
        if ( desc != null && desc.size() > 0 )
        {
            description.setDescription( desc.getString() );
        }
       
        EntryAttribute bytecode = entry.get( byteCodeAT );
       
        if ( bytecode != null && bytecode.size() > 0 )
        {
            byte[] bytes = bytecode.getBytes();
            description.setBytecode( new String( Base64.encode( bytes ) ) );
        }

        return description;
    }
View Full Code Here

   
   
    private NormalizerDescription getNormalizerDescription( String schemaName, ServerEntry entry ) throws Exception
    {
        NormalizerDescription description = new NormalizerDescription();
        description.setNumericOid( getOid( entry ) );
        List<String> values = new ArrayList<String>();
        values.add( schemaName );
        description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
        description.setFqcn( entry.get( fqcnAT ).getString() );
       
        EntryAttribute desc = entry.get( descAT );
       
        if ( ( desc != null ) && ( desc.size() > 0 ) )
        {
            description.setDescription( desc.getString() );
        }
       
        EntryAttribute bytecode =  entry.get( byteCodeAT );
       
        if ( ( bytecode != null ) && ( bytecode.size() > 0 ) )
        {
            byte[] bytes = bytecode.getBytes();
            description.setBytecode( new String( Base64.encode( bytes ) ) );
        }

        return description;
    }
View Full Code Here

        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

        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 ( ! schema.isDisabled() )
        {
            Normalizer normalizer = factory.getNormalizer( entry, targetRegistries );
            normalizerRegistry.unregister( oldOid );
           
            NormalizerDescription normalizerDescription = getNormalizerDescription( schema.getSchemaName(), entry );
            normalizerDescription.setNumericOid( oid );
            normalizerRegistry.register( normalizerDescription, normalizer );
        }
    }
View Full Code Here

            normalizerRegistry.unregister( oldOid );
        }

        if ( ! newSchema.isDisabled() )
        {
            NormalizerDescription normalizerDescription = getNormalizerDescription( newSchema.getSchemaName(), entry );
            normalizerDescription.setNumericOid( oid );
            normalizerRegistry.register( normalizerDescription, normalizer );
        }
    }
View Full Code Here

            normalizerRegistry.unregister( oid );
        }
       
        if ( ! newSchema.isDisabled() )
        {
            NormalizerDescription normalizerDescription = getNormalizerDescription( newSchema.getSchemaName(), entry );
            normalizerRegistry.register( normalizerDescription, normalizer );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription

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.