Package org.apache.directory.api.ldap.model.schema.syntaxCheckers

Examples of org.apache.directory.api.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker


                        syntaxChecker = registries.getSyntaxCheckerRegistry().lookup( ldapSyntax.getOid() );
                    }
                    catch ( LdapException ne )
                    {
                        // No SyntaxChecker ? Associate the Syntax to a catch all SyntaxChecker
                        syntaxChecker = new OctetStringSyntaxChecker( ldapSyntax.getOid() );
                    }

                    // Add the references for S :
                    // S -> SC
                    if ( syntaxChecker != null )
View Full Code Here


     */
    @Before
    public void initAT()
    {
        s = new EntryUtils.S( "1.1.1.1", true );
        s.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mr = new EntryUtils.MR( "1.1.2.1" );
        mr.setSyntax( s );
        mr.setLdapComparator( new StringComparator( "1.1.2.1" ) );
        mr.setNormalizer( new DeepTrimToLowerNormalizer( "1.1.2.1" ) );
        at = new EntryUtils.AT( "1.1.3.1" );
View Full Code Here

     */
    @Before
    public void initAT()
    {
        s = EntryUtils.syntaxFactory( "1.1.1.1", false );
        s.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mr = EntryUtils.matchingRuleFactory( "1.1.2.1" );
        mr.setSyntax( s );

        mr.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mr.setNormalizer( new Normalizer( "1.1.1" )
View Full Code Here

     */
    @Before
    public void initAT()
    {
        s = EntryUtils.syntaxFactory( "1.1.1.1", false );
        s.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mr = EntryUtils.matchingRuleFactory( "1.1.2.1" );
        mr.setSyntax( s );

        mr.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mr.setNormalizer( new Normalizer( "1.1.1" )
View Full Code Here

     */
    @Before
    public void initAT()
    {
        sb = new EntryUtils.S( "1.1.1.1", false );
        sb.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mrb = new EntryUtils.MR( "1.1.2.1" );
        mrb.setSyntax( sb );

        mrb.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mrb.setNormalizer( new Normalizer( "1.1.1" )
        {
            public Value<?> normalize( Value<?> value ) throws LdapException
            {
                if ( !value.isHumanReadable() )
                {
                    byte[] val = value.getBytes();
                    // each byte will be changed to be > 0, and spaces will be trimmed
                    byte[] newVal = new byte[val.length];
                    int i = 0;

                    for ( byte b : val )
                    {
                        newVal[i++] = ( byte ) ( b & 0x007F );
                    }

                    return new BinaryValue( Strings.trim( newVal ) );
                }

                throw new IllegalStateException( "expected byte[] to normalize" );
            }


            public String normalize( String value ) throws LdapException
            {
                throw new IllegalStateException( "expected byte[] to normalize" );
            }
        } );

        atb = new EntryUtils.AT( "1.1.3.1" );
        atb.setEquality( mrb );
        atb.setOrdering( mrb );
        atb.setSubstring( mrb );
        atb.setSyntax( sb );

        ss = new EntryUtils.S( "1.1.1.1", true );
        ss.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mrs = new EntryUtils.MR( "1.1.2.1" );
        mrs.setSyntax( ss );
        mrs.setLdapComparator( new StringComparator( "1.1.2.1" ) );
        mrs.setNormalizer( new DeepTrimToLowerNormalizer( "1.1.2.1" ) );
        ats = new EntryUtils.AT( "1.1.3.1" );
View Full Code Here

    }


    public SyntaxChecker getSyntaxChecker()
    {
        return new OctetStringSyntaxChecker();
    }
View Full Code Here

     */
    @Before
    public void initAT()
    {
        sb = new EntryUtils.S( "1.1.1.1", false );
        sb.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mrb = new EntryUtils.MR( "1.1.2.1" );
        mrb.setSyntax( sb );

        mrb.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mrb.setNormalizer( new Normalizer( "1.1.1" )
        {
            public static final long serialVersionUID = 1L;


            public Value<?> normalize( Value<?> value ) throws LdapException
            {
                if ( !value.isHumanReadable() )
                {
                    byte[] val = value.getBytes();
                    // each byte will be changed to be > 0, and spaces will be trimmed
                    byte[] newVal = new byte[val.length];
                    int i = 0;

                    for ( byte b : val )
                    {
                        newVal[i++] = ( byte ) ( b & 0x007F );
                    }

                    return new BinaryValue( Strings.trim( newVal ) );
                }

                throw new IllegalStateException( "expected byte[] to normalize" );
            }


            public String normalize( String value ) throws LdapException
            {
                throw new IllegalStateException( "expected byte[] to normalize" );
            }
        } );

        atb = new EntryUtils.AT( "1.1.3.1" );
        atb.setEquality( mrb );
        atb.setOrdering( mrb );
        atb.setSubstring( mrb );
        atb.setSyntax( sb );

        ss = new EntryUtils.S( "1.1.1.1", true );
        ss.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mrs = new EntryUtils.MR( "1.1.2.1" );
        mrs.setSyntax( ss );
        mrs.setLdapComparator( new StringComparator( "1.1.2.1" ) );
        mrs.setNormalizer( new DeepTrimToLowerNormalizer( "1.1.2.1" ) );
        ats = new EntryUtils.AT( "1.1.3.1" );
View Full Code Here

     */
    @Before
    public void initAT()
    {
        s = EntryUtils.syntaxFactory( "1.1.1.1", false );
        s.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mr = EntryUtils.matchingRuleFactory( "1.1.2.1" );
        mr.setSyntax( s );

        mr.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mr.setNormalizer( new Normalizer( "1.1.1" )
View Full Code Here

     */
    @Before
    public void initAT()
    {
        s = new EntryUtils.S( "1.1.1.1", true );
        s.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mr = new EntryUtils.MR( "1.1.2.1" );
        mr.setSyntax( s );
        mr.setLdapComparator( new StringComparator( "1.1.2.1" ) );
        mr.setNormalizer( new DeepTrimToLowerNormalizer( "1.1.2.1" ) );
        at = new EntryUtils.AT( "1.1.3.1" );
View Full Code Here

     */
    @Before
    public void initAT()
    {
        s = EntryUtils.syntaxFactory( "1.1.1.1", false );
        s.setSyntaxChecker( new OctetStringSyntaxChecker() );
        mr = EntryUtils.matchingRuleFactory( "1.1.2.1" );
        mr.setSyntax( s );

        mr.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
        mr.setNormalizer( new Normalizer( "1.1.1" )
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker

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.