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

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


        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
       
        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = (SyncInfoValue)decorator.decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );
       
        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x07 );
View Full Code Here


        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
       
        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = (SyncInfoValue)decorator.decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );
       
        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );
           
            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
View Full Code Here

        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
       
        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = (SyncInfoValue)decorator.decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );
       
        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x0C );
View Full Code Here

        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( codec );
       
        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = (SyncInfoValue)decorator.decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );
       
        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );
           
            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
View Full Code Here

            LOG.debug( "............... inside handleSyncInfo ..............." );

            SyncInfoValueDecorator decorator = new SyncInfoValueDecorator( directoryService.getLdapCodecService() );
            byte[] syncinfo = syncInfoResp.getResponseValue();
            decorator.setValue( syncinfo );
            SyncInfoValue syncInfoValue = decorator.getDecorated();

            byte[] cookie = syncInfoValue.getCookie();

            if ( cookie != null )
            {
                LOG.debug( "setting the cookie from the sync info: " + Strings.utf8ToString(cookie) );
                syncCookie = cookie;
            }

            LOG.info( "refreshDeletes: " + syncInfoValue.isRefreshDeletes() );

            List<byte[]> uuidList = syncInfoValue.getSyncUUIDs();
            // if refreshDeletes set to true then delete all the entries with entryUUID
            // present in the syncIdSet
            if ( syncInfoValue.isRefreshDeletes() )
            {
                deleteEntries( uuidList, false );
            }
            else
            {
                deleteEntries( uuidList, true );
            }

            LOG.info( "refreshDone: " + syncInfoValue.isRefreshDone() );

            storeCookie();
        }
        catch ( Exception de )
        {
View Full Code Here

                0x31,
                0x00, //         syncUUIDs SET OF syncUUID
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x07 );
View Full Code Here

                0x03,
                0x03
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );

        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );

            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
View Full Code Here

                0x31,
                0x00, //         syncUUIDs SET OF syncUUID
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x0C );
View Full Code Here

                0x03,
                0x03
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );

        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );

            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
View Full Code Here

                0x01,
                0x01
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        try
        {
            ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );
            fail( "Should not be there" );
View Full Code Here

TOP

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

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.