public abstract class DocWriteResponse extends ReplicationResponse implements WriteResponse, StatusToXContentObject
| Modifier and Type | Class and Description |
|---|---|
static class |
DocWriteResponse.Result
An enum that represents the the results of CRUD operations, primarily used to communicate the type of
operation that occurred.
|
ReplicationResponse.ShardInfoTransportResponse.EmptyToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
protected DocWriteResponse.Result |
result |
EMPTYEMPTY_PARAMS| Modifier | Constructor and Description |
|---|---|
protected |
DocWriteResponse() |
|
DocWriteResponse(ShardId shardId,
java.lang.String type,
java.lang.String id,
long version,
DocWriteResponse.Result result) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
declareParserFields(ConstructingObjectParser<? extends DocWriteResponse,java.lang.Void> objParser)
Declare the
ObjectParser fields to use when parsing a DocWriteResponse |
boolean |
forcedRefresh()
Did this request force a refresh? Requests that set
WriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE will always return true for this. |
java.lang.String |
getId()
The id of the document changed.
|
java.lang.String |
getIndex()
The index the document was changed in.
|
java.lang.String |
getLocation(java.lang.String routing)
Return the relative URI for the location of the document suitable for use in the
Location header. |
DocWriteResponse.Result |
getResult()
The change that occurred to the document.
|
ShardId |
getShardId()
The exact shard the document was changed in.
|
java.lang.String |
getType()
The type of the document changed.
|
long |
getVersion()
Returns the current version of the doc.
|
XContentBuilder |
innerToXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
void |
setForcedRefresh(boolean forcedRefresh)
Mark the response as having forced a refresh? Requests that set
WriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE should always mark this as true. |
RestStatus |
status()
returns the rest status for this response (based on
ShardInfo#status() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
getShardInfo, setShardInforemoteAddress, remoteAddressclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisFragmentprotected DocWriteResponse.Result result
public DocWriteResponse(ShardId shardId, java.lang.String type, java.lang.String id, long version, DocWriteResponse.Result result)
protected DocWriteResponse()
public DocWriteResponse.Result getResult()
public java.lang.String getIndex()
public ShardId getShardId()
public java.lang.String getType()
public java.lang.String getId()
public long getVersion()
public boolean forcedRefresh()
WriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE will always return true for this. Requests that set it to WriteRequest.RefreshPolicy.WAIT_UNTIL will
only return true here if they run out of refresh listener slots (see IndexSettings.MAX_REFRESH_LISTENERS_PER_SHARD).public void setForcedRefresh(boolean forcedRefresh)
WriteResponseWriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE should always mark this as true. Requests that set it to WriteRequest.RefreshPolicy.WAIT_UNTIL will only
set this to true if they run out of refresh listener slots (see IndexSettings.MAX_REFRESH_LISTENERS_PER_SHARD).setForcedRefresh in interface WriteResponsepublic RestStatus status()
ShardInfo#status()status in interface StatusToXContentObjectpublic java.lang.String getLocation(@Nullable java.lang.String routing)
Location header. The use of relative URIs is
permitted as of HTTP/1.1 (cf. https://tools.ietf.org/html/rfc7231#section-7.1.2).routing - custom routing or null if custom routing is not usedpublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface StreamablereadFrom in class ReplicationResponsejava.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in class ReplicationResponsejava.io.IOExceptionpublic final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOExceptionpublic XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOExceptionprotected static void declareParserFields(ConstructingObjectParser<? extends DocWriteResponse,java.lang.Void> objParser)
ObjectParser fields to use when parsing a DocWriteResponse