Package org.elasticsearch.rest

Examples of org.elasticsearch.rest.BytesRestResponse


    public RestResponse buildResponse(T response, XContentBuilder builder) throws Exception {
        builder.startObject()
                .field(Fields.ACKNOWLEDGED, response.isAcknowledged());
        addCustomFields(builder, response);
        builder.endObject();
        return new BytesRestResponse(OK, builder);
    }
View Full Code Here


    public final RestResponse buildResponse(Response response, XContentBuilder builder) throws Exception {
        builder.startObject();
        response.toXContent(builder, channel.request());
        builder.endObject();
        return new BytesRestResponse(RestStatus.OK, builder);
    }
View Full Code Here

    public final RestResponse buildResponse(Response response, XContentBuilder builder) throws Exception {
        builder.startObject();
        response.toXContent(builder, channel.request());
        builder.endObject();
        return new BytesRestResponse(response.status(), builder);
    }
View Full Code Here

                        XContentBuilder builder = channel.newBuilder();
                        builder.startObject();
                        response.toXContent(builder, request);
                        builder.endObject();
                        channel.sendResponse(
                                new BytesRestResponse(
                                        response.getSearchResponse().status(),
                                        builder));
                    } catch (Exception e) {
                        logger.debug("Failed to emit response.", e);
                        onFailure(e);
View Full Code Here

    static void emitErrorResponse(RestChannel channel,
                                  RestRequest request,
                                  ESLogger logger,
                                  Throwable t) {
        try {
            channel.sendResponse(new BytesRestResponse(channel, t));
        } catch (IOException e) {
            logger.error("Failed to send failure response.", e);
        }
    }
View Full Code Here

                        XContentBuilder builder = channel.newBuilder();
                        builder.startObject();
                        response.toXContent(builder, request);
                        builder.endObject();
                        channel.sendResponse(
                                new BytesRestResponse(
                                        RestStatus.OK,
                                        builder));
                    } catch (Exception e) {
                        logger.debug("Failed to emit response.", e);
                        onFailure(e);
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.