Module org.elasticsearch.xcore
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 gatheredRequest- The type of the RequestResponse- 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
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, logger, taskManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTransportGetResourcesAction(String actionName, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<Request> request, Client client, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected QueryBuilderprotected SearchSourceBuildercustomSearchOptions(SearchSourceBuilder searchSourceBuilder) protected abstract Stringprotected abstract StringextractIdFromResource(Resource resource) protected abstract String[]protected abstract org.elasticsearch.xcontent.ParseFieldprotected abstract ResourceNotFoundExceptionnotFoundException(String resourceId) protected abstract Resourceparse(org.elasticsearch.xcontent.XContentParser parser) protected voidsearchResources(AbstractGetResourcesRequest request, TaskId parentTaskId, ActionListener<QueryPage<Resource>> listener) Methods inherited from class org.elasticsearch.action.support.TransportAction
doExecute, execute, executeDirect, localOnly
-
Constructor Details
-
AbstractTransportGetResourcesAction
protected AbstractTransportGetResourcesAction(String actionName, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<Request> request, Client client, org.elasticsearch.xcontent.NamedXContentRegistry xContentRegistry)
-
-
Method Details
-
searchResources
protected void searchResources(AbstractGetResourcesRequest request, TaskId parentTaskId, ActionListener<QueryPage<Resource>> listener) -
customSearchOptions
-
additionalQuery
-
getResultsField
protected abstract org.elasticsearch.xcontent.ParseField getResultsField()- Returns:
- The results field parse field so that the response is properly formatted
-
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
- 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
- Returns:
- The appropriate origin under which to execute the search requests
-
extractIdFromResource
- Parameters:
resource- A parsed Resource object- Returns:
- The ID of the resource
-