Examples of LdapComparatorDescription


Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

    @Test
    public void testFqcn() throws ParseException
    {
        String value = null;
        LdapComparatorDescription ldapComparatorDescription = null;

        // FQCN simple
        value = "( 1.1 FQCN org.apache.directory.SimpleComparator )";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getFqcn() );
        assertEquals( "org.apache.directory.SimpleComparator", ldapComparatorDescription.getFqcn() );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

    @Test
    public void testBytecode() throws ParseException
    {
        String value = null;
        LdapComparatorDescription ldapComparatorDescription = null;

        // FQCN simple p
        value = "( 1.1 FQCN org.apache.directory.SimpleComparator BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getBytecode() );
        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
            .getBytecode() );

        // FQCN simple, no spaces
        value = "(1.1 FQCNorg.apache.directory.SimpleComparator BYTECODEABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====)";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getBytecode() );
        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
            .getBytecode() );

        // FQCN simple, tabs
        value = "\t(\t1.1\tFQCN\torg.apache.directory.SimpleComparator\tBYTECODE\tABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====\t)\t";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getBytecode() );
        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
            .getBytecode() );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

        // -------------------------------------------------------------------
        // get the subschemaSubentry again
        updateSSSE();

        Attribute attrTypes = subschemaSubentry.get( "comparators" );
        LdapComparatorDescription comparatorDescription = null;

        for ( Value<?> value : attrTypes )
        {
            String desc = value.getString();

            if ( desc.indexOf( oid ) != -1 )
            {
                comparatorDescription = comparatorDescriptionSchemaParser.parseComparatorDescription( desc );
                break;
            }
        }

        if ( isPresent )
        {
            assertNotNull( comparatorDescription );
            assertEquals( oid, comparatorDescription.getOid() );
        }
        else
        {
            assertNull( comparatorDescription );
        }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

        // check first to see if it is present in the subschemaSubentry
        // -------------------------------------------------------------------

        Attributes attrs = getSubschemaSubentryAttributes();
        Attribute attrTypes = attrs.get( "comparators" );
        LdapComparatorDescription 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.getOid() );
        }
        else
        {
            assertNull( comparatorDescription );
        }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

        {
            String desc = value.getString();

            try
            {
                LdapComparatorDescription comparator = C_DESCR_SCHEMA_PARSER.parseComparatorDescription( desc );

                updateSchemas( comparator );
            }
            catch ( ParseException pe )
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

            {
                SchemaObject schemaObject = schemaObjectWrapper.get();

                if ( schemaObject instanceof LdapComparatorDescription )
                {
                    LdapComparatorDescription ldapComparatorDescription = ( LdapComparatorDescription ) schemaObject;
                    Entry lcEntry = getEntry( ldapComparatorDescription );

                    comparatorEntries.add( lcEntry );
                }
            }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

    @Test
    public void testFqcn() throws ParseException
    {
        String value = null;
        LdapComparatorDescription ldapComparatorDescription = null;

        // FQCN simple
        value = "( 1.1 FQCN org.apache.directory.SimpleComparator )";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getFqcn() );
        assertEquals( "org.apache.directory.SimpleComparator", ldapComparatorDescription.getFqcn() );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription

    @Test
    public void testBytecode() throws ParseException
    {
        String value = null;
        LdapComparatorDescription ldapComparatorDescription = null;

        // FQCN simple p
        value = "( 1.1 FQCN org.apache.directory.SimpleComparator BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getBytecode() );
        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
            .getBytecode() );

        // FQCN simple, no spaces
        value = "(1.1 FQCNorg.apache.directory.SimpleComparator BYTECODEABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====)";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getBytecode() );
        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
            .getBytecode() );

        // FQCN simple, tabs
        value = "\t(\t1.1\tFQCN\torg.apache.directory.SimpleComparator\tBYTECODE\tABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====\t)\t";
        ldapComparatorDescription = parser.parseComparatorDescription( value );
        assertNotNull( ldapComparatorDescription.getBytecode() );
        assertEquals( "ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789====", ldapComparatorDescription
            .getBytecode() );
    }
View Full Code Here

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


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

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

        // check first to see if it is present in the subschemaSubentry
        // -------------------------------------------------------------------
       
        Attributes attrs = getSubschemaSubentryAttributes();
        Attribute attrTypes = attrs.get( "comparators" );
        LdapComparatorDescription 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.getOid() );
        }
        else
        {
            assertNull( comparatorDescription );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.