Examples of ObjectClass


Examples of org.apache.directory.api.ldap.model.schema.ObjectClass

            // Create the set of candidates
            for ( Value<?> ocValue : objectClass )
            {
                String ocName = ocValue.getString();
                String ocOid = schemaManager.getObjectClassRegistry().getOidByName( ocName );
                ObjectClass oc = schemaManager.getObjectClassRegistry().get( ocOid );

                if ( oc.isStructural() )
                {
                    candidates.add( oc );
                }
            }
        }
        catch ( Exception e )
        {
            throw e;
        }

        // Now find the parent OC
        for ( Value<?> ocValue : objectClass )
        {
            String ocName = ocValue.getString();
            String ocOid = schemaManager.getObjectClassRegistry().getOidByName( ocName );
            ObjectClass oc = schemaManager.getObjectClassRegistry().get( ocOid );

            for ( ObjectClass superior : oc.getSuperiors() )
            {
                if ( oc.isStructural() )
                {
                    if ( candidates.contains( superior ) )
                    {
                        candidates.remove( superior );
                    }
                }
            }
        }

        // The remaining OC in the candidates set is the one we are looking for
        ObjectClass result = candidates.toArray( new ObjectClass[]
            {} )[0];

        LOG.debug( "The top level object class is {}", result.getName() );
        return result;
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.schema.ObjectClass

                Entry entry = configPartition.fetch( forwardEntry.getId() );
                LOG.debug( "Entry read : {}", entry );

                // Let's instantiate the bean we need. The upper ObjectClass's name
                // will be used to do that
                ObjectClass objectClass = findObjectClass( entry.get( SchemaConstants.OBJECT_CLASS_AT ) );

                // Instantiating the bean
                AdsBaseBean bean = createBean( objectClass );

                // Setting its DN
View Full Code Here

Examples of org.apache.directory.ldapstudio.schemas.model.ObjectClass

    {
        hiddenObjectClasses = new ArrayList<ObjectClass>();

        for ( String name : names )
        {
            ObjectClass oc = schemaPool.getObjectClass( name );
            if ( oc != null )
            {
                hiddenObjectClasses.add( oc );
            }
        }
View Full Code Here

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

        {
            String desc = value.getString();

            try
            {
                ObjectClass objectClass = OC_DESCR_SCHEMA_PARSER.parseObjectClassDescription( desc );

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

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

            {
                SchemaObject schemaObject = schemaObjectWrapper.get();

                if ( schemaObject instanceof ObjectClass )
                {
                    ObjectClass objectClass = ( ObjectClass ) schemaObject;

                    Entry objectClassEntry = factory.convert( objectClass, schema, null );

                    objectClassEntries.add( objectClassEntry );
                }
View Full Code Here

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

                attributeTypes.add( attributeType );
            }
            else if ( obj instanceof ObjectClass )
            {
                ObjectClass objectClass = ( ObjectClass ) obj;

                objectClasses.add( objectClass );
            }
        }

        if ( isResolveObjectIdentifierMacros() )
        {
            // resolve object identifier macros
            for ( OpenLdapObjectIdentifierMacro oid : objectIdentifierMacros.values() )
            {
                resolveObjectIdentifierMacro( oid );
            }

            // apply object identifier macros to object classes
            for ( ObjectClass objectClass : objectClasses )
            {
                objectClass.setOid( getResolveOid( objectClass.getOid() ) );
            }

            // apply object identifier macros to attribute types
            for ( AttributeType attributeType : attributeTypes )
            {
View Full Code Here

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

        }

        // ObjectClass
        try
        {
            ObjectClass objectClass = objectClassRegistry.lookup( name );

            if ( objectClass != null )
            {
                return objectClass.getOid();
            }
        }
        catch ( LdapException ne )
        {
            // Fall down to the next registry
View Full Code Here

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

    @SuppressWarnings("PMD.EmptyCatchBlock")
    private void resolveRecursive( ObjectClass objectClass, Set<String> processed, List<Throwable> errors )
    {
        // Process the Superiors, if any
        List<String> superiorOids = objectClass.getSuperiorOids();
        ObjectClass superior = null;

        for ( String superiorOid : superiorOids )
        {
            // Check if the Superior is present in the registries
            try
            {
                superior = objectClassRegistry.lookup( superiorOid );
            }
            catch ( LdapException ne )
            {
                // This OC's superior has not been loaded into the Registries.
                if ( !processed.contains( superiorOid ) )
                {
                    LdapSchemaException ldapSchemaException = new LdapSchemaException(
                        LdapSchemaExceptionCodes.OC_NONEXISTENT_SUPERIOR, ne );
                    ldapSchemaException.setSourceObject( objectClass );
                    ldapSchemaException.setRelatedId( superiorOid );
                    errors.add( ldapSchemaException );
                }
            }

            // We now have to process the superior, if it hasn't been
            // processed yet.
            if ( superior != null )
            {
                if ( !processed.contains( superior.getOid() ) )
                {
                    resolveRecursive( superior, processed, errors );
                    processed.add( objectClass.getOid() );
                }
                else
View Full Code Here

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

            for ( String superiorName : superiorOids )
            {
                try
                {
                    ObjectClass superior = ocRegistry.lookup( ocRegistry.getOidByName( superiorName ) );

                    // Before adding the superior, check that the ObjectClass type is consistent
                    switch ( objectClass.getType() )
                    {
                        case ABSTRACT:
                            if ( superior.getType() != ObjectClassTypeEnum.ABSTRACT )
                            {
                                // An ABSTRACT OC can only inherit from ABSTRACT OCs
                                String msg = I18n.err( I18n.ERR_04318, objectClass.getOid(), superior.getObjectType(), superior );

                                LdapSchemaException ldapSchemaException = new LdapSchemaException(
                                    LdapSchemaExceptionCodes.OC_ABSTRACT_MUST_INHERIT_FROM_ABSTRACT_OC, msg );
                                ldapSchemaException.setSourceObject( objectClass );
                                errors.add( ldapSchemaException );
                                LOG.info( msg );

                                continue;
                            }

                            break;

                        case AUXILIARY:
                            if ( superior.getType() == ObjectClassTypeEnum.STRUCTURAL )
                            {
                                // An AUXILIARY OC cannot inherit from STRUCTURAL OCs
                                String msg = I18n.err( I18n.ERR_04319, objectClass.getOid(), superior );

                                LdapSchemaException ldapSchemaException = new LdapSchemaException(
                                    LdapSchemaExceptionCodes.OC_AUXILIARY_CANNOT_INHERIT_FROM_STRUCTURAL_OC, msg );
                                ldapSchemaException.setSourceObject( objectClass );
                                errors.add( ldapSchemaException );
                                LOG.info( msg );

                                continue;
                            }

                            break;

                        case STRUCTURAL:
                            if ( superior.getType() == ObjectClassTypeEnum.AUXILIARY )
                            {
                                // A STRUCTURAL OC cannot inherit from AUXILIARY OCs
                                String msg = I18n.err( I18n.ERR_04320, objectClass.getOid(), superior );

                                LdapSchemaException ldapSchemaException = new LdapSchemaException(
View Full Code Here

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

     */
    private boolean isOCPresent( SchemaManager schemaManager, String oid )
    {
        try
        {
            ObjectClass objectClass = schemaManager.lookupObjectClassRegistry( oid );

            return objectClass != null;
        }
        catch ( LdapException ne )
        {
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.