Examples of XContentThrowableRestResponse


Examples of org.elasticsearch.rest.XContentThrowableRestResponse

  protected abstract void handleRiverResponse(NodeResponse nodeInfo) throws Exception;

  @Override
  public void onFailure(Throwable e) {
    try {
      restChannel.sendResponse(new XContentThrowableRestResponse(restRequest, e));
    } catch (IOException e1) {
      logger.error("Failed to send failure response", e1);
    }
  }
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

          }

          @Override
          public void onFailure(Throwable e) {
            try {
              restChannel.sendResponse(new XContentThrowableRestResponse(restRequest, e));
            } catch (IOException e1) {
              logger.error("Failed to send failure response", e1);
            }
          }
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

          }

          @Override
          public void onFailure(Throwable e) {
            try {
              restChannel.sendResponse(new XContentThrowableRestResponse(restRequest, e));
            } catch (IOException e1) {
              logger.error("Failed to send failure response", e1);
            }
          }
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

      @Override
      public void onFailure(Throwable e) {
        try {
          logger.error("Error processing executing search", e);
          channel.sendResponse(new XContentThrowableRestResponse(request, e));
        } catch (IOException e1) {
          logger.error("Failed to send failure response", e1);
        }
      }
    });
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

        }
      } catch (Exception e) {
        // some sort of error processing the xml input
        try {
          logger.error("Error processing xml input", e);
          channel.sendResponse(new XContentThrowableRestResponse(request, e));
        } catch (IOException e1) {
          logger.error("Failed to send error response", e1);
        }
      }
    } else if (handler.equals("javabin")) {
      // JavaBin Content
      try {
        // We will use the JavaBin codec from solrj
        // unmarshal the input to a SolrUpdate request
        JavaBinUpdateRequestCodec codec = new JavaBinUpdateRequestCodec();
        UpdateRequest req = codec.unmarshal(new ByteArrayInputStream(request.contentByteArray()), null);

        // Get the list of documents to index out of the UpdateRequest
        // Add each document to the bulk request
        // convert the SolrInputDocument into a map which will be used as the ES source field
        List<SolrInputDocument> docs = req.getDocuments();
        if (docs != null) {
          for (SolrInputDocument doc : docs) {
            bulkRequest.add(getIndexRequest(convertToMap(doc), request));
          }
        }

        // See if we have any documents to delete
        // if yes, add them to the bulk request
        if (req.getDeleteById() != null) {
          for (String id : req.getDeleteById()) {
            bulkRequest.add(getDeleteRequest(id, request));
          }
        }
      } catch (Exception e) {
        // some sort of error processing the javabin input
        try {
          logger.error("Error processing javabin input", e);
          channel.sendResponse(new XContentThrowableRestResponse(request, e));
        } catch (IOException e1) {
          logger.error("Failed to send error response", e1);
        }
      }
    }
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

  protected abstract void handleJiraRiverResponse(NodeResponse nodeInfo) throws Exception;

  @Override
  public void onFailure(Throwable e) {
    try {
      restChannel.sendResponse(new XContentThrowableRestResponse(restRequest, e));
    } catch (IOException e1) {
      logger.error("Failed to send failure response", e1);
    }
  }
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

  protected abstract void handleRiverResponse(NodeResponse nodeInfo) throws Exception;

  @Override
  public void onFailure(Throwable e) {
    try {
      restChannel.sendResponse(new XContentThrowableRestResponse(restRequest, e));
    } catch (IOException e1) {
      logger.error("Failed to send failure response", e1);
    }
  }
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

                }
            }

            public void onFailure(Throwable e) {
                try {
                    channel.sendResponse(new XContentThrowableRestResponse(request, e));
                } catch (IOException e1) {
                    logger.error("Failed to send failure response", e1);
                }
            }
        });
View Full Code Here

Examples of org.elasticsearch.rest.XContentThrowableRestResponse

                    }

                    public void onFailure(Throwable e) {
                        try {
                            channel.sendResponse(
                                    new XContentThrowableRestResponse(request,
                                            e));
                        } catch (IOException e1) {
                            logger.error("Failed to send failure response",
                                    e1);
                        }
View Full Code Here

Examples of org.elasticsearch.river.mongodb.rest.XContentThrowableRestResponse

        }
    }

    private void errorResponse(RestRequest request, RestChannel channel, Throwable e) {
        try {
            channel.sendResponse(new XContentThrowableRestResponse(request, e));
            logger.error("errorResponse", e);
        } catch (IOException ioEx) {
            logger.error("Failed to send failure response", ioEx);
        }
    }
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.