Package org.apache.directory.shared.ldap.model.message.controls

Examples of org.apache.directory.shared.ldap.model.message.controls.EntryChange


            } );
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );
       
        EntryChange entryChange = (EntryChange)decorator.decode( bb.array() );

        assertEquals( ChangeType.ADD, entryChange.getChangeType() );
        assertNull( entryChange.getPreviousDn() );
        assertEquals( 16, entryChange.getChangeNumber() );
    }
View Full Code Here


            } );
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );
       
        EntryChange entryChange = (EntryChange)decorator.decode( bb.array() );

        assertEquals( ChangeType.ADD, entryChange.getChangeType() );
        assertNull( entryChange.getPreviousDn() );
        assertEquals( EntryChangeDecorator.UNDEFINED_CHANGE_NUMBER, entryChange.getChangeNumber() );
    }
View Full Code Here

        String expected = Strings.dumpBytes(bb.array());
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );

        EntryChange entryChange = (EntryChange) decorator.getDecorated();
        entryChange.setChangeType( ChangeType.MODDN );
        entryChange.setChangeNumber( 16 );
        entryChange.setPreviousDn( new Dn( "a=b" ) );
        bb = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
        String decoded = Strings.dumpBytes( bb.array() );
        assertEquals( expected, decoded );
    }
View Full Code Here

        String expected = Strings.dumpBytes(bb.array());
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );
       
        EntryChange entryChange = (EntryChange) decorator.getDecorated();

        entryChange.setChangeType( ChangeType.MODDN );
        entryChange.setChangeNumber( 5124095576030430L );
        entryChange.setPreviousDn( new Dn( "a=b" ) );
        bb = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
        String decoded = Strings.dumpBytes(bb.array());
        assertEquals( expected, decoded );
    }
View Full Code Here

    private void setECResponseControl( SearchResultEntry response, ChangeOperationContext opContext, ChangeType type )
    {
        if ( psearchControl.isReturnECs() )
        {
            EntryChange ecControl = new EntryChangeImpl();
            ecControl.setChangeType( type );

            if ( opContext.getChangeLogEvent() != null )
            {
                ecControl.setChangeNumber( opContext.getChangeLogEvent().getRevision() );
            }

            if ( opContext instanceof RenameOperationContext || opContext instanceof MoveOperationContext )
            {
                ecControl.setPreviousDn( opContext.getDn() );
            }

            response.addControl( ecControl );
        }
    }
View Full Code Here

                ctx.setRequestControls( JndiUtils.toJndiControls( codec, ctxCtls) );
                isReady = true;
                LOG.debug( "PSearchListener is ready and about to issue persistent search request." );
                list = ctx.search( "", "objectClass=*", null );
                LOG.debug( "PSearchListener search request returned." );
                EntryChange ecControl = null;

                while ( list.hasMore() )
                {
                    LOG.debug( "PSearchListener search request got an item." );
                    javax.naming.ldap.Control[] controls;
View Full Code Here

        } );
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );

        EntryChange entryChange = ( EntryChange ) decorator.decode( bb.array() );

        assertEquals( ChangeType.MODDN, entryChange.getChangeType() );
        assertEquals( "a=b", entryChange.getPreviousDn().toString() );
        assertEquals( 16, entryChange.getChangeNumber() );
    }
View Full Code Here

        } );
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );

        EntryChange entryChange = ( EntryChange ) decorator.decode( bb.array() );

        assertEquals( ChangeType.MODDN, entryChange.getChangeType() );
        assertEquals( "a=b", entryChange.getPreviousDn().toString() );
        assertEquals( 5124095576030430L, entryChange.getChangeNumber() );
    }
View Full Code Here

        } );
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );

        EntryChange entryChange = ( EntryChange ) decorator.decode( bb.array() );

        assertEquals( ChangeType.ADD, entryChange.getChangeType() );
        assertNull( entryChange.getPreviousDn() );
        assertEquals( 16, entryChange.getChangeNumber() );
    }
View Full Code Here

            } );
        bb.flip();

        EntryChangeDecorator decorator = new EntryChangeDecorator( codec );

        EntryChange entryChange = ( EntryChange ) decorator.decode( bb.array() );

        assertEquals( ChangeType.ADD, entryChange.getChangeType() );
        assertNull( entryChange.getPreviousDn() );
        assertEquals( EntryChangeDecorator.UNDEFINED_CHANGE_NUMBER, entryChange.getChangeNumber() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.message.controls.EntryChange

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.