Package org.elasticsearch.rest

Examples of org.elasticsearch.rest.BytesRestResponse


                restRequest, restChannel) {

              @Override
              protected void handleRiverResponse(NodeFullUpdateResponse nodeInfo) throws Exception {
                if (actionRequest.isSpaceKeyRequest() && !nodeInfo.spaceFound) {
                  restChannel.sendResponse(new BytesRestResponse(RestStatus.NOT_FOUND, buildMessageDocument(
                      restRequest, "Space '" + spaceKey + "' is not indexed by RemoteRiver with name: " + riverName)));
                } else {
                  restChannel.sendResponse(new BytesRestResponse(OK, buildMessageDocument(restRequest,
                      "Scheduled full reindex for Spaces: " + nodeInfo.reindexedSpaces)));
                }
              }

            });
View Full Code Here


            new JRMgmBaseActionListener<JRStateRequest, JRStateResponse, NodeJRStateResponse>(actionRequest,
                restRequest, restChannel) {

              @Override
              protected void handleRiverResponse(NodeJRStateResponse nodeInfo) throws Exception {
                restChannel.sendResponse(new BytesRestResponse(RestStatus.OK, XContentType.JSON.restContentType(),
                    nodeInfo.stateInformation.getBytes()));
              }

            });
  }
View Full Code Here

            new JRMgmBaseActionListener<JRLifecycleRequest, JRLifecycleResponse, NodeJRLifecycleResponse>(
                actionRequest, restRequest, restChannel) {

              @Override
              protected void handleRiverResponse(NodeJRLifecycleResponse nodeInfo) throws Exception {
                restChannel.sendResponse(new BytesRestResponse(OK, buildMessageDocument(restRequest,
                    "Command successful")));
              }

            });
  }
View Full Code Here

              XContentBuilder builder = restChannel.newBuilder();
              builder.startObject();
              builder.field("river_names", allRivers);
              builder.endObject();
              restChannel.sendResponse(new BytesRestResponse(RestStatus.OK, builder));
            } catch (Exception e) {
              onFailure(e);
            }
          }

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

  @Override
  public void onResponse(Response response) {
    try {
      NodeResponse nodeInfo = response.getSuccessNodeResponse();
      if (nodeInfo == null) {
        restChannel.sendResponse(new BytesRestResponse(RestStatus.NOT_FOUND, buildMessageDocument(restRequest,
            "No RemoteRiver found for name: " + actionRequest.getRiverName())));
      } else {
        handleRiverResponse(nodeInfo);
      }
    } catch (Exception e) {
View Full Code Here

  protected abstract void handleRiverResponse(NodeResponse nodeInfo) throws Exception;

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

            new JRMgmBaseActionListener<JRStateRequest, JRStateResponse, NodeJRStateResponse>(actionRequest,
                restRequest, restChannel) {

              @Override
              protected void handleJiraRiverResponse(NodeJRStateResponse nodeInfo) throws Exception {
                restChannel.sendResponse(new BytesRestResponse(RestStatus.OK, XContentType.JSON.restContentType(),
                    nodeInfo.stateInformation.getBytes()));
              }

            });
  }
View Full Code Here

              @Override
              protected void handleJiraRiverResponse(NodeFullUpdateResponse nodeInfo) throws Exception {
                if (actionRequest.isProjectKeyRequest() && !nodeInfo.projectFound) {
                  restChannel
                      .sendResponse(new BytesRestResponse(RestStatus.NOT_FOUND, buildMessageDocument(restRequest,
                          "Project '" + projectKey + "' is not indexed by JiraRiver with name: " + riverName)));
                } else {
                  restChannel.sendResponse(new BytesRestResponse(OK, buildMessageDocument(restRequest,
                      "Scheduled full reindex for JIRA projects: " + nodeInfo.reindexedProjectNames)));
                }
              }

            });
View Full Code Here

              XContentBuilder builder = restChannel.newBuilder();
              builder.startObject();
              builder.field("jira_river_names", allRivers);
              builder.endObject();
              restChannel.sendResponse(new BytesRestResponse(RestStatus.OK, builder));
            } catch (Exception e) {
              onFailure(e);
            }
          }

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

            new JRMgmBaseActionListener<JRLifecycleRequest, JRLifecycleResponse, NodeJRLifecycleResponse>(
                actionRequest, restRequest, restChannel) {

              @Override
              protected void handleJiraRiverResponse(NodeJRLifecycleResponse nodeInfo) throws Exception {
                restChannel.sendResponse(new BytesRestResponse(OK, buildMessageDocument(restRequest,
                    "Command successful")));
              }

            });
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.rest.BytesRestResponse

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.