Examples of SearchResponse


Examples of org.apache.directory.shared.dsmlv2.reponse.SearchResponse

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        SearchResponse searchResponse = ( SearchResponse )
            parser.getBatchResponse().getCurrentResponse().getDecorated();

        assertEquals( 2, searchResponse.getSearchResultEntryList().size() );

        assertNotNull( searchResponse.getSearchResultDone() );
    }
View Full Code Here

Examples of org.apache.directory.shared.dsmlv2.reponse.SearchResponse

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        SearchResponse searchResponse = ( SearchResponse )
            parser.getBatchResponse().getCurrentResponse().getDecorated();

        assertEquals( 2, searchResponse.getSearchResultReferenceList().size() );

        assertNotNull( searchResponse.getSearchResultDone() );
    }
View Full Code Here

Examples of org.apache.directory.shared.dsmlv2.reponse.SearchResponse

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse().getDecorated();

        assertEquals( 2, searchResponse.getSearchResultEntryList().size() );

        assertEquals( 2, searchResponse.getSearchResultReferenceList().size() );

        assertNotNull( searchResponse.getSearchResultDone() );
    }
View Full Code Here

Examples of org.apache.directory.shared.dsmlv2.reponse.SearchResponse

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        SearchResponse searchResponse = ( SearchResponse )
            parser.getBatchResponse().getCurrentResponse().getDecorated();
        SearchResultEntry searchResultEntry =
            searchResponse.getCurrentSearchResultEntry();
        Map<String, Control> controls =
            searchResponse.getCurrentSearchResultEntry().getControls();

        assertEquals( 1, searchResultEntry.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.643" );
View Full Code Here

Examples of org.apache.directory.shared.dsmlv2.reponse.SearchResponse

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        SearchResponse searchResponse = ( SearchResponse )
            parser.getBatchResponse().getCurrentResponse().getDecorated();
        SearchResultEntry searchResultEntry =
            searchResponse.getCurrentSearchResultEntry();
        Map<String, Control> controls = searchResultEntry.getControls();

        assertEquals( 1, searchResultEntry.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.643" );
View Full Code Here

Examples of org.apache.directory.shared.dsmlv2.reponse.SearchResponse

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        SearchResponse searchResponse = ( SearchResponse )
            parser.getBatchResponse().getCurrentResponse().getDecorated();
        SearchResultEntry searchResultEntry =
            searchResponse.getCurrentSearchResultEntry();
        Map<String, Control> controls = searchResultEntry.getControls();

        assertEquals( 2, searchResultEntry.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.789" );
View Full Code Here

Examples of org.apache.directory.studio.dsmlv2.reponse.SearchResponse

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        SearchResponse searchResponse = ( SearchResponse ) parser.getBatchResponse().getCurrentResponse();

        assertEquals( 456, searchResponse.getMessageId() );
    }
View Full Code Here

Examples of org.apache.james.imap.message.response.SearchResponse

            }
            final long[] ids = toArray(results);

            final ImapResponseMessage response;
            if (resultOptions == null || resultOptions.isEmpty()) {
                response = new SearchResponse(ids, highestModSeq);
            } else {
                IdRange[] idRanges;
                List<Long> idList = new ArrayList<Long>(ids.length);
                for ( int i = 0; i < ids.length; i++) {
                    idList.add(ids[i]);
                }
                List<MessageRange> ranges = MessageRange.toRanges(idList);
                idRanges = new IdRange[ranges.size()];
                for (int i = 0 ; i <ranges.size(); i++) {
                    MessageRange range = ranges.get(i);
                    idRanges[i] = new IdRange(range.getUidFrom(), range.getUidTo());
                }
               
                boolean esearch = false;
                for (int i = 0; i < resultOptions.size(); i++) {
                    if (SearchResultOption.SAVE != resultOptions.get(i)) {
                        esearch = true;
                        break;
                    }
                }
               
                if (esearch) {
                    long min = -1;
                    long max = -1;
                    long count = ids.length;

                    if (ids.length > 0) {
                        min = ids[0];
                        max = ids[ids.length -1];
                    }
                  
                   
                    // Save the sequence-set for later usage. This is part of SEARCHRES
                    if (resultOptions.contains(SearchResultOption.SAVE)) {
                        if (resultOptions.contains(SearchResultOption.ALL) || resultOptions.contains(SearchResultOption.COUNT)) {
                            // if the options contain ALL or COUNT we need to save the complete sequence-set
                            SearchResUtil.saveSequenceSet(session, idRanges);
                        } else {
                            List<IdRange> savedRanges = new ArrayList<IdRange>();
                            if (resultOptions.contains(SearchResultOption.MIN)) {
                                // Store the MIN
                                savedRanges.add(new IdRange(min))
                            }
                            if (resultOptions.contains(SearchResultOption.MAX)) {
                                // Store the MAX
                                savedRanges.add(new IdRange(max));
                            }
                            SearchResUtil.saveSequenceSet(session, savedRanges.toArray(new IdRange[0]));
                        }
                    }
                    response = new ESearchResponse(min, max, count, idRanges, highestModSeq, tag, useUids, resultOptions);
                } else {
                    // Just save the returned sequence-set as this is not SEARCHRES + ESEARCH
                    SearchResUtil.saveSequenceSet(session, idRanges);
                    response = new SearchResponse(ids, highestModSeq);

                }
            }

            responder.respond(response);
View Full Code Here

Examples of org.apache.juddi.portlets.client.service.SearchResponse

  }

  public SearchResponse queryJUDDI(String query) {
    HttpServletRequest request = this.getThreadLocalRequest();
    HttpSession session = request.getSession();
    SearchResponse response = new SearchResponse();
     try {
       Transport transport = WebHelper.getTransport(session.getServletContext());
       UDDIInquiryPortType inquiryService = transport.getUDDIInquiryService();
       org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService uis =
         new org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService();
            String reply = uis.inquire(inquiryService, query);
            response.setMessage(reply);
            response.setSuccess(true);         
       } catch (Exception e) {
         logger.error("Could not obtain token. " + e.getMessage(), e);
         response.setSuccess(false);
         response.setMessage(e.getMessage());
         response.setErrorCode("102");
       catch (Throwable t) {
         logger.error("Could not obtain token. " + t.getMessage(), t);
         response.setSuccess(false);
         response.setMessage(t.getMessage());
         response.setErrorCode("102");
       }
     return response;
  }
View Full Code Here

Examples of org.elasticsearch.action.search.SearchResponse

        srb.addField("_id");
        srb.addField("timestamp");
        srb.addField("_source");

        final SearchRequest request = srb.request();
        final SearchResponse response = client.search(request).actionGet();

        if (! commandLineOptions.isFix()) {
            LOG.warn("Not executing update because '-F' command line flag not given!");
        }

        while (true) {
            final SearchResponse r = client.prepareSearchScroll(response.getScrollId()).setScroll(TimeValue.timeValueMinutes(1)).execute().actionGet();

            if (r.getHits().getHits().length == 0) {
                LOG.debug("No more hits, done!");
                break;
            }

            final BulkRequestBuilder bulk = client.prepareBulk();

            for (SearchHit hit : r.getHits()) {
                processedCount++;
                try {
                    if (handleHit(hit, bulk)) {
                        changedCount++;
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.