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

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


        }

        // DitStructureRule
        try
        {
            DitStructureRule ditStructureRule = ditStructureRuleRegistry.lookup( name );

            if ( ditStructureRule != null )
            {
                return ditStructureRule.getOid();
            }
        }
        catch ( LdapException ne )
        {
            // No more registries to look at...
View Full Code Here


        int pos = 0;

        for ( Value<?> value : attr )
        {
            DitStructureRule ditStructureRule = null;

            try
            {
                ditStructureRule = ditStructureRuleParser.parseDITStructureRuleDescription( value.getString() );
                ditStructureRule.setSpecification( value.getString() );
            }
            catch ( ParseException e )
            {
                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(
                    ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err( I18n.ERR_426,
View Full Code Here

        {
            String desc = value.getString();

            try
            {
                DitStructureRule ditStructureRule = DSR_DESCR_SCHEMA_PARSER.parseDITStructureRuleDescription( desc );

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

            {
                SchemaObject schemaObject = schemaObjectWrapper.get();

                if ( schemaObject instanceof DitStructureRule )
                {
                    DitStructureRule ditStructureRule = ( DitStructureRule ) schemaObject;

                    Entry ditStructureRuleEntry = factory.convert( ditStructureRule, schema, null );

                    ditStructureRuleEntries.add( ditStructureRuleEntry );
                }
View Full Code Here

        reset( ditStructureRuleDescription ); // reset and initialize the parser / lexer pair

        try
        {
            DitStructureRule ditStructureRule = parser.ditStructureRuleDescription();

            // Update the schemaName
            updateSchemaName( ditStructureRule );

            return ditStructureRule;
View Full Code Here

        }

        // DitStructureRule
        try
        {
            DitStructureRule ditStructureRule = ditStructureRuleRegistry.lookup( name );

            if ( ditStructureRule != null )
            {
                return ditStructureRule.getOid();
            }
        }
        catch ( LdapException ne )
        {
            // No more registries to look at...
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String getSchemaName( int ruleId ) throws LdapException
    {
        DitStructureRule ditStructureRule = byRuleId.get( ruleId );

        if ( ditStructureRule != null )
        {
            return ditStructureRule.getSchemaName();
        }

        String msg = I18n.err( I18n.ERR_04263, ruleId );
        LOG.warn( msg );
        throw new LdapException( msg );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public DitStructureRule lookup( int ruleId ) throws LdapException
    {
        DitStructureRule ditStructureRule = byRuleId.get( ruleId );

        if ( ditStructureRule == null )
        {
            String msg = I18n.err( I18n.ERR_04265, ruleId );
            LOG.debug( msg );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void unregister( int ruleId ) throws LdapException
    {
        DitStructureRule ditStructureRule = byRuleId.remove( ruleId );

        if ( DEBUG )
        {
            LOG.debug( "Removed {} with ruleId {} from the registry", ditStructureRule, ruleId );
        }
View Full Code Here

     */
    @Test
    public void testNumericRuleId() throws ParseException
    {
        String value = null;
        DitStructureRule ditStructureRule = null;

        // null test
        value = null;
        try
        {
            parser.parseDITStructureRuleDescription( value );
            fail( "Exception expected, null" );
        }
        catch ( ParseException pe )
        {
            // expected
        }

        // no ruleid
        value = "( )";
        try
        {
            parser.parseDITStructureRuleDescription( value );
            fail( "Exception expected, no ruleid" );
        }
        catch ( ParseException pe )
        {
            // expected
        }

        // simple
        value = "( 1 FORM 1.1 )";
        ditStructureRule = parser.parseDITStructureRuleDescription( value );
        assertEquals( 1, ditStructureRule.getRuleId() );

        // simple
        value = "( 1234567890 FORM 1.1 )";
        ditStructureRule = parser.parseDITStructureRuleDescription( value );
        assertEquals( 1234567890, ditStructureRule.getRuleId() );

        // simple with spaces
        value = "(      1234567890   FORM   1.1     )";
        ditStructureRule = parser.parseDITStructureRuleDescription( value );
        assertEquals( 1234567890, ditStructureRule.getRuleId() );

        // non-numeric not allowed
        value = "( test FORM 1.1 )";
        try
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.schema.DitStructureRule

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.