Module org.elasticsearch.server
Class IndicesAliasesResponse
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.action.ActionResponse
org.elasticsearch.action.support.master.AcknowledgedResponse
org.elasticsearch.action.admin.indices.alias.IndicesAliasesResponse
- All Implemented Interfaces:
IsAcknowledgedSupplier,Writeable,RefCounted,ToXContent,ToXContentObject
Response with error information for a request to add/remove aliases for one or more indices.
Contains an acknowledged boolean, an errors boolean, and a list of results.
The result list is only present if there are errors, and contains a result for every input action.
This response replaces AcknowledgedResponse, and knows how to de/serialize from/to AcknowledgedResponse
in case of mixed version clusters.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResult for a single alias add/remove actionNested classes/interfaces inherited from class org.elasticsearch.action.ActionResponse
ActionResponse.EmptyNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IndicesAliasesResponsestatic final IndicesAliasesResponseFields inherited from class org.elasticsearch.action.support.master.AcknowledgedResponse
acknowledged, ACKNOWLEDGED_KEY, FALSE, TRUEFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCustomFields(XContentBuilder builder, ToXContent.Params params) static IndicesAliasesResponsebuild(List<IndicesAliasesResponse.AliasActionResult> actionResults) Build a response from a list of action results.booleanGet a list of all errors from the response.booleaninthashCode()voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.master.AcknowledgedResponse
isAcknowledged, of, readFrom, toXContentMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRefMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
NOT_ACKNOWLEDGED
-
ACKNOWLEDGED_NO_ERRORS
-
-
Constructor Details
-
IndicesAliasesResponse
- Throws:
IOException
-
-
Method Details
-
getActionResults
-
hasErrors
public boolean hasErrors() -
getErrors
Get a list of all errors from the response. If there are no errors, an empty list is returned. -
build
public static IndicesAliasesResponse build(List<IndicesAliasesResponse.AliasActionResult> actionResults) Build a response from a list of action results. Sets the errors boolean based on whether an of the individual results contain an error.- Parameters:
actionResults- an action result for each of the requested alias actions- Returns:
- response containing all action results
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classAcknowledgedResponse- Throws:
IOException
-
addCustomFields
protected void addCustomFields(XContentBuilder builder, ToXContent.Params params) throws IOException - Overrides:
addCustomFieldsin classAcknowledgedResponse- Throws:
IOException
-
equals
- Overrides:
equalsin classAcknowledgedResponse
-
hashCode
public int hashCode()- Overrides:
hashCodein classAcknowledgedResponse
-