Examples of LdifChangeRecord


Examples of com.unboundid.ldif.LDIFChangeRecord

        if (reader != null) {
            try {
                boolean keepReading = true;
                do {
                    try {
                        final LDIFChangeRecord record = reader.nextRecord();
                        if (record == null) {
                            keepReading = false;
                        } else {
                            record.processChange(connection);
                        }
                    } catch (final LDIFException e) {
                        if (!ignoreErrors || !e.mayContinueReading()) {
                            logger.logError("Error parsing directory entry read from the input stream", e);
                            keepReading = false;
View Full Code Here

Examples of com.unboundid.ldif.LDIFChangeRecord

    private static void loadData(final LDAPConnection connection,
                                 final InputStream inputStream)
            throws LDIFException, LDAPException, IOException {
        try {
            final LDIFReader reader = new LDIFReader(inputStream);
            LDIFChangeRecord changeRecord = reader.readChangeRecord(true);
            while (changeRecord != null) {
                changeRecord.processChange(connection);
                changeRecord = reader.readChangeRecord(true);
            }
        } finally {
            inputStream.close();
        }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifChangeRecord

    private Control[] getControls( LdifRecord record )
    {
        Control[] controls = null;
        if ( record instanceof LdifChangeRecord )
        {
            LdifChangeRecord changeRecord = ( LdifChangeRecord ) record;
            LdifControlLine[] controlLines = changeRecord.getControls();
            controls = new Control[controlLines.length];
            for ( int i = 0; i < controlLines.length; i++ )
            {
                LdifControlLine line = controlLines[i];
                // TODO: encoded control value
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifChangeRecord

        LdifControlLine controlLine = getControlLine();
        LdifChangeTypeLine changeTypeLine = getChangeTypeLine();
        if ( controlLine != null || changeTypeLine != null )
        {

            LdifChangeRecord record = null;

            // save all parts before changetype line
            List partList = new ArrayList();
            if ( dnErrorToken != null )
            {
                partList.add( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                partList.add( commentLines[i] );
            }
            if ( controlLine != null )
            {
                partList.add( controlLine );
                if ( !controlLine.isValid() )
                {
                    LdifToken errorToken = this.cleanupLine();
                    if ( errorToken != null )
                    {
                        partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                    }
                }
            }

            // save comments and controls before changetype line
            while ( changeTypeLine == null && ( commentLines.length > 0 || controlLine != null ) )
            {

                commentLines = getCommentLines();
                for ( int i = 0; i < commentLines.length; i++ )
                {
                    partList.add( commentLines[i] );
                }

                controlLine = getControlLine();
                if ( controlLine != null )
                {
                    partList.add( controlLine );
                    if ( !controlLine.isValid() )
                    {
                        LdifToken errorToken = this.cleanupLine();
                        if ( errorToken != null )
                        {
                            partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                        }
                    }
                }

                changeTypeLine = getChangeTypeLine();
            }

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseAttrValRecord( record );
                }
                else if ( changeTypeLine.isDelete() )
                {
                    record = new LdifChangeDeleteRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeDeleteRecord( record );
                }
                else if ( changeTypeLine.isModify() )
                {
                    record = new LdifChangeModifyRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModifyRecord( ( LdifChangeModifyRecord ) record );
                }
                else if ( changeTypeLine.isModDn() )
                {
                    record = new LdifChangeModDnRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModDnRecord( ( LdifChangeModDnRecord ) record );
                }
                else
                {
                    record = new LdifChangeRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                }
            }
            else
            {
                record = new LdifChangeRecord( dnLine );
                append( record, partList );
            }

            model.addContainer( record );
        }
        else
        {
            // match attr-val-record
            LdifContentRecord record = new LdifContentRecord( dnLine );
            if ( dnErrorToken != null )
            {
                record.addInvalid( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                record.addComment( commentLines[i] );
            }
            parseAttrValRecord( record );
            model.addContainer( record );
        }
View Full Code Here

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

    private Control[] getControls( LdifRecord record )
    {
        Control[] controls = null;
        if ( record instanceof LdifChangeRecord )
        {
            LdifChangeRecord changeRecord = ( LdifChangeRecord ) record;
            LdifControlLine[] controlLines = changeRecord.getControls();
            controls = new Control[controlLines.length];
            for ( int i = 0; i < controlLines.length; i++ )
            {
                LdifControlLine line = controlLines[i];
                // TODO: encoded control value
View Full Code Here

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

        LdifControlLine controlLine = getControlLine();
        LdifChangeTypeLine changeTypeLine = getChangeTypeLine();
        if ( controlLine != null || changeTypeLine != null )
        {

            LdifChangeRecord record = null;

            // save all parts before changetype line
            List partList = new ArrayList();
            if ( dnErrorToken != null )
            {
                partList.add( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                partList.add( commentLines[i] );
            }
            if ( controlLine != null )
            {
                partList.add( controlLine );
                if ( !controlLine.isValid() )
                {
                    LdifToken errorToken = this.cleanupLine();
                    if ( errorToken != null )
                    {
                        partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                    }
                }
            }

            // save comments and controls before changetype line
            while ( changeTypeLine == null && ( commentLines.length > 0 || controlLine != null ) )
            {

                commentLines = getCommentLines();
                for ( int i = 0; i < commentLines.length; i++ )
                {
                    partList.add( commentLines[i] );
                }

                controlLine = getControlLine();
                if ( controlLine != null )
                {
                    partList.add( controlLine );
                    if ( !controlLine.isValid() )
                    {
                        LdifToken errorToken = this.cleanupLine();
                        if ( errorToken != null )
                        {
                            partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                        }
                    }
                }

                changeTypeLine = getChangeTypeLine();
            }

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseAttrValRecord( record );
                }
                else if ( changeTypeLine.isDelete() )
                {
                    record = new LdifChangeDeleteRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeDeleteRecord( record );
                }
                else if ( changeTypeLine.isModify() )
                {
                    record = new LdifChangeModifyRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModifyRecord( ( LdifChangeModifyRecord ) record );
                }
                else if ( changeTypeLine.isModDn() )
                {
                    record = new LdifChangeModDnRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModDnRecord( ( LdifChangeModDnRecord ) record );
                }
                else
                {
                    record = new LdifChangeRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                }
            }
            else
            {
                record = new LdifChangeRecord( dnLine );
                append( record, partList );
            }

            model.addContainer( record );
        }
        else
        {
            // match attr-val-record
            LdifContentRecord record = new LdifContentRecord( dnLine );
            if ( dnErrorToken != null )
            {
                record.addInvalid( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                record.addComment( commentLines[i] );
            }
            parseAttrValRecord( record );
            model.addContainer( record );
        }
View Full Code Here

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

    private static Control[] getControls( LdifRecord record )
    {
        Control[] controls = null;
        if ( record instanceof LdifChangeRecord )
        {
            LdifChangeRecord changeRecord = ( LdifChangeRecord ) record;
            LdifControlLine[] controlLines = changeRecord.getControls();
            controls = new Control[controlLines.length];
            for ( int i = 0; i < controlLines.length; i++ )
            {
                LdifControlLine line = controlLines[i];
                controls[i] = new BasicControl( line.getUnfoldedOid(), line.isCritical(), line
View Full Code Here

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

        LdifControlLine controlLine = getControlLine();
        LdifChangeTypeLine changeTypeLine = getChangeTypeLine();
        if ( controlLine != null || changeTypeLine != null )
        {

            LdifChangeRecord record = null;

            // save all parts before changetype line
            List partList = new ArrayList();
            if ( dnErrorToken != null )
            {
                partList.add( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                partList.add( commentLines[i] );
            }
            if ( controlLine != null )
            {
                partList.add( controlLine );
                if ( !controlLine.isValid() )
                {
                    LdifToken errorToken = this.cleanupLine();
                    if ( errorToken != null )
                    {
                        partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                    }
                }
            }

            // save comments and controls before changetype line
            while ( changeTypeLine == null && ( commentLines.length > 0 || controlLine != null ) )
            {

                commentLines = getCommentLines();
                for ( int i = 0; i < commentLines.length; i++ )
                {
                    partList.add( commentLines[i] );
                }

                controlLine = getControlLine();
                if ( controlLine != null )
                {
                    partList.add( controlLine );
                    if ( !controlLine.isValid() )
                    {
                        LdifToken errorToken = this.cleanupLine();
                        if ( errorToken != null )
                        {
                            partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                        }
                    }
                }

                changeTypeLine = getChangeTypeLine();
            }

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseAttrValRecord( record );
                }
                else if ( changeTypeLine.isDelete() )
                {
                    record = new LdifChangeDeleteRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeDeleteRecord( record );
                }
                else if ( changeTypeLine.isModify() )
                {
                    record = new LdifChangeModifyRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModifyRecord( ( LdifChangeModifyRecord ) record );
                }
                else if ( changeTypeLine.isModDn() )
                {
                    record = new LdifChangeModDnRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModDnRecord( ( LdifChangeModDnRecord ) record );
                }
                else
                {
                    record = new LdifChangeRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                }
            }
            else
            {
                record = new LdifChangeRecord( dnLine );
                append( record, partList );
            }

            model.addContainer( record );
        }
        else
        {
            // match attr-val-record
            LdifContentRecord record = new LdifContentRecord( dnLine );
            if ( dnErrorToken != null )
            {
                record.addInvalid( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                record.addComment( commentLines[i] );
            }
            parseAttrValRecord( record );
            model.addContainer( record );
        }
View Full Code Here

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

    private static Control[] getControls( LdifRecord record )
    {
        Control[] controls = null;
        if ( record instanceof LdifChangeRecord )
        {
            LdifChangeRecord changeRecord = ( LdifChangeRecord ) record;
            LdifControlLine[] controlLines = changeRecord.getControls();
            controls = new Control[controlLines.length];
            for ( int i = 0; i < controlLines.length; i++ )
            {
                LdifControlLine line = controlLines[i];
                controls[i] = new BasicControl( line.getUnfoldedOid(), line.isCritical(), line.getControlValueAsBinary() );
View Full Code Here

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

    private static Control[] getControls( LdifRecord record )
    {
        Control[] controls = null;
        if ( record instanceof LdifChangeRecord )
        {
            LdifChangeRecord changeRecord = ( LdifChangeRecord ) record;
            LdifControlLine[] controlLines = changeRecord.getControls();
            controls = new Control[controlLines.length];
            for ( int i = 0; i < controlLines.length; i++ )
            {
                LdifControlLine line = controlLines[i];
                controls[i] = new BasicControl( line.getUnfoldedOid(), line.isCritical(), line.getControlValueAsBinary() );
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.