public class BulkItemResponse extends java.lang.Object implements Streamable, StatusToXContent
Modifier and Type | Class and Description |
---|---|
static class |
BulkItemResponse.Failure
Represents a failure.
|
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
BulkItemResponse(int id,
java.lang.String opType,
BulkItemResponse.Failure failure) |
BulkItemResponse(int id,
java.lang.String opType,
DocWriteResponse response) |
Modifier and Type | Method and Description |
---|---|
BulkItemResponse.Failure |
getFailure()
The actual failure object if there was a failure.
|
java.lang.String |
getFailureMessage()
The failure message, null if it did not fail.
|
java.lang.String |
getId()
The id of the action.
|
java.lang.String |
getIndex()
The index name of the action.
|
int |
getItemId()
The numeric order of the item matching the same request order in the bulk request.
|
java.lang.String |
getOpType()
The operation type ("index", "create" or "delete").
|
<T extends DocWriteResponse> |
getResponse()
The actual response (
IndexResponse or DeleteResponse ). |
java.lang.String |
getType()
The type of the action.
|
long |
getVersion()
The version of the action.
|
boolean |
isFailed()
Is this a failed execution of an operation.
|
static BulkItemResponse |
readBulkItem(StreamInput in) |
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
RestStatus |
status()
Returns the REST status to make sure it is returned correctly
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
public BulkItemResponse(int id, java.lang.String opType, DocWriteResponse response)
public BulkItemResponse(int id, java.lang.String opType, BulkItemResponse.Failure failure)
public RestStatus status()
StatusToXContent
status
in interface StatusToXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public int getItemId()
public java.lang.String getOpType()
public java.lang.String getIndex()
public java.lang.String getType()
public java.lang.String getId()
public long getVersion()
public <T extends DocWriteResponse> T getResponse()
IndexResponse
or DeleteResponse
). null in
case of failure.public boolean isFailed()
public java.lang.String getFailureMessage()
public BulkItemResponse.Failure getFailure()
public static BulkItemResponse readBulkItem(StreamInput in) throws java.io.IOException
java.io.IOException
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
java.io.IOException