Class GetAliasesResponse

java.lang.Object
org.elasticsearch.client.GetAliasesResponse
All Implemented Interfaces:
org.elasticsearch.common.xcontent.StatusToXContentObject, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class GetAliasesResponse extends Object implements org.elasticsearch.common.xcontent.StatusToXContentObject
Response obtained from the get aliases API. The format is pretty horrible as it holds aliases, but at the same time errors can come back through the status and error fields. Such errors are mostly 404 - NOT FOUND for aliases that were specified but not found. In such case the client won't throw exception so it allows to retrieve the returned aliases, while at the same time checking if errors were returned. There's also the case where an exception is returned, like for instance an IndexNotFoundException. We would usually throw such exception, but we configure the client to not throw for 404 to support the case above, hence we also not throw in case an index is not found, although it is a hard error that doesn't come back with aliases.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent

    org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
  • Field Summary

    Fields inherited from interface org.elasticsearch.xcontent.ToXContent

    EMPTY_PARAMS
  • Method Summary

    Modifier and Type
    Method
    Description
    fromXContent(org.elasticsearch.xcontent.XContentParser parser)
    Parse the get aliases response
    Map<String,Set<org.elasticsearch.cluster.metadata.AliasMetadata>>
    Return the requested aliases
    Return the possibly returned error, null otherwise
    org.elasticsearch.ElasticsearchException
    Return the exception that may have been returned
    org.elasticsearch.rest.RestStatus
     
    org.elasticsearch.xcontent.XContentBuilder
    toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject

    isFragment
  • Method Details

    • status

      public org.elasticsearch.rest.RestStatus status()
      Specified by:
      status in interface org.elasticsearch.common.xcontent.StatusToXContentObject
    • getError

      public String getError()
      Return the possibly returned error, null otherwise
    • getException

      public org.elasticsearch.ElasticsearchException getException()
      Return the exception that may have been returned
    • getAliases

      public Map<String,Set<org.elasticsearch.cluster.metadata.AliasMetadata>> getAliases()
      Return the requested aliases
    • toXContent

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

      public static GetAliasesResponse fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Parse the get aliases response
      Throws:
      IOException