directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny" <>
Subject SyntaxCheckers implementation
Date Thu, 12 Apr 2007 16:30:16 GMT

Alex, I have implemented the piece of code supposed to check the attribute's
values syntax in SchemaService. This was really a piece of cake, up to the
point I realized that the SC weren't available in the registries. Here is a
fragment of the code :

     * Check the entry attributes syntax, using the syntaxCheckers
    private void assertSyntaxes( Attributes entry ) throws NamingException
        NamingEnumeration attributes = entry.getAll();

        // First, loop on all attributes
        while ( attributes.hasMoreElements() )
            Attribute attribute = ( Attribute ) attributes.nextElement();

            AttributeType attributeType =
registries.getAttributeTypeRegistry().lookup( attribute.getID() );
            SyntaxChecker syntaxChecker =  attributeType.getSyntax

            if ( syntaxChecker instanceof AcceptAllSyntaxChecker )
                // This is a speedup : no need to check the syntax of any
                // if all the sytanxes are accepted...

Here, all the SC are instances of AcceptAllSyntaxChecker. I guess that there
is something missing during the schema initialization, but I will need your
help, because you know this piece of code, and I don't (diving into it may
cost me hours ...)

I have committed the code as is, so you can perfectly try it and set a BP on
this method to see if I did something wrong. I may have missed something,
too (is the way I get the SC correct ???). The server is still running oc,
as all the SC are accepting every value.

Thanks !

Emmanuel L├ęcharny

View raw message