Class AbstractTransportGetResourcesAction<Resource extends org.elasticsearch.xcontent.ToXContent & Writeable,Request extends AbstractGetResourcesRequest,Response extends AbstractGetResourcesResponse<Resource>>

java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<Request,Response>
org.elasticsearch.xpack.core.action.AbstractTransportGetResourcesAction<Resource,Request,Response>
Type Parameters:
Resource - The type of the Resource being gathered
Request - The type of the Request
Response - The type of the Response

public abstract class AbstractTransportGetResourcesAction<Resource extends org.elasticsearch.xcontent.ToXContent & Writeable,Request extends AbstractGetResourcesRequest,Response extends AbstractGetResourcesResponse<Resource>> extends HandledTransportAction<Request,Response>
Abstract transport class for collecting common logic in gathering Resource objects from indices
  • Constructor Details

  • Method Details

    • searchResources

      protected void searchResources(AbstractGetResourcesRequest request, TaskId parentTaskId, ActionListener<QueryPage<Resource>> listener)
    • customSearchOptions

      protected SearchSourceBuilder customSearchOptions(SearchSourceBuilder searchSourceBuilder)
    • additionalQuery

      @Nullable protected QueryBuilder additionalQuery()
    • getResultsField

      protected abstract org.elasticsearch.xcontent.ParseField getResultsField()
      Returns:
      The results field parse field so that the response is properly formatted
    • getIndices

      protected abstract String[] getIndices()
      Returns:
      The indices needed to query
    • parse

      protected abstract Resource parse(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Parameters:
      parser - Constructed XContentParser from search response hits to relay to a parser for the Resource
      Returns:
      parsed Resource typed object
      Throws:
      IOException
    • notFoundException

      protected abstract ResourceNotFoundException notFoundException(String resourceId)
      Parameters:
      resourceId - Resource ID or expression that was not found in the search results
      Returns:
      The exception to throw in the event that an ID or expression is not found
    • executionOrigin

      protected abstract String executionOrigin()
      Returns:
      The appropriate origin under which to execute the search requests
    • extractIdFromResource

      protected abstract String extractIdFromResource(Resource resource)
      Parameters:
      resource - A parsed Resource object
      Returns:
      The ID of the resource