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

Examples of org.apache.directory.shared.ldap.model.message.SearchResultEntry


        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        SearchResultEntry searchResultEntry = ldapMessageContainer.getMessage();

        assertEquals( 1, searchResultEntry.getMessageId() );
        assertEquals( "ou=contacts,dc=iktek,dc=com", searchResultEntry.getObjectName().toString() );

        Entry entry = searchResultEntry.getEntry();

        assertEquals( 1, entry.size() );

        for ( int i = 0; i < entry.size(); i++ )
        {
            EntryAttribute attribute = entry.get( "objectclass" );

            assertEquals( "objectClass".toLowerCase(), attribute.getId().toLowerCase() );

            assertTrue( attribute.contains( "" ) );
        }

        // Check the Control
        Map<String, Control> controls = searchResultEntry.getControls();

        assertEquals( 1, controls.size() );

        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
        assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
View Full Code Here


            return respRef;
        }
        else
        {
            // The entry is not a referral, or the ManageDsaIt control is set
            SearchResultEntry respEntry;
            respEntry = new SearchResultEntryImpl( req.getMessageId() );
            respEntry.setEntry( entry );
            respEntry.setObjectName( entry.getDn() );

            return respEntry;
        }
    }
View Full Code Here

       
        while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled() && !disconnected )
        {
            if ( resp instanceof SearchResultEntry )
            {
                SearchResultEntry result = ( SearchResultEntry ) resp;
                //System.out.println( "++++++++++++>  Consumer has received : " + result.getEntry().getDn() );

                handleSearchResult( result );
            }
            else if ( resp instanceof SearchResultReference )
View Full Code Here


    public Response get() throws Exception
    {
        Entry entry = ( ClonedServerEntry ) wrapped.get();
        SearchResultEntry se = new SearchResultEntryImpl( messageId );
        se.setEntry( entry );

        return se;
    }
View Full Code Here

            // We send the added entry directly to the consumer if it's connected
            if ( pushInRealTime )
            {
                // Construct a new SearchResultEntry
                SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                resultEntry.setObjectName( entry.getDn() );
                resultEntry.setEntry( entry );

                // Create the control which will be added to the response.
                SyncStateValue syncAdd = createControl( directoryService, SyncStateTypeEnum.ADD, entry );
               
                sendResult( resultEntry, entry, EventType.ADD, syncAdd, null );
View Full Code Here

            //System.out.println( "DELETE Listener : log " + entry.getDn() );
            consumerMsgLog.log( new ReplicaEventMessage( ChangeType.DELETE, entry ) );
           
            if ( pushInRealTime )
            {
                SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                resultEntry.setObjectName( entry.getDn() );
                resultEntry.setEntry( entry );

                SyncStateValue syncDelete = createControl( directoryService, SyncStateTypeEnum.DELETE, entry );

                sendResult( resultEntry, entry, EventType.DELETE, syncDelete, null );
            }
View Full Code Here

            consumerMsgLog.log( new ReplicaEventMessage( ChangeType.MODIFY, alteredEntry ) );
           
            if ( pushInRealTime )
            {

                SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                resultEntry.setObjectName( modifyContext.getDn() );
                resultEntry.setEntry( alteredEntry );

                SyncStateValue syncModify = createControl( directoryService, SyncStateTypeEnum.MODIFY, alteredEntry );

                sendResult( resultEntry, alteredEntry, EventType.MODIFY, syncModify, null );
            }
View Full Code Here

            //System.out.println( "MOVE Listener : log " + moveContext.getDn() + " moved to " + moveContext.getNewSuperior() );
            consumerMsgLog.log( new ReplicaEventMessage( modDnControl, entry ) );
           
            if ( pushInRealTime )
            {
                SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                resultEntry.setObjectName( moveContext.getDn() );
                resultEntry.setEntry( entry );
                resultEntry.addControl( modDnControl );

                SyncStateValue syncModify = createControl( directoryService, SyncStateTypeEnum.MODDN, entry );

                sendResult( resultEntry, entry, null, syncModify, modDnControl );
            }
View Full Code Here

            //    " moved to " + moveAndRenameContext.getNewSuperiorDn() + " renamed to " + moveAndRenameContext.getNewRdn() );
            consumerMsgLog.log( new ReplicaEventMessage( modDnControl, entry ) );
           
            if ( pushInRealTime )
            {
                SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                resultEntry.setObjectName( entry.getDn() );
                resultEntry.setEntry( entry );
                resultEntry.addControl( modDnControl );

                SyncStateValue syncModify = createControl( directoryService, SyncStateTypeEnum.MODDN, entry );

                sendResult( resultEntry, entry, null, syncModify, modDnControl );
            }
View Full Code Here

            //System.out.println( "RENAME Listener : log " + renameContext.getDn() + " renamed to " + renameContext.getNewRdn() );
            consumerMsgLog.log( new ReplicaEventMessage( modDnControl, entry ) );
           
            if ( pushInRealTime )
            {
                SearchResultEntry resultEntry = new SearchResultEntryImpl( searchRequest.getMessageId() );
                resultEntry.setObjectName( entry.getDn() );
                resultEntry.setEntry( entry );
                resultEntry.addControl( modDnControl );

                SyncStateValue syncModify = createControl( directoryService, SyncStateTypeEnum.MODDN, entry );
               
                // In this case, the cookie is different
                syncModify.setCookie( getCookie( entry ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.message.SearchResultEntry

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.