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

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


            ClonedServerEntry result = list.get();
            LdapDN resultDN = result.getDn();
            resultDN.normalize( atRegistry.getNormalizerMapping() );
            ClonedServerEntry attrs = lookupPartition( resultDN );
            Comparator comparator = factory.getComparator( attrs, targetRegistries );
            ComparatorDescription comparatorDescription = getComparatorDescription( schema.getSchemaName(), attrs );
            targetRegistries.getComparatorRegistry().register( comparatorDescription, comparator );
        }
    }
View Full Code Here


    }


    private ComparatorDescription getComparatorDescription( String schemaName, ServerEntry entry ) throws Exception
    {
        ComparatorDescription description = new ComparatorDescription();
        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() )
        {
            comparatorRegistry.unregister( oid );
            ComparatorDescription description = getComparatorDescription( schema.getSchemaName(), targetEntry );
            comparatorRegistry.register( description, comparator );
           
            return SCHEMA_MODIFIED;
        }
       
View Full Code Here

    }

   
    private ComparatorDescription getComparatorDescription( String schemaName, ServerEntry entry ) throws Exception
    {
        ComparatorDescription description = new ComparatorDescription();
        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

        Comparator comparator = factory.getComparator( entry, targetRegistries );
        Schema schema = getSchema( name );
       
        if ( ! schema.isDisabled() )
        {
            ComparatorDescription comparatorDescription = getComparatorDescription( schema.getSchemaName(), entry );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

       
        if ( ! schema.isDisabled() )
        {
            Comparator comparator = factory.getComparator( entry, targetRegistries );
            comparatorRegistry.unregister( oldOid );
            ComparatorDescription comparatorDescription = getComparatorDescription( schema.getSchemaName(), entry );
            comparatorDescription.setNumericOid( oid );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

            comparatorRegistry.unregister( oldOid );
        }

        if ( ! newSchema.isDisabled() )
        {
            ComparatorDescription comparatorDescription = getComparatorDescription( newSchema.getSchemaName(), entry );
            comparatorDescription.setNumericOid( oid );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

            comparatorRegistry.unregister( oid );
        }
       
        if ( ! newSchema.isDisabled() )
        {
            ComparatorDescription comparatorDescription = getComparatorDescription( newSchema.getSchemaName(), entry );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

        Iterator<ComparatorDescription> list =
            registries.getComparatorRegistry().comparatorDescriptionIterator();
       
        while ( list.hasNext() )
        {
            ComparatorDescription description = list.next();
            attr.add( SchemaUtils.render( description ) );
        }

        return attr;
    }
View Full Code Here

        // check first to see if it is present in the subschemaSubentry
        // -------------------------------------------------------------------
       
        Attributes attrs = getSubschemaSubentryAttributes();
        Attribute attrTypes = attrs.get( "comparators" );
        ComparatorDescription comparatorDescription = null;
        for ( int ii = 0; ii < attrTypes.size(); ii++ )
        {
            String desc = ( String ) attrTypes.get( ii );
            if ( desc.indexOf( oid ) != -1 )
            {
                comparatorDescription = comparatorDescriptionSchemaParser.parseComparatorDescription( desc );
                break;
            }
        }
    
        if ( isPresent )
        {
            assertNotNull( comparatorDescription );
            assertEquals( oid, comparatorDescription.getNumericOid() );
        }
        else
        {
            assertNull( comparatorDescription );
        }
View Full Code Here

TOP

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

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.