Class ResponseConverter

java.lang.Object
org.opensearch.data.client.orhlc.ResponseConverter

public class ResponseConverter extends Object
Factory class to convert OpenSearch responses to different type of data classes.
Since:
0.1
  • Method Summary

    Modifier and Type
    Method
    Description
    static Map<String,Set<org.springframework.data.elasticsearch.core.index.AliasData>>
    aliasDatas(Map<String,Set<org.opensearch.cluster.metadata.AliasMetadata>> aliasesMetadatas)
     
    static org.springframework.data.elasticsearch.core.query.ByQueryResponse.Failure
    byQueryResponseFailureOf(org.opensearch.action.bulk.BulkItemResponse.Failure failure)
    Create a new ByQueryResponse.Failure from BulkItemResponse.Failure
    static org.springframework.data.elasticsearch.core.query.ByQueryResponse
    byQueryResponseOf(org.opensearch.index.reindex.BulkByScrollResponse bulkByScrollResponse)
     
    static org.springframework.data.elasticsearch.core.query.ByQueryResponse.SearchFailure
    byQueryResponseSearchFailureOf(org.opensearch.index.reindex.ScrollableHitSource.SearchFailure searchFailure)
    Create a new ByQueryResponse.SearchFailure from ScrollableHitSource.SearchFailure
    static org.springframework.data.elasticsearch.core.cluster.ClusterHealth
    clusterHealth(org.opensearch.action.admin.cluster.health.ClusterHealthResponse clusterHealthResponse)
     
    static org.springframework.data.elasticsearch.core.index.Settings
    fromSettingsResponse(org.opensearch.action.admin.indices.settings.get.GetSettingsResponse response, String indexName)
    extract the index settings information for a given index
    static org.springframework.data.elasticsearch.core.MultiGetItem.Failure
    getFailure(org.opensearch.action.get.MultiGetItemResponse itemResponse)
     
    static List<org.springframework.data.elasticsearch.core.IndexInformation>
    getIndexInformations(org.opensearch.action.admin.indices.get.GetIndexResponse getIndexResponse)
    get the index informations from a GetIndexResponse (transport client)
    static List<org.springframework.data.elasticsearch.core.IndexInformation>
    getIndexInformations(org.opensearch.client.indices.GetIndexResponse getIndexResponse)
    get the index informations from a GetIndexResponse
    static org.springframework.data.elasticsearch.core.index.TemplateData
    getTemplateData(org.opensearch.client.indices.GetIndexTemplatesResponse getIndexTemplatesResponse, String templateName)
     
    static org.springframework.data.elasticsearch.core.reindex.ReindexResponse.Failure
    reindexResponseFailureOf(org.opensearch.action.bulk.BulkItemResponse.Failure failure)
     
    static org.springframework.data.elasticsearch.core.reindex.ReindexResponse
    reindexResponseOf(org.opensearch.index.reindex.BulkByScrollResponse bulkByScrollResponse)
     
    static org.springframework.data.elasticsearch.core.index.AliasData
    toAliasData(org.opensearch.cluster.metadata.AliasMetadata aliasMetaData)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • aliasDatas

      public static Map<String,Set<org.springframework.data.elasticsearch.core.index.AliasData>> aliasDatas(Map<String,Set<org.opensearch.cluster.metadata.AliasMetadata>> aliasesMetadatas)
    • toAliasData

      public static org.springframework.data.elasticsearch.core.index.AliasData toAliasData(org.opensearch.cluster.metadata.AliasMetadata aliasMetaData)
    • getIndexInformations

      public static List<org.springframework.data.elasticsearch.core.IndexInformation> getIndexInformations(org.opensearch.client.indices.GetIndexResponse getIndexResponse)
      get the index informations from a GetIndexResponse
      Parameters:
      getIndexResponse - the index response, must not be null
      Returns:
      list of IndexInformations for the different indices
    • getIndexInformations

      public static List<org.springframework.data.elasticsearch.core.IndexInformation> getIndexInformations(org.opensearch.action.admin.indices.get.GetIndexResponse getIndexResponse)
      get the index informations from a GetIndexResponse (transport client)
      Parameters:
      getIndexResponse - the index response, must not be null
      Returns:
      list of IndexInformations for the different indices
    • getTemplateData

      @Nullable public static org.springframework.data.elasticsearch.core.index.TemplateData getTemplateData(org.opensearch.client.indices.GetIndexTemplatesResponse getIndexTemplatesResponse, String templateName)
    • fromSettingsResponse

      public static org.springframework.data.elasticsearch.core.index.Settings fromSettingsResponse(org.opensearch.action.admin.indices.settings.get.GetSettingsResponse response, String indexName)
      extract the index settings information for a given index
      Parameters:
      response - the OpenSearch response
      indexName - the index name
      Returns:
      settings
    • getFailure

      @Nullable public static org.springframework.data.elasticsearch.core.MultiGetItem.Failure getFailure(org.opensearch.action.get.MultiGetItemResponse itemResponse)
    • clusterHealth

      public static org.springframework.data.elasticsearch.core.cluster.ClusterHealth clusterHealth(org.opensearch.action.admin.cluster.health.ClusterHealthResponse clusterHealthResponse)
    • byQueryResponseOf

      public static org.springframework.data.elasticsearch.core.query.ByQueryResponse byQueryResponseOf(org.opensearch.index.reindex.BulkByScrollResponse bulkByScrollResponse)
    • byQueryResponseFailureOf

      public static org.springframework.data.elasticsearch.core.query.ByQueryResponse.Failure byQueryResponseFailureOf(org.opensearch.action.bulk.BulkItemResponse.Failure failure)
      Create a new ByQueryResponse.Failure from BulkItemResponse.Failure
      Parameters:
      failure - BulkItemResponse.Failure to translate
      Returns:
      a new ByQueryResponse.Failure
    • byQueryResponseSearchFailureOf

      public static org.springframework.data.elasticsearch.core.query.ByQueryResponse.SearchFailure byQueryResponseSearchFailureOf(org.opensearch.index.reindex.ScrollableHitSource.SearchFailure searchFailure)
      Create a new ByQueryResponse.SearchFailure from ScrollableHitSource.SearchFailure
      Parameters:
      searchFailure - ScrollableHitSource.SearchFailure to translate
      Returns:
      a new ByQueryResponse.SearchFailure
    • reindexResponseOf

      public static org.springframework.data.elasticsearch.core.reindex.ReindexResponse reindexResponseOf(org.opensearch.index.reindex.BulkByScrollResponse bulkByScrollResponse)
    • reindexResponseFailureOf

      public static org.springframework.data.elasticsearch.core.reindex.ReindexResponse.Failure reindexResponseFailureOf(org.opensearch.action.bulk.BulkItemResponse.Failure failure)
      Since:
      4.4