Package org.apache.directory.shared.ldap.extras.controls

Examples of org.apache.directory.shared.ldap.extras.controls.SyncModifyDn


                  'o','u','=','d','c'         //     newSuperiorDn LDAPDN
            } );
        bb.flip();

        SyncModifyDnDecorator decorator = new SyncModifyDnDecorator( codec );
        SyncModifyDn syncmodDnControl = (SyncModifyDn)decorator.decode( bb.array() );

        assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
        assertEquals( "ou=dc", syncmodDnControl.getNewSuperiorDn() );
        assertFalse( syncmodDnControl.isDeleteOldRdn() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ((SyncModifyDnDecorator)syncmodDnControl).encode( ByteBuffer.allocate( ((SyncModifyDnDecorator)syncmodDnControl).computeLength() ) );
View Full Code Here


            } );
        bb.flip();

        SyncModifyDnDecorator decorator = new SyncModifyDnDecorator( codec );
       
        SyncModifyDn syncmodDnControl = (SyncModifyDn)decorator.decode( bb.array() );

        assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
        assertEquals( "uid=j", syncmodDnControl.getNewRdn() );
        assertTrue( syncmodDnControl.isDeleteOldRdn() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ((SyncModifyDnDecorator)syncmodDnControl).encode( ByteBuffer.allocate( ((SyncModifyDnDecorator)syncmodDnControl).computeLength() ) );
View Full Code Here

                  0x01, 0x01, ( byte ) 0xFF                       //     deleteOldRdn
            } );
        bb.flip();

        SyncModifyDnDecorator decorator = new SyncModifyDnDecorator( codec );
        SyncModifyDn syncmodDnControl = (SyncModifyDn)decorator.decode( bb.array() );

        assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
        assertEquals( "ou=dc", syncmodDnControl.getNewSuperiorDn() );
        assertEquals( "uid=j", syncmodDnControl.getNewRdn() );
        assertTrue( syncmodDnControl.isDeleteOldRdn() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ((SyncModifyDnDecorator)syncmodDnControl).encode( ByteBuffer.allocate( ((SyncModifyDnDecorator)syncmodDnControl).computeLength() ) );
View Full Code Here

    {
        ReplicaEventMessage replicaEventMessage = (ReplicaEventMessage)object;
   
        Entry entry = replicaEventMessage.getEntry();
        ChangeType changeType = replicaEventMessage.getChangeType();
        SyncModifyDn modDnControl = replicaEventMessage.getModDnControl();
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        // The entry DN
        entry.getDn().writeExternal( out );
       
        // The entry
        byte[] data = entrySerializer.serialize( entry );

        // Entry's length
        out.writeInt( data.length );
       
        // Entry's data
        out.write( data );

        // The change type
        out.writeByte( changeType.getValue() );
       
        // The moddn control if any (only if it's a MODDN operation)
        if ( changeType == ChangeType.MODDN )
        {
            SyncModifyDnType modDnType = modDnControl.getModDnType();
            out.writeByte( modDnType.getValue() );

            switch ( modDnType )
            {
                case MOVE:
                    out.writeUTF( modDnControl.getNewSuperiorDn() );
                    break;
                  
                case MOVE_AND_RENAME:
                    out.writeUTF( modDnControl.getNewSuperiorDn() );
                    // Fall through

                case RENAME:
                    out.writeUTF( modDnControl.getNewRdn() );
                    out.writeBoolean( modDnControl.isDeleteOldRdn() );
                    break;
            }
        }

        out.flush();
View Full Code Here

            if ( changeType == ChangeType.MODDN )
            {
                type = in.readByte();
                SyncModifyDnType modDnType = SyncModifyDnType.getModifyDnType( type );
                SyncModifyDn modDnControl = new SyncModifyDnDecorator( codec );
               
                modDnControl.setModDnType( modDnType );
               
                switch ( modDnType )
                {
                    case MOVE :
                        modDnControl.setNewSuperiorDn( in.readUTF() );
                        break;

                    case MOVE_AND_RENAME :
                        modDnControl.setNewSuperiorDn( in.readUTF() );
                        // Fallthrough

                    case RENAME :
                        modDnControl.setNewRdn( in.readUTF() );
                        modDnControl.setDeleteOldRdn( in.readBoolean() );
                        break;
                }
               
                // And create a ReplicaEventMessage
                replicaEventMessage = new ReplicaEventMessage( modDnControl, entry );
View Full Code Here

                    LOG.debug( "modifying entry with dn {}", remoteEntry.getDn().getName() );
                    modify( remoteEntry );
                    break;

                case MODDN:
                    SyncModifyDn adsModDnControl = ( SyncModifyDn ) syncResult.getControls().get( SyncModifyDn.OID );
                    //Apache Directory Server's special control
                    applyModDnOperation( adsModDnControl );
                    break;

                case DELETE:
View Full Code Here

                    //System.out.println( "C: MODIFY " + remoteEntry.getDn() );
                    modify( remoteEntry );
                    break;

                case MODDN:
                    SyncModifyDn adsModDnControl = ( SyncModifyDn ) syncResult.getControls().get( SyncModifyDn.OID );
                    //System.out.println( "C: MODDN " + adsModDnControl.getModDnType() + ", " + adsModDnControl.getEntryDn()
                    //    + ", " + adsModDnControl.getNewSuperiorDn() + ", " + adsModDnControl.getNewRdn() );
                    //Apache Directory Server's special control
                    applyModDnOperation( adsModDnControl );
                    break;
View Full Code Here

            {
                sendDeletedEntry( entry );
                return;
            }

            SyncModifyDn modDnControl =
                new SyncModifyDnDecorator( directoryService.getLdapCodecService(), SyncModifyDnType.MOVE );
            modDnControl.setEntryDn( moveContext.getDn().getNormName() );
            modDnControl.setNewSuperiorDn( moveContext.getNewSuperior().getNormName() );

            //System.out.println( "MOVE Listener : log " + moveContext.getDn() + " moved to " + moveContext.getNewSuperior() );
            consumerMsgLog.log( new ReplicaEventMessage( modDnControl, entry ) );
           
            if ( pushInRealTime )
View Full Code Here

                  'o','u','=','d','c'         //     newSuperiorDn LDAPDN
            } );
        bb.flip();

        SyncModifyDnDecorator decorator = new SyncModifyDnDecorator( codec );
        SyncModifyDn syncmodDnControl = (SyncModifyDn)decorator.decode( bb.array() );

        assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
        assertEquals( "ou=dc", syncmodDnControl.getNewSuperiorDn() );
        assertFalse( syncmodDnControl.isDeleteOldRdn() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ((SyncModifyDnDecorator)syncmodDnControl).encode( ByteBuffer.allocate( ((SyncModifyDnDecorator)syncmodDnControl).computeLength() ) );
View Full Code Here

            } );
        bb.flip();

        SyncModifyDnDecorator decorator = new SyncModifyDnDecorator( codec );
       
        SyncModifyDn syncmodDnControl = (SyncModifyDn)decorator.decode( bb.array() );

        assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
        assertEquals( "uid=j", syncmodDnControl.getNewRdn() );
        assertTrue( syncmodDnControl.isDeleteOldRdn() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ((SyncModifyDnDecorator)syncmodDnControl).encode( ByteBuffer.allocate( ((SyncModifyDnDecorator)syncmodDnControl).computeLength() ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.extras.controls.SyncModifyDn

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.