Examples of LdifChangeAddRecord


Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord

                throw createConnectionException( null, monitor.getException() );
            }
        }
        else if ( record instanceof LdifChangeAddRecord )
        {
            LdifChangeAddRecord changeAddRecord = ( LdifChangeAddRecord ) record;
            LdifAttrValLine[] attrVals = changeAddRecord.getAttrVals();
            Attributes jndiAttributes = new BasicAttributes();
            for ( int ii = 0; ii < attrVals.length; ii++ )
            {
                String attributeName = attrVals[ii].getUnfoldedAttributeDescription();
                Object realValue = attrVals[ii].getValueAsObject();
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord

    void create( IEntry entryToCreate, StudioProgressMonitor monitor )
    {
        try
        {
            LdifChangeAddRecord car = ModelConverter.entryToLdifChangeAddRecord( entryToCreate );
            this.applyModificationAndLog( car, monitor );

            // connection.cacheEntry(entryToCreate);
            // entryToCreate.setDirectoryEntry(true);
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord

                LdifContentRecord record = ( LdifContentRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeAddRecord )
            {
                LdifChangeAddRecord record = ( LdifChangeAddRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeModifyRecord )
            {
                LdifChangeModifyRecord record = ( LdifChangeModifyRecord ) element;
                return record.getModSpecs();
            }
            else if ( element instanceof LdifChangeModDnRecord )
            {
                return new Object[0];
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord

            }
        }

        // LdifChangeAddRecord record =
        // LdifChangeAddRecord.create(entry.getDn().toString());
        LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( entry.getDn().toString() ) );
        if ( mustCreateChangeTypeLine )
        {
            addControls( record, entry );
            record.setChangeType( LdifChangeTypeLine.createAdd() );
        }

        for ( int i = 0; i < attributes.length; i++ )
        {
            String name = attributes[i].getDescription();
            IValue[] values = attributes[i].getValues();
            for ( int ii = 0; ii < values.length; ii++ )
            {
                IValue value = values[ii];
                if ( value.getRawValue() instanceof LdifPart )
                {
                    LdifPart part = ( LdifPart ) value.getRawValue();
                    if ( part instanceof LdifChangeTypeLine )
                    {
                        record.setChangeType( ( LdifChangeTypeLine ) part );
                    }
                    else if ( part instanceof LdifCommentLine )
                    {
                        record.addComment( ( LdifCommentLine ) part );
                    }
                    else if ( part instanceof LdifControlLine )
                    {
                        record.addControl( ( LdifControlLine ) part );
                    }
                }
                else if ( value.isString() )
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getStringValue() ) );
                }
                else
                {
                    record.addAttrVal( LdifAttrValLine.create( name, value.getBinaryValue() ) );
                }
            }
        }

        record.finish( LdifSepLine.create() );

        return record;
    }
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord

                    return;
                }
            }
            else
            {
                LdifChangeAddRecord changeAddRecord = ( LdifChangeAddRecord ) record;
                attrVals = changeAddRecord.getAttrVals();
                try
                {
                    dummyEntry = ModelConverter.ldifChangeAddRecordToEntry( changeAddRecord, browserConnection );
                }
                catch ( InvalidNameException e )
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord

                LdifContentRecord record = ( LdifContentRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeAddRecord )
            {
                LdifChangeAddRecord record = ( LdifChangeAddRecord ) element;
                return getUniqueAttrValLineArray( record.getAttrVals() );
            }
            else if ( element instanceof LdifChangeModifyRecord )
            {
                LdifChangeModifyRecord record = ( LdifChangeModifyRecord ) element;
                return record.getModSpecs();
            }
            else if ( element instanceof LdifChangeModDnRecord )
            {
                return new Object[0];
            }
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord

        }

        try
        {
            Set<String> maskedAttributes = getMaskedAttributes();
            LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( dn ) );
            addControlLines( record, controls );
            record.setChangeType( LdifChangeTypeLine.createAdd() );
            NamingEnumeration<? extends Attribute> attributeEnumeration = attributes.getAll();
            while ( attributeEnumeration.hasMore() )
            {
                Attribute attribute = attributeEnumeration.next();
                String attributeName = attribute.getID();
                NamingEnumeration<?> valueEnumeration = attribute.getAll();
                while ( valueEnumeration.hasMore() )
                {
                    Object o = valueEnumeration.next();
                    if ( maskedAttributes.contains( attributeName.toLowerCase() ) )
                    {
                        record.addAttrVal( LdifAttrValLine.create( attributeName, "**********" ) ); //$NON-NLS-1$
                    }
                    else
                    {
                        if ( o instanceof String )
                        {
                            record.addAttrVal( LdifAttrValLine.create( attributeName, ( String ) o ) );
                        }
                        if ( o instanceof byte[] )
                        {
                            record.addAttrVal( LdifAttrValLine.create( attributeName, ( byte[] ) o ) );
                        }
                    }
                }
            }
            record.finish( LdifSepLine.create() );

            String formattedString = record.toFormattedString( LdifFormatParameters.DEFAULT );
            log( formattedString, ex, connection );
        }
        catch ( NamingException e )
        {
        }
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord

                    mustCreateChangeTypeLine = false;
                }
            }
        }

        LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( entry.getDn().getUpName() ) );
        if ( mustCreateChangeTypeLine )
        {
            addControls( record, entry );
            record.setChangeType( LdifChangeTypeLine.createAdd() );
        }

        for ( IAttribute attribute : entry.getAttributes() )
        {
            String name = attribute.getDescription();
            for ( IValue value : attribute.getValues() )
            {
                if ( !value.isEmpty() )
                {
                    if ( value.getRawValue() instanceof LdifPart )
                    {
                        LdifPart part = ( LdifPart ) value.getRawValue();
                        if ( part instanceof LdifChangeTypeLine )
                        {
                            record.setChangeType( ( LdifChangeTypeLine ) part );
                        }
                        else if ( part instanceof LdifCommentLine )
                        {
                            record.addComment( ( LdifCommentLine ) part );
                        }
                        else if ( part instanceof LdifControlLine )
                        {
                            record.addControl( ( LdifControlLine ) part );
                        }
                    }
                    else if ( value.isString() )
                    {
                        record.addAttrVal( LdifAttrValLine.create( name, value.getStringValue() ) );
                    }
                    else
                    {
                        record.addAttrVal( LdifAttrValLine.create( name, value.getBinaryValue() ) );
                    }
                }
            }
        }

        record.finish( LdifSepLine.create() );

        return record;
    }
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.