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

Examples of org.apache.directory.shared.ldap.model.ldif.LdifEntry


            {
                if ( resourcePath.startsWith( start ) && resourcePath.endsWith( end ) )
                {
                    URL resource = getResource( resourcePath, "syntax LDIF file" );
                    LdifReader reader = new LdifReader( resource.openStream() );
                    LdifEntry entry = reader.next();
                    reader.close();

                    syntaxList.add( entry.getEntry() );
                }
            }
        }

        return syntaxList;
View Full Code Here


            {
                if ( resourcePath.startsWith( start ) && resourcePath.endsWith( end ) )
                {
                    URL resource = getResource( resourcePath, "attributeType LDIF file" );
                    LdifReader reader = new LdifReader( resource.openStream() );
                    LdifEntry entry = reader.next();
                    reader.close();

                    attributeTypeList.add( entry.getEntry() );
                }
            }
        }

        return attributeTypeList;
View Full Code Here

            {
                if ( resourcePath.startsWith( start ) && resourcePath.endsWith( end ) )
                {
                    URL resource = getResource( resourcePath, "matchingRuleUse LDIF file" );
                    LdifReader reader = new LdifReader( resource.openStream() );
                    LdifEntry entry = reader.next();
                    reader.close();

                    matchingRuleUseList.add( entry.getEntry() );
                }
            }
        }

        return matchingRuleUseList;
View Full Code Here

            {
                if ( resourcePath.startsWith( start ) && resourcePath.endsWith( end ) )
                {
                    URL resource = getResource( resourcePath, "nameForm LDIF file" );
                    LdifReader reader = new LdifReader( resource.openStream() );
                    LdifEntry entry = reader.next();
                    reader.close();

                    nameFormList.add( entry.getEntry() );
                }
            }
        }

        return nameFormList;
View Full Code Here

            {
                if ( resourcePath.startsWith( start ) && resourcePath.endsWith( end ) )
                {
                    URL resource = getResource( resourcePath, "ditContentRule LDIF file" );
                    LdifReader reader = new LdifReader( resource.openStream() );
                    LdifEntry entry = reader.next();
                    reader.close();

                    ditContentRulesList.add( entry.getEntry() );
                }
            }
        }

        return ditContentRulesList;
View Full Code Here

            {
                if ( resourcePath.startsWith( start ) && resourcePath.endsWith( end ) )
                {
                    URL resource = getResource( resourcePath, "ditStructureRule LDIF file" );
                    LdifReader reader = new LdifReader( resource.openStream() );
                    LdifEntry entry = reader.next();
                    reader.close();

                    ditStructureRuleList.add( entry.getEntry() );
                }
            }
        }

        return ditStructureRuleList;
View Full Code Here

            {
                if ( resourcePath.startsWith( start ) && resourcePath.endsWith( end ) )
                {
                    URL resource = getResource( resourcePath, "objectClass LDIF file" );
                    LdifReader reader = new LdifReader( resource.openStream() );
                    LdifEntry entry = reader.next();
                    reader.close();

                    objectClassList.add( entry.getEntry() );
                }
            }
        }

        return objectClassList;
View Full Code Here

        // The revision
        long revision = in.readLong();

        // The forward LDIF
        LdifEntry forwardEntry = new LdifEntry();

        try
        {
            forwardEntry.readExternal( in );
        }
        catch ( ClassNotFoundException cnfe )
        {
            IOException ioe = new IOException( cnfe.getMessage() );
            ioe.initCause( cnfe );
            throw ioe;
        }

        // The reverse LDIFs number
        int nbReverses = in.readInt();

        List<LdifEntry> reverses = new ArrayList<LdifEntry>( nbReverses );

        for ( int i = 0; i < nbReverses; i++ )
        {
            LdifEntry reverseEntry = new LdifEntry();

            try
            {
                reverseEntry.readExternal( in );
            }
            catch ( ClassNotFoundException cnfe )
            {
                IOException ioe = new IOException( cnfe.getMessage() );
                ioe.initCause( cnfe );
View Full Code Here

            if ( entries == null )
            {
                entries = new ArrayList<LdifEntry>();

                // Building the default config root entry 'ou=config'
                LdifEntry configRootEntry = new LdifEntry();
                configRootEntry.setDn( new Dn( SchemaConstants.OU_AT + "=" + "config" ) );
                addObjectClassAttribute( schemaManager, configRootEntry, "organizationalUnit" );
                addAttributeTypeValues( SchemaConstants.OU_AT, "config", configRootEntry );
                entries.add( configRootEntry );

                // Building entries from the directory service beans
                List<AdsBaseBean> directoryServiceBeans = configBean.getDirectoryServiceBeans();
                for ( AdsBaseBean adsBaseBean : directoryServiceBeans )
                {
                    addBean( configRootEntry.getDn(), schemaManager, adsBaseBean, entries );
                }
            }
        }
        catch ( Exception e )
        {
View Full Code Here

        {
            // Getting the class of the bean
            Class<?> beanClass = bean.getClass();

            // Creating the entry to hold the bean and adding it to the list
            LdifEntry entry = new LdifEntry();
            entry.setDn( getDn( rootDn, bean ) );
            addObjectClassAttribute( schemaManager, entry, getObjectClassNameForBean( beanClass ) );
            entries.add( entry );

            // A flag to know when we reached the 'AdsBaseBean' class when
            // looping on the class hierarchy of the bean
            boolean adsBaseBeanClassFound = false;

            // Looping until the 'AdsBaseBean' class has been found
            while ( !adsBaseBeanClassFound )
            {
                // Checking if we reached the 'AdsBaseBean' class
                if ( beanClass == AdsBaseBean.class )
                {
                    adsBaseBeanClassFound = true;
                }

                // Looping on all fields of the bean
                Field[] fields = beanClass.getDeclaredFields();
                for ( Field field : fields )
                {
                    // Making the field accessible (we get an exception if we don't do that)
                    field.setAccessible( true );

                    // Getting the class of the field
                    Class<?> fieldClass = field.getType();
                    Object fieldValue = field.get( bean );

                    // Looking for the @ConfigurationElement annotation
                    ConfigurationElement configurationElement = field.getAnnotation( ConfigurationElement.class );
                    if ( configurationElement != null )
                    {
                        // Checking if we have a value for the attribute type
                        String attributeType = configurationElement.attributeType();
                        if ( ( attributeType != null ) && ( !"".equals( attributeType ) ) )
                        {
                            // Checking if we're dealing with a container
                            String container = configurationElement.container();
                            if ( ( container != null ) && ( !"".equals( container ) ) )
                            {
                                // Creating the entry for the container and adding it to the list
                                LdifEntry containerEntry = new LdifEntry();
                                containerEntry.setDn( entry.getDn().add( new Rdn( SchemaConstants.OU_AT, container ) ) );
                                addObjectClassAttribute( schemaManager, containerEntry,
                                    SchemaConstants.ORGANIZATIONAL_UNIT_OC );
                                addAttributeTypeValues( SchemaConstants.OU_AT, container, containerEntry );
                                entries.add( containerEntry );

                                if ( Collection.class.isAssignableFrom( fieldClass ) )
                                {
                                    // Looping on the Collection's objects
                                    Collection<Object> collection = ( Collection<Object> ) fieldValue;
                                    for ( Object object : collection )
                                    {
                                        if ( object instanceof AdsBaseBean )
                                        {
                                            // Adding the bean
                                            addBean( containerEntry.getDn(), schemaManager, ( AdsBaseBean ) object,
                                                entries, entry, attributeType );

                                            continue;
                                        }
                                        else
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.ldif.LdifEntry

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.