Class NodesResponseHeader


  • public final class NodesResponseHeader
    extends java.lang.Object
    A utility class to parse the Nodes Header returned by RestActions.buildNodesHeader(XContentBuilder, ToXContent.Params, BaseNodesResponse).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.opensearch.common.ParseField FAILED  
      static org.opensearch.common.ParseField FAILURES  
      static org.opensearch.common.xcontent.ConstructingObjectParser<NodesResponseHeader,​java.lang.Void> PARSER  
      static org.opensearch.common.ParseField SUCCESSFUL  
      static org.opensearch.common.ParseField TOTAL  
    • Constructor Summary

      Constructors 
      Constructor Description
      NodesResponseHeader​(int total, int successful, int failed, java.util.List<org.opensearch.OpenSearchException> failures)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      static NodesResponseHeader fromXContent​(org.opensearch.common.xcontent.XContentParser parser, java.lang.Void context)  
      int getFailed()
      the number of nodes that the operation has failed on
      java.util.List<org.opensearch.OpenSearchException> getFailures()
      Get the failed node exceptions.
      int getSuccessful()
      the number of nodes that the operation was successful on
      int getTotal()
      the total number of nodes that the operation was carried on
      boolean hasFailures()
      Determine if there are any node failures in failures.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TOTAL

        public static final org.opensearch.common.ParseField TOTAL
      • SUCCESSFUL

        public static final org.opensearch.common.ParseField SUCCESSFUL
      • FAILED

        public static final org.opensearch.common.ParseField FAILED
      • FAILURES

        public static final org.opensearch.common.ParseField FAILURES
      • PARSER

        public static final org.opensearch.common.xcontent.ConstructingObjectParser<NodesResponseHeader,​java.lang.Void> PARSER
    • Constructor Detail

      • NodesResponseHeader

        public NodesResponseHeader​(int total,
                                   int successful,
                                   int failed,
                                   @Nullable
                                   java.util.List<org.opensearch.OpenSearchException> failures)
    • Method Detail

      • fromXContent

        public static NodesResponseHeader fromXContent​(org.opensearch.common.xcontent.XContentParser parser,
                                                       java.lang.Void context)
                                                throws java.io.IOException
        Throws:
        java.io.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

        public java.util.List<org.opensearch.OpenSearchException> getFailures()
        Get the failed node exceptions.
        Returns:
        Never null. Can be empty.
      • hasFailures

        public boolean hasFailures()
        Determine if there are any node failures in failures.
        Returns:
        true if failures contains at least 1 exception.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object