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

Examples of org.apache.directory.api.ldap.model.schema.LdapSyntax


        // Check that the AT and S are present
        assertTrue( isAttributeTypePresent( schemaManager, AT_OID ) );
        assertTrue( isSyntaxPresent( schemaManager, S_OID ) );

        // Now try to remove the S
        LdapSyntax syntax = schemaManager.lookupLdapSyntaxRegistry( S_OID );

        // shouldn't be deleted cause there is a AT associated with it
        assertFalse( schemaManager.delete( syntax ) );

        List<Throwable> errors = schemaManager.getErrors();
View Full Code Here


        List<Throwable> errors = schemaManager.getErrors();
        assertFalse( errors.isEmpty() );
        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );

        // Now delete the using S : it should be OK
        LdapSyntax syntax = new LdapSyntax( OID );
        assertTrue( schemaManager.delete( syntax ) );

        assertEquals( srSize - 1, schemaManager.getLdapSyntaxRegistry().size() );
        assertEquals( goidSize - 1, schemaManager.getGlobalOidRegistry().size() );
View Full Code Here

    /**
     * A local Syntax class used for the tests
     */
    public static LdapSyntax syntaxFactory( String oid, boolean humanReadable )
    {
        LdapSyntax ldapSyntax = new LdapSyntax( oid );

        ldapSyntax.setHumanReadable( humanReadable );

        return ldapSyntax;
    }
View Full Code Here

    /* no protection*/
    static AttributeType getCaseIgnoringAttributeNoNumbersType()
    {
        MutableAttributeType attributeType = new MutableAttributeType( "1.1.3.1" );
        LdapSyntax syntax = new LdapSyntax( "1.1.1.1", "", true );

        syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" )
        {
            /** The mandatory serialVersionUID field */
            public static final long serialVersionUID = 1L;


View Full Code Here

    /* no protection*/static AttributeType getIA5StringAttributeType()
    {
        MutableAttributeType attributeType = new MutableAttributeType( "1.1" );
        attributeType.addName( "1.1" );
        LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );

        syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2" )
        {
            /** The mandatory serialVersionUID field */
            public static final long serialVersionUID = 1L;


View Full Code Here


    /* No protection */static AttributeType getBytesAttributeType()
    {
        MutableAttributeType attributeType = new MutableAttributeType( "1.2" );
        LdapSyntax syntax = new LdapSyntax( "1.2.1", "", true );

        syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" )
        {
            /** The mandatory serialVersionUID field */
            public static final long serialVersionUID = 1L;


View Full Code Here

     */
    private void addSyntaxes( Schema schema, Registries registries ) throws LdapException, IOException
    {
        for ( Entry entry : schemaLoader.loadSyntaxes( schema ) )
        {
            LdapSyntax syntax = factory.getSyntax( this, entry, registries, schema.getSchemaName() );

            addSchemaObject( registries, syntax, schema );
        }
    }
View Full Code Here

        {
            String desc = value.getString();

            try
            {
                LdapSyntax ldapSyntax = LS_DESCR_SCHEMA_PARSER.parseLdapSyntaxDescription( desc );

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

            {
                SchemaObject schemaObject = schemaObjectWrapper.get();

                if ( schemaObject instanceof LdapSyntax )
                {
                    LdapSyntax ldapSyntax = ( LdapSyntax ) schemaObject;

                    Entry ldapSyntaxEntry = factory.convert( ldapSyntax, schema, null );

                    syntaxEntries.add( ldapSyntaxEntry );
                }
View Full Code Here

     */
    private boolean isSyntaxPresent( SchemaManager schemaManager, String oid )
    {
        try
        {
            LdapSyntax syntax = schemaManager.lookupLdapSyntaxRegistry( oid );

            return syntax != null;
        }
        catch ( LdapException ne )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.schema.LdapSyntax

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.