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

Examples of org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription


    /**
     * {@inheritDoc}
     */
    public void setInput( Object input )
    {
        MatchingRuleDescription mrd = null;
        if ( input instanceof MatchingRuleDescription )
        {
            mrd = ( MatchingRuleDescription ) input;
        }

        // create main content
        createMainContent( mrd );

        // set flag
        isObsoleteText.setEnabled( mrd != null && mrd.isObsolete() );

        // set syntax content
        String lsdOid = null;
        LdapSyntaxDescription lsd = null;
        if ( mrd != null )
        {
            Schema schema = getSchema();
            lsdOid = mrd.getSyntax();
            if ( lsdOid != null && schema.hasLdapSyntaxDescription( lsdOid ) )
            {
                lsd = schema.getLdapSyntaxDescription( lsdOid );
            }
        }
View Full Code Here


        int pos = 0;
       
        for ( Value<?> value:attr )
        {
            MatchingRuleDescription desc = null;

            try
            {
                desc = matchingRuleParser.parseMatchingRuleDescription( value.getString() );
            }
            catch ( ParseException e )
            {
                LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(
                    "The following does not conform to the matchingRuleDescription syntax: " + value.getString(),
                    ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                iave.setRootCause( e );
                throw iave;
            }
           
            if ( ! dao.hasSyntax( desc.getSyntax() )  )
            {
                throw new LdapOperationNotSupportedException(
                    "Cannot create a matchingRule that depends on non-existant syntax: " + desc.getSyntax(),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }
           
            MatchingRuleImpl mr = new MatchingRuleImpl( desc.getNumericOid(), desc.getSyntax(), globalRegistries );
            setSchemaObjectProperties( desc, mr );
           
            matchingRules[pos++] = mr;
        }
       
View Full Code Here

        // check first to see if it is present in the subschemaSubentry
        // -------------------------------------------------------------------
       
        Attributes attrs = getSubschemaSubentryAttributes();
        Attribute attrTypes = attrs.get( "matchingRules" );
        MatchingRuleDescription matchingRuleDescription = null;
        for ( int ii = 0; ii < attrTypes.size(); ii++ )
        {
            String desc = ( String ) attrTypes.get( ii );
            if ( desc.indexOf( oid ) != -1 )
            {
                matchingRuleDescription = matchingRuleDescriptionSchemaParser.parseMatchingRuleDescription( desc );
                break;
            }
        }
    
        if ( isPresent )
        {
            assertNotNull( matchingRuleDescription );
            assertEquals( oid, matchingRuleDescription.getNumericOid() );
        }
        else
        {
            assertNull( matchingRuleDescription );
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription

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.