org.elasticsearch.action.bulk
Class BulkItemResponse

java.lang.Object
  extended by org.elasticsearch.action.bulk.BulkItemResponse
All Implemented Interfaces:
Streamable

public class BulkItemResponse
extends java.lang.Object
implements Streamable

Represents a single item response for an action executed as part of the bulk API. Holds the index/type/id of the relevant action, and if it has failed or not (with the failure message incase it failed).


Nested Class Summary
static class BulkItemResponse.Failure
          Represents a failure.
 
Constructor Summary
BulkItemResponse(int id, java.lang.String opType, ActionResponse response)
           
BulkItemResponse(int id, java.lang.String opType, BulkItemResponse.Failure failure)
           
 
Method Summary
 boolean failed()
          Is this a failed execution of an operation.
 BulkItemResponse.Failure failure()
          The actual failure object if there was a failure.
 java.lang.String failureMessage()
          The failure message, null if it did not fail.
 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.
 java.lang.String getType()
          The type of the action.
 java.lang.String id()
          The id of the action.
 java.lang.String index()
          The index name of the action.
 boolean isFailed()
          Is this a failed execution of an operation.
 int itemId()
          The numeric order of the item matching the same request order in the bulk request.
 java.lang.String opType()
          The operation type ("index", "create" or "delete").
static BulkItemResponse readBulkItem(StreamInput in)
           
 void readFrom(StreamInput in)
           
 ActionResponse response()
          The actual response (IndexResponse or DeleteResponse).
 java.lang.String type()
          The type of the action.
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulkItemResponse

public BulkItemResponse(int id,
                        java.lang.String opType,
                        ActionResponse response)

BulkItemResponse

public BulkItemResponse(int id,
                        java.lang.String opType,
                        BulkItemResponse.Failure failure)
Method Detail

itemId

public int itemId()
The numeric order of the item matching the same request order in the bulk request.


opType

public java.lang.String opType()
The operation type ("index", "create" or "delete").


index

public java.lang.String index()
The index name of the action.


getIndex

public java.lang.String getIndex()
The index name of the action.


type

public java.lang.String type()
The type of the action.


getType

public java.lang.String getType()
The type of the action.


id

public java.lang.String id()
The id of the action.


getId

public java.lang.String getId()
The id of the action.


response

public ActionResponse response()
The actual response (IndexResponse or DeleteResponse). null in case of failure.


failed

public boolean failed()
Is this a failed execution of an operation.


isFailed

public boolean isFailed()
Is this a failed execution of an operation.


failureMessage

public java.lang.String failureMessage()
The failure message, null if it did not fail.


getFailureMessage

public java.lang.String getFailureMessage()
The failure message, null if it did not fail.


failure

public BulkItemResponse.Failure failure()
The actual failure object if there was a failure.


getFailure

public BulkItemResponse.Failure getFailure()
The actual failure object if there was a failure.


readBulkItem

public static BulkItemResponse readBulkItem(StreamInput in)
                                     throws java.io.IOException
Throws:
java.io.IOException

readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Throws:
java.io.IOException