Package org.elasticsearch.client
Class NodesResponseHeader
java.lang.Object
org.elasticsearch.client.NodesResponseHeader
A utility class to parse the Nodes Header returned by
RestActions.buildNodesHeader(XContentBuilder, ToXContent.Params, BaseNodesResponse).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ConstructingObjectParser<NodesResponseHeader,Void> static final org.elasticsearch.xcontent.ParseFieldstatic final org.elasticsearch.xcontent.ParseField -
Constructor Summary
ConstructorsConstructorDescriptionNodesResponseHeader(int total, int successful, int failed, List<ElasticsearchException> failures) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic NodesResponseHeaderfromXContent(org.elasticsearch.xcontent.XContentParser parser, Void context) intthe number of nodes that the operation has failed onGet the failed node exceptions.intthe number of nodes that the operation was successful onintgetTotal()the total number of nodes that the operation was carried onbooleanDetermine if there are any node failures infailures.inthashCode()
-
Field Details
-
TOTAL
public static final org.elasticsearch.xcontent.ParseField TOTAL -
SUCCESSFUL
public static final org.elasticsearch.xcontent.ParseField SUCCESSFUL -
FAILED
public static final org.elasticsearch.xcontent.ParseField FAILED -
FAILURES
public static final org.elasticsearch.xcontent.ParseField FAILURES -
PARSER
public static final org.elasticsearch.xcontent.ConstructingObjectParser<NodesResponseHeader,Void> PARSER
-
-
Constructor Details
-
NodesResponseHeader
public NodesResponseHeader(int total, int successful, int failed, @Nullable List<ElasticsearchException> failures)
-
-
Method Details
-
fromXContent
public static NodesResponseHeader fromXContent(org.elasticsearch.xcontent.XContentParser parser, Void context) throws IOException - Throws:
IOException
-
getTotal
public int getTotal()the total number of nodes that the operation was carried on -
getFailed
public int getFailed()the number of nodes that the operation has failed on -
getSuccessful
public int getSuccessful()the number of nodes that the operation was successful on -
getFailures
Get the failed node exceptions.- Returns:
- Never
null. Can be empty.
-
hasFailures
public boolean hasFailures()Determine if there are any node failures infailures.- Returns:
trueiffailurescontains at least 1 exception.
-
equals
-
hashCode
public int hashCode()
-