Examples of SyntaxChecker


Examples of org.apache.directory.shared.ldap.model.schema.SyntaxChecker

     */
    private void addSyntaxCheckers( Schema schema, Registries registries ) throws LdapException, IOException
    {
        for ( Entry entry : schemaLoader.loadSyntaxCheckers( schema ) )
        {
            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( this, entry, registries, schema.getSchemaName() );

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

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

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

        syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2.1" )
        {
            private static final long serialVersionUID = 0L;

            public boolean isValidSyntax( Object value )
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

    {
        AttributeType attributeType = new AttributeType( "1.1" );
        attributeType.addName( "1.1" );
        LdapSyntax syntax = new LdapSyntax( "1.1.1", "", true );

        syntax.setSyntaxChecker( new SyntaxChecker( "1.1.2" )
        {
            private static final long serialVersionUID = 0L;

            public boolean isValidSyntax( Object value )
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

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

        syntax.setSyntaxChecker( new SyntaxChecker( "1.2.1" )
        {
            private static final long serialVersionUID = 0L;

            public boolean isValidSyntax( Object value )
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

    {
        DN name = opContext.getDn();
        ServerEntry entry = opContext.getEntry();
        String schemaName = getSchemaName( name );
        String oid = getOid( entry );
        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager
            .getRegistries(), schemaName );

        if ( isSchemaEnabled( schemaName ) )
        {
            syntaxChecker.setSchemaName( schemaName );

            schemaManager.unregisterSyntaxChecker( oid );
            schemaManager.add( syntaxChecker );

            return SCHEMA_MODIFIED;
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

        checkOidIsUniqueForSyntaxChecker( entry );

        // Build the new SyntaxChecker from the given entry
        String schemaName = getSchemaName( dn );

        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
            schemaName );

        // At this point, the constructed SyntaxChecker has not been checked against the
        // existing Registries. It will be checked there, if the schema and the
        // SyntaxChecker are both enabled.
        Schema schema = schemaManager.getLoadedSchema( schemaName );

        if ( schema.isEnabled() && syntaxChecker.isEnabled() )
        {
            if ( schemaManager.add( syntaxChecker ) )
            {
                LOG.debug( "Added {} into the enabled schema {}", dn.getName(), schemaName );
            }
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

           
            return;
        }

        // Test that the Oid exists
        SyntaxChecker syntaxChecker = null;

        try
        {
            syntaxChecker = ( SyntaxChecker ) checkSyntaxCheckerOidExists( entry );
        }
        catch ( LdapSchemaViolationException lsve )
        {
            // The syntaxChecker does not exist
            syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(), schemaName );

            if ( schemaManager.getRegistries().contains( syntaxChecker ) )
            {
                // Remove the syntaxChecker from the schema/SchemaObject Map
                schemaManager.getRegistries().dissociateFromSchema( syntaxChecker );

                // Ok, we can exit.
                return;
            }
            else
            {
                // Ok, definitively an error
                String msg = I18n.err( I18n.ERR_387, entry.getDn().getName() );
                LOG.info( msg );
                throw new LdapSchemaViolationException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
            }
        }

        if ( schema.isEnabled() && syntaxChecker.isEnabled() )
        {
            if ( schemaManager.delete( syntaxChecker ) )
            {
                LOG.debug( "Deleted {} from the enabled schema {}", dn.getName(), schemaName );
            }
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );

        if ( isSchemaEnabled( schemaName ) )
        {
            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager
                .getRegistries(), schemaName );
            schemaManager.unregisterSyntaxChecker( oldOid );
            schemaManager.add( syntaxChecker );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

            throw new LdapNamingException( I18n.err( I18n.ERR_390, newOid ),
                ResultCodeEnum.OTHER );
        }

        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager
            .getRegistries(), newSchemaName );

        if ( isSchemaEnabled( oldSchemaName ) )
        {
            schemaManager.unregisterSyntaxChecker( oldOid );
View Full Code Here

Examples of org.apache.directory.shared.ldap.schema.SyntaxChecker

        {
            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_393, oid ),
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
            newSchemaName );

        if ( isSchemaEnabled( oldSchemaName ) )
        {
            schemaManager.unregisterSyntaxChecker( oid );
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.