Package org.apache.directory.shared.ldap.schema

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


            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.",
                ResultCodeEnum.OTHER );
        }

        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( targetEntry, targetRegistries );

        if ( ! oldSchema.isDisabled() )
        {
            syntaxCheckerRegistry.unregister( oldOid );
        }
View Full Code Here


        }

        Schema oldSchema = getSchema( oriChildName );
        Schema newSchema = getSchema( newParentName );
       
        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( entry, targetRegistries );
       
        if ( ! oldSchema.isDisabled() )
        {
            syntaxCheckerRegistry.unregister( oid );
        }
View Full Code Here

    /* no protection*/ static AttributeType getCaseIgnoringAttributeNoNumbersType()
    {
        S s = new S( "1.1.1.1", true );

        s.setSyntaxChecker( new SyntaxChecker()
        {
            public String getSyntaxOid()
            {
                return "1.1.1.1";
            }
View Full Code Here

    {
        AT at = new AT( "1.1" );

        S s = new S( "1.1.1", true );

        s.setSyntaxChecker( new SyntaxChecker()
        {
            public String getSyntaxOid()
            {
                return "1.1.1";
            }
View Full Code Here

    {
        AT at = new AT( "1.2" );

        S s = new S( "1.2.1", true );

        s.setSyntaxChecker( new SyntaxChecker()
        {
            public String getSyntaxOid()
            {
                return "1.2.1";
            }
View Full Code Here

            assertNotNull( attrs );
            SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
           
            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );

            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( serverEntry, service.getRegistries() );
            assertEquals( oid, syntaxChecker.getSyntaxOid() );
        }
        else
        {
            //noinspection EmptyCatchBlock
            try
View Full Code Here

    {
        // First, loop on all attributes
        for ( EntryAttribute attribute : entry )
        {
            AttributeType attributeType = ( ( ServerAttribute ) attribute ).getAttributeType();
            SyntaxChecker syntaxChecker = attributeType.getSyntax().getSyntaxChecker();

            if ( syntaxChecker instanceof AcceptAllSyntaxChecker )
            {
                // This is a speedup : no need to check the syntax of any value
                // if all the syntaxes are accepted...
                continue;
            }

            // Then loop on all values
            for ( Value<?> value : attribute )
            {
                try
                {
                    syntaxChecker.assertSyntax( value.get() );
                }
                catch ( Exception ne )
                {
                    String message = "Attribute value '" + value.getString()
                         + "' for attribute '" + attribute.getUpId() + "' is syntactically incorrect";
View Full Code Here

   
    private SyntaxChecker getSyntaxChecker( String syntaxOid, String className, EntryAttribute bytecode, Registries targetRegistries )
        throws NamingException
    {
        Class<?> clazz = null;
        SyntaxChecker syntaxChecker = null;
       
        try
        {
            if ( bytecode == null )
            {
View Full Code Here

     *
     * @throws Exception on errors
     */
    @Test public void testConstrainedString()
    {
        s.setSyntaxChecker( new SyntaxChecker() {
            public String getSyntaxOid() { return "1.1.1.1"; }
            public boolean isValidSyntax( Object value )
            {
                if ( value instanceof String )
                {
View Full Code Here

    {
        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

TOP

Related Classes of org.apache.directory.shared.ldap.schema.SyntaxChecker

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.