Class BroadcastResponse

All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, org.elasticsearch.core.RefCounted
Direct Known Subclasses:
ClearIndicesCacheResponse, FlushResponse, ForceMergeResponse, IndicesSegmentResponse, IndicesStatsResponse, RecoveryResponse, RefreshResponse, UpgradeResponse, UpgradeStatusResponse, ValidateQueryResponse

public class BroadcastResponse extends ActionResponse implements org.elasticsearch.common.xcontent.ToXContentObject
Base class for all broadcast operation based responses.
  • Field Details

  • Constructor Details

  • Method Details

    • declareBroadcastFields

      protected static <T extends BroadcastResponse> void declareBroadcastFields(org.elasticsearch.common.xcontent.ConstructingObjectParser<T,Void> PARSER)
    • getTotalShards

      public int getTotalShards()
      The total shards this request ran against.
    • getSuccessfulShards

      public int getSuccessfulShards()
      The successful shards this request was executed on.
    • getFailedShards

      public int getFailedShards()
      The failed shards this request was executed on.
    • getStatus

      public RestStatus getStatus()
      The REST status that should be used for the response
    • getShardFailures

      public DefaultShardOperationFailedException[] getShardFailures()
      The list of shard failures exception.
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException
    • addCustomXContentFields

      protected void addCustomXContentFields(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Override in subclass to add custom fields following the common `_shards` field
      Throws:
      IOException