Package org.elasticsearch.test.rest
Class FakeRestChannel
- java.lang.Object
-
- org.elasticsearch.rest.AbstractRestChannel
-
- org.elasticsearch.test.rest.FakeRestChannel
-
- All Implemented Interfaces:
RestChannel
public final class FakeRestChannel extends AbstractRestChannel
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.rest.AbstractRestChannel
detailedErrorsEnabled, request
-
-
Constructor Summary
Constructors Constructor Description FakeRestChannel(RestRequest request, boolean detailedErrorsEnabled, int responseCount)
-
Method Summary
Modifier and Type Method Description booleanawait()RestResponsecapturedResponse()java.util.concurrent.atomic.AtomicIntegererrors()XContentBuildernewBuilder()XContentBuildernewBuilder(XContentType requestContentType, boolean useFiltering)protected BytesStreamOutputnewBytesOutput()XContentBuildernewErrorBuilder()RestRequestrequest()java.util.concurrent.atomic.AtomicIntegerresponses()voidsendResponse(RestResponse response)-
Methods inherited from class org.elasticsearch.rest.AbstractRestChannel
bytesOutput, bytesOutputOrNull, detailedErrorsEnabled
-
-
-
-
Constructor Detail
-
FakeRestChannel
public FakeRestChannel(RestRequest request, boolean detailedErrorsEnabled, int responseCount)
-
-
Method Detail
-
newBuilder
public XContentBuilder newBuilder() throws java.io.IOException
- Specified by:
newBuilderin interfaceRestChannel- Overrides:
newBuilderin classAbstractRestChannel- Throws:
java.io.IOException
-
newErrorBuilder
public XContentBuilder newErrorBuilder() throws java.io.IOException
- Specified by:
newErrorBuilderin interfaceRestChannel- Overrides:
newErrorBuilderin classAbstractRestChannel- Throws:
java.io.IOException
-
newBuilder
public XContentBuilder newBuilder(@Nullable XContentType requestContentType, boolean useFiltering) throws java.io.IOException
- Specified by:
newBuilderin interfaceRestChannel- Overrides:
newBuilderin classAbstractRestChannel- Throws:
java.io.IOException
-
newBytesOutput
protected BytesStreamOutput newBytesOutput()
- Overrides:
newBytesOutputin classAbstractRestChannel
-
request
public RestRequest request()
- Specified by:
requestin interfaceRestChannel- Overrides:
requestin classAbstractRestChannel
-
sendResponse
public void sendResponse(RestResponse response)
-
capturedResponse
public RestResponse capturedResponse()
-
await
public boolean await() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
responses
public java.util.concurrent.atomic.AtomicInteger responses()
-
errors
public java.util.concurrent.atomic.AtomicInteger errors()
-
-