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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
await()
RestResponse
capturedResponse()
java.util.concurrent.atomic.AtomicInteger
errors()
XContentBuilder
newBuilder()
XContentBuilder
newBuilder(XContentType requestContentType, boolean useFiltering)
protected BytesStreamOutput
newBytesOutput()
XContentBuilder
newErrorBuilder()
RestRequest
request()
java.util.concurrent.atomic.AtomicInteger
responses()
void
sendResponse(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:
newBuilder
in interfaceRestChannel
- Overrides:
newBuilder
in classAbstractRestChannel
- Throws:
java.io.IOException
-
newErrorBuilder
public XContentBuilder newErrorBuilder() throws java.io.IOException
- Specified by:
newErrorBuilder
in interfaceRestChannel
- Overrides:
newErrorBuilder
in classAbstractRestChannel
- Throws:
java.io.IOException
-
newBuilder
public XContentBuilder newBuilder(@Nullable XContentType requestContentType, boolean useFiltering) throws java.io.IOException
- Specified by:
newBuilder
in interfaceRestChannel
- Overrides:
newBuilder
in classAbstractRestChannel
- Throws:
java.io.IOException
-
newBytesOutput
protected BytesStreamOutput newBytesOutput()
- Overrides:
newBytesOutput
in classAbstractRestChannel
-
request
public RestRequest request()
- Specified by:
request
in interfaceRestChannel
- Overrides:
request
in 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()
-
-