Package org.apache.directory.studio.connection.core

Examples of org.apache.directory.studio.connection.core.StudioPagedResultsControl


                        parent.addChild( entry );
                    }
                    scs = null;
                }

                StudioPagedResultsControl sprRequestControl = null;
                StudioPagedResultsControl sprResponseControl = null;
                for ( StudioControl responseControl : search.getResponseControls() )
                {
                    if ( responseControl instanceof StudioPagedResultsControl )
                    {
                        sprResponseControl = ( StudioPagedResultsControl ) responseControl;
                    }
                }
                for ( StudioControl requestControl : search.getControls() )
                {
                    if ( requestControl instanceof StudioPagedResultsControl )
                    {
                        sprRequestControl = ( StudioPagedResultsControl ) requestControl;
                    }
                }

                if ( sprRequestControl != null && sprResponseControl != null )
                {
                    if ( sprRequestControl.isScrollMode() )
                    {
                        if ( sprRequestControl.getCookie() != null )
                        {
                            // create top page search runnable, same as original search
                            InitializeChildrenRunnable topPageChildrenRunnable = new InitializeChildrenRunnable(
                                parent, null );
                            parent.setTopPageChildrenRunnable( topPageChildrenRunnable );
                        }

                        if ( sprResponseControl.getCookie() != null )
                        {
                            StudioPagedResultsControl newSprc = new StudioPagedResultsControl( sprRequestControl
                                .getSize(), sprResponseControl.getCookie(), sprRequestControl.isCritical(),
                                sprRequestControl.isScrollMode() );
                            InitializeChildrenRunnable nextPageChildrenRunnable = new InitializeChildrenRunnable(
                                parent, newSprc );
                            parent.setNextPageChildrenRunnable( nextPageChildrenRunnable );
View Full Code Here


                                // search again: pass the response cookie to the request control
                                for ( StudioControl studioControl : parameter.getControls() )
                                {
                                    if ( studioControl instanceof StudioPagedResultsControl )
                                    {
                                        StudioPagedResultsControl sprc = ( StudioPagedResultsControl ) studioControl;
                                        sprc.setCookie( cookie );
                                    }
                                }
                                enumeration = SearchRunnable.search( browserConnection, parameter, monitor );
                                return enumeration != null && enumeration.hasMore();
                            }
View Full Code Here

                    }

                    // check response controls
                    ISearch clonedSearch = ( ISearch ) searchToPerform.clone();
                    clonedSearch.getResponseControls().clear();
                    StudioPagedResultsControl sprResponseControl = null;
                    StudioPagedResultsControl sprRequestControl = null;
                    for ( StudioControl responseControl : searchToPerform.getResponseControls() )
                    {
                        if ( responseControl instanceof StudioPagedResultsControl )
                        {
                            sprResponseControl = ( StudioPagedResultsControl ) responseControl;
                        }
                    }
                    for ( Iterator<StudioControl> it = clonedSearch.getControls().iterator(); it.hasNext(); )
                    {
                        StudioControl requestControl = it.next();
                        if ( requestControl instanceof StudioPagedResultsControl )
                        {
                            sprRequestControl = ( StudioPagedResultsControl ) requestControl;
                            it.remove();
                        }
                    }
                    searchToPerform = null;

                    // paged search
                    if ( sprResponseControl != null && sprRequestControl != null )
                    {
                        StudioPagedResultsControl nextSpsc = new StudioPagedResultsControl(
                            sprRequestControl.getSize(), sprResponseControl.getCookie(),
                            sprRequestControl.isCritical(), sprRequestControl.isScrollMode() );
                        ISearch nextPageSearch = ( ISearch ) clonedSearch.clone();
                        nextPageSearch.getResponseControls().clear();
                        nextPageSearch.getControls().add( nextSpsc );
View Full Code Here

                            for ( Control jndiControl : jndiControls )
                            {
                                if ( jndiControl instanceof PagedResultsResponseControl )
                                {
                                    PagedResultsResponseControl prrc = ( PagedResultsResponseControl ) jndiControl;
                                    StudioPagedResultsControl studioControl = new StudioPagedResultsControl(
                                        prrc.getResultSize(), prrc.getCookie(), prrc.isCritical(), false );
                                    search.getResponseControls().add( studioControl );

                                    search.setCountLimitExceeded( prrc.getCookie() != null );
                                }
                                else
                                {
                                    StudioControl studioControl = new StudioControl();
                                    studioControl.setOid( jndiControl.getID() );
                                    studioControl.setCritical( jndiControl.isCritical() );
                                    studioControl.setControlValue( jndiControl.getEncodedValue() );
                                    search.getResponseControls().add( studioControl );
                                }
                            }
                        }
                    }
View Full Code Here

                    }

                    // check response controls
                    ISearch clonedSearch = ( ISearch ) searchToPerform.clone();
                    clonedSearch.getResponseControls().clear();
                    StudioPagedResultsControl sprResponseControl = null;
                    StudioPagedResultsControl sprRequestControl = null;
                    for ( StudioControl responseControl : searchToPerform.getResponseControls() )
                    {
                        if ( responseControl instanceof StudioPagedResultsControl )
                        {
                            sprResponseControl = ( StudioPagedResultsControl ) responseControl;
                        }
                    }
                    for ( Iterator<StudioControl> it = clonedSearch.getControls().iterator(); it.hasNext(); )
                    {
                        StudioControl requestControl = it.next();
                        if ( requestControl instanceof StudioPagedResultsControl )
                        {
                            sprRequestControl = ( StudioPagedResultsControl ) requestControl;
                            it.remove();
                        }
                    }
                    searchToPerform = null;

                    // paged search
                    if ( sprResponseControl != null && sprRequestControl != null )
                    {
                        StudioPagedResultsControl nextSpsc = new StudioPagedResultsControl(
                            sprRequestControl.getSize(), sprResponseControl.getCookie(),
                            sprRequestControl.isCritical(), sprRequestControl.isScrollMode() );
                        ISearch nextPageSearch = ( ISearch ) clonedSearch.clone();
                        nextPageSearch.getResponseControls().clear();
                        nextPageSearch.getControls().add( nextSpsc );
View Full Code Here

                            for ( Control jndiControl : jndiControls )
                            {
                                if ( jndiControl instanceof PagedResultsResponseControl )
                                {
                                    PagedResultsResponseControl prrc = ( PagedResultsResponseControl ) jndiControl;
                                    StudioPagedResultsControl studioControl = new StudioPagedResultsControl(
                                        prrc.getResultSize(), prrc.getCookie(), prrc.isCritical(), false );
                                    search.getResponseControls().add( studioControl );

                                    search.setCountLimitExceeded( prrc.getCookie() != null );
                                }
                                else
                                {
                                    StudioControl studioControl = new StudioControl();
                                    studioControl.setOid( jndiControl.getID() );
                                    studioControl.setCritical( jndiControl.isCritical() );
                                    studioControl.setControlValue( jndiControl.getEncodedValue() );
                                    search.getResponseControls().add( studioControl );
                                }
                            }
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.connection.core.StudioPagedResultsControl

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.