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

Examples of org.apache.directory.api.ldap.model.schema.registries.AttributeTypeRegistry


     */
    public static void removeFromRegistries( AttributeType attributeType, List<Throwable> errors, Registries registries ) throws LdapException
    {
        if ( registries != null )
        {
            AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry();

            // Remove the attributeType from the oid/normalizer map
            attributeTypeRegistry.removeMappingFor( attributeType );

            // Unregister this AttributeType into the Descendant map
            attributeTypeRegistry.unregisterDescendants( attributeType, attributeType.getSuperior() );

            /**
             * Remove the AT references (using and usedBy) :
             * AT -> MR (for EQUALITY, ORDERING and SUBSTR)
             * AT -> S
View Full Code Here


            OpenLdapSchemaParser olsp = new OpenLdapSchemaParser();
            olsp.setQuirksMode( true );
            olsp.parse( schemaFile );

            List<MutableAttributeType> atList = olsp.getAttributeTypes();
            AttributeTypeRegistry atRegistry = schemaManager.getRegistries().getAttributeTypeRegistry();

            for ( AttributeType atType : atList )
            {
                atRegistry.addMappingFor( atType );
            }

            List<ObjectClass> ocList = olsp.getObjectClassTypes();
            ObjectClassRegistry ocRegistry = schemaManager.getRegistries().getObjectClassRegistry();
View Full Code Here

        {
            try
            {
                matchingRuleUse.unlock();

                AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();

                matchingRuleUse.getApplicableAttributes().clear();

                for ( String oid : matchingRuleUse.getApplicableAttributeOids() )
                {
                    matchingRuleUse.getApplicableAttributes().add( atRegistry.lookup( oid ) );
                }
            }
            finally
            {
                matchingRuleUse.lock();
View Full Code Here

    /**
     * Build and check the MUST AT for this ObjectClass.
     */
    private static void buildMust( ObjectClass objectClass, List<Throwable> errors, Registries registries )
    {
        AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
        List<String> mustAttributeTypeOids = objectClass.getMustAttributeTypeOids();

        if ( mustAttributeTypeOids != null )
        {
            objectClass.getMustAttributeTypes().clear();

            for ( String mustAttributeTypeName : mustAttributeTypeOids )
            {
                try
                {
                    AttributeType attributeType = atRegistry.lookup( mustAttributeTypeName );

                    if ( attributeType.isCollective() )
                    {
                        // Collective Attributes are not allowed in MAY or MUST
                        String msg = I18n.err( I18n.ERR_04484_COLLECTIVE_NOT_ALLOWED_IN_MUST, mustAttributeTypeName,
View Full Code Here

    /**
     * Build and check the MAY AT for this ObjectClass
     */
    private static void buildMay( ObjectClass objectClass, List<Throwable> errors, Registries registries )
    {
        AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
        List<String> mayAttributeTypeOids = objectClass.getMayAttributeTypeOids();

        if ( mayAttributeTypeOids != null )
        {
            objectClass.getMayAttributeTypes().clear();

            for ( String mayAttributeTypeName : mayAttributeTypeOids )
            {
                try
                {
                    AttributeType attributeType = atRegistry.lookup( mayAttributeTypeName );

                    if ( attributeType.isCollective() )
                    {
                        // Collective Attributes are not allowed in MAY or MUST
                        String msg = I18n.err( I18n.ERR_04485_COLLECTIVE_NOT_ALLOWED_IN_MAY, mayAttributeTypeName, objectClass.getOid() );
View Full Code Here

        if ( registries != null )
        {
            try
            {
                ditContentRule.unlock();
                AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
                ObjectClassRegistry ocRegistry = registries.getObjectClassRegistry();

                if ( ditContentRule.getMayAttributeTypeOids() != null )
                {
                    ditContentRule.getMayAttributeTypes().clear();

                    for ( String oid : ditContentRule.getMayAttributeTypeOids() )
                    {
                        ditContentRule.getMayAttributeTypes().add( atRegistry.lookup( oid ) );
                    }
                }

                if ( ditContentRule.getMustAttributeTypeOids() != null )
                {
                    ditContentRule.getMustAttributeTypes().clear();

                    for ( String oid : ditContentRule.getMustAttributeTypeOids() )
                    {
                        ditContentRule.getMustAttributeTypes().add( atRegistry.lookup( oid ) );
                    }
                }

                if ( ditContentRule.getNotAttributeTypeOids() != null )
                {
                    ditContentRule.getNotAttributeTypes().clear();

                    for ( String oid : ditContentRule.getNotAttributeTypeOids() )
                    {
                        ditContentRule.getNotAttributeTypes().add( atRegistry.lookup( oid ) );
                    }
                }

                if ( ditContentRule.getAuxObjectClassOids() != null )
                {
View Full Code Here

        {
            try
            {
                nameForm.unlock();

                AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();

                ObjectClass structuralObjectClass = registries.getObjectClassRegistry().lookup(
                    nameForm.getStructuralObjectClassOid() );
                nameForm.setStructuralObjectClass( structuralObjectClass );

                nameForm.getMayAttributeTypes().clear();

                for ( String oid : nameForm.getMayAttributeTypeOids() )
                {
                    nameForm.getMayAttributeTypes().add( atRegistry.lookup( oid ) );
                }

                nameForm.getMustAttributeTypes().clear();

                for ( String oid : nameForm.getMustAttributeTypeOids() )
                {
                    nameForm.getMustAttributeTypes().add( atRegistry.lookup( oid ) );
                }
            }
            finally
            {
                nameForm.lock();
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.schema.registries.AttributeTypeRegistry

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.