Package javax.naming.ldap

Examples of javax.naming.ldap.PagedResultsResponseControl


            list.close();
   
            // Now read the next ones
            javax.naming.ldap.Control[] responseControls = ( ( LdapContext ) ctx ).getResponseControls();
   
            PagedResultsResponseControl responseControl =
                ( PagedResultsResponseControl ) responseControls[0];
            assertEquals( 0, responseControl.getResultSize() );
   
            // check if this is over
            byte[] cookie = responseControl.getCookie();
   
            if ( Strings.isEmpty( cookie ) )
            {
                // If so, exit the loop
                break;
            }
   
            // Prepare the next iteration, sending a bad cookie
            createNextSearchControls( ctx, responseControl.getCookie(), 4 - loop );
   
            assertEquals( expectedSize[loop - 1], results.size() );
        }
   
        assertEquals( 4, loop );
View Full Code Here


               System.out.println("====================>response control is not null");
               for (int i = 0; i < controls.length; i++)
               {
                  if (controls[i] instanceof PagedResultsResponseControl)
                  {
                     PagedResultsResponseControl prrc = (PagedResultsResponseControl)controls[i];
                     System.out.println("page result size: " + prrc.getResultSize());
                     System.out.println("cookie: " + prrc.getCookie());
                  }
                  else
                  {
                     // Handle other response controls (if any)
                  }
               }
            }
         }
      }

      Control[] controls = ctx.getResponseControls();
      if (controls != null)
      {
         System.out.println("====================>response control is not null");
         for (int i = 0; i < controls.length; i++)
         {
            if (controls[i] instanceof PagedResultsResponseControl)
            {
               PagedResultsResponseControl prrc = (PagedResultsResponseControl)controls[i];
               System.out.println("page result size: " + prrc.getResultSize());
               System.out.println("cookie: " + prrc.getCookie());
            }
            else
            {
               // Handle other response controls (if any)
            }
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() );
View Full Code Here

                    {
                        for ( Control jndiControl : jndiControls )
                        {
                            if ( jndiControl instanceof PagedResultsResponseControl )
                            {
                                PagedResultsResponseControl prrc = ( PagedResultsResponseControl ) jndiControl;
                                byte[] cookie = prrc.getCookie();
                                if ( cookie != null )
                                {
                                    // search again: pass the response cookie to the request control
                                    for ( StudioControl studioControl : parameter.getControls() )
                                    {
View Full Code Here

            {
                for (int i = 0; i < controls.length; i++)
                {
                    if (controls[i] instanceof PagedResultsResponseControl)
                    {
                        PagedResultsResponseControl prrc = (PagedResultsResponseControl)controls[i];
                        total = prrc.getResultSize();
                        cookie = prrc.getCookie();
                       
                        /* Update ldap context. In this moment, we inform server that it should
                         * send another page of results
                         *
                         * If cookie == null, there is no more results
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() );
View Full Code Here

        // This may be null if the server does not support paged results
        Control[] pagedControls = ctx.getResponseControls();
        if (controls != null && pagedControls != null) {
          for (int i = 0; i < pagedControls.length; i++) {
            if (pagedControls[i] instanceof PagedResultsResponseControl) {
              PagedResultsResponseControl prrc =
                  (PagedResultsResponseControl) pagedControls[i];
              cookie = prrc.getCookie();
            } else {
              // Handle other response controls (if any)
            }
          }
        }
View Full Code Here

TOP

Related Classes of javax.naming.ldap.PagedResultsResponseControl

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.