Examples of process()


Examples of org.apache.sling.replication.queue.ReplicationQueueProcessor.process()

public class ReplicationAgentJobConsumerTest {

    @Test
    public void testJobWithSuccessfulAgent() throws Exception {
        ReplicationQueueProcessor queueProcessor = mock(ReplicationQueueProcessor.class);
        when(queueProcessor.process(anyString(), any(ReplicationQueueItem.class))).thenReturn(true);

        ReplicationAgentJobConsumer replicationAgentJobConsumer = new ReplicationAgentJobConsumer(queueProcessor);
        Job job = mock(Job.class);
        JobConsumer.JobResult jobResult = replicationAgentJobConsumer.process(job);
        assertEquals(JobConsumer.JobResult.OK, jobResult);
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrRequest.process()

  /**
   * Return the number of documents currently indexed.
   */
  public int getNumberOfDocuments() throws SolrServerException, IOException {
    final SolrRequest request = new FastLukeRequest();
    final LukeResponse response = (LukeResponse) request.process(this.getServer());
    return response.getNumDocs();
  }

  public String[] search(final SolrQuery query, final String retrievedField)
  throws SolrServerException, IOException {
View Full Code Here

Examples of org.apache.solr.client.solrj.request.ContentStreamUpdateRequest.process()

                    String paramName = entry.getKey().substring(SolrConstants.PARAM.length());
                    updateRequest.setParam(paramName, entry.getValue().toString());
                }
            }

            updateRequest.process(solrServer);

        } else if (body instanceof SolrInputDocument) {

            UpdateRequest updateRequest = new UpdateRequest(getRequestHandler());
            updateRequest.add((SolrInputDocument) body);
View Full Code Here

Examples of org.apache.solr.client.solrj.request.DirectXmlRequest.process()

              Reader reader = new InputStreamReader(
                  new FileInputStream(xmlFile), "UTF-8");
              String body = IOUtils.toString(reader);
              SolrRequest request = new DirectXmlRequest("/update", body);
              /** Post the document to the Index */
              request.process(server);
              IOUtils.closeQuietly(reader);
            }
            // Commit the changes
            server.commit();
          } catch (Exception ex) {
View Full Code Here

Examples of org.apache.solr.client.solrj.request.LukeRequest.process()

  private Map<String, FieldInfo> getFieldInfos() throws SolrServerException,
  IOException {
    if (fieldInfos == null) {
      final LukeRequest request = new FastLukeRequest();
      request.setShowSchema(true);
      final LukeResponse response = request.process(this.getServer());
      fieldInfos = response.getFieldInfo();
    }
    return fieldInfos;
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.request.QueryRequest.process()

    // Now Make sure AAA is in 0 and BBB in 1
    SolrQuery q = new SolrQuery();
    QueryRequest r = new QueryRequest(q);
    q.setQuery("id:AAA");
    assertEquals(1, r.process(getSolrCore0()).getResults().size());
    assertEquals(0, r.process(getSolrCore1()).getResults().size());

    assertEquals(1,
        getSolrCore0().query(new SolrQuery("id:AAA")).getResults().size());
    assertEquals(0,
View Full Code Here

Examples of org.apache.solr.client.solrj.request.SolrPing.process()

    server.ping();
   
    try {
      SolrPing ping = new SolrPing();
      ping.getParams().set( "qt", "unknown handler! ignore_exception" );
      ping.process( server );
      fail( "sent unknown query type!" );
    }
    catch( Exception ex ) {
      // expected
    }
View Full Code Here

Examples of org.apache.solr.client.solrj.request.UpdateRequest.process()

        } else if (body instanceof SolrInputDocument) {

            UpdateRequest updateRequest = new UpdateRequest(getRequestHandler());
            updateRequest.add((SolrInputDocument) body);

            updateRequest.process(solrServer);

        } else {

            boolean hasSolrHeaders = false;
            for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
View Full Code Here

Examples of org.apache.solr.handler.component.QueryComponent.process()

        checkResponse.req = new LocalSolrQueryRequest(ultimateResponse.req.getCore(), params);
        checkResponse.rsp = new SolrQueryResponse();

        try {
          queryComponent.prepare(checkResponse);
          queryComponent.process(checkResponse);
          hits = (Integer) checkResponse.rsp.getToLog().get("hits");
        } catch (Exception e) {
          LOG.warn("Exception trying to re-query to check if a spell check possibility would return any hits.", e);
        } finally {
          checkResponse.req.close()
View Full Code Here

Examples of org.apache.stanbol.commons.solr.utils.StreamQueryRequest.process()

        QueryResponse response;
        try {
            response = AccessController.doPrivileged(new PrivilegedExceptionAction<QueryResponse>() {
                public QueryResponse run() throws IOException, SolrServerException {
                    StreamQueryRequest request = new StreamQueryRequest(query);
                     return request.process(server);
                }
            });
        } catch (PrivilegedActionException pae) {
            Exception e = pae.getException();
            if(e instanceof SolrServerException){
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.