Interface RestHandler

All Known Implementing Classes:
AbstractCatAction, BaseRestHandler, BaseRestHandler.Wrapper, DeprecationRestHandler, RestAddIndexBlockAction, RestAddVotingConfigExclusionAction, RestAliasAction, RestAllocationAction, RestAnalyzeAction, RestBulkAction, RestCancelTasksAction, RestCatAction, RestCatRecoveryAction, RestCleanupRepositoryAction, RestClearIndicesCacheAction, RestClearScrollAction, RestClearVotingConfigExclusionsAction, RestCloneSnapshotAction, RestCloseIndexAction, RestClosePointInTimeAction, RestClusterAllocationExplainAction, RestClusterGetSettingsAction, RestClusterHealthAction, RestClusterRerouteAction, RestClusterSearchShardsAction, RestClusterStateAction, RestClusterStatsAction, RestClusterUpdateSettingsAction, RestCountAction, RestCountAction, RestCreateIndexAction, RestCreateSnapshotAction, RestDeleteAction, RestDeleteComponentTemplateAction, RestDeleteComposableIndexTemplateAction, RestDeleteDanglingIndexAction, RestDeleteIndexAction, RestDeleteIndexTemplateAction, RestDeletePipelineAction, RestDeleteRepositoryAction, RestDeleteSnapshotAction, RestDeleteStoredScriptAction, RestExplainAction, RestFieldCapabilitiesAction, RestFielddataAction, RestFlushAction, RestForceMergeAction, RestGetAction, RestGetAliasesAction, RestGetComponentTemplateAction, RestGetComposableIndexTemplateAction, RestGetFieldMappingAction, RestGetIndexTemplateAction, RestGetIndicesAction, RestGetMappingAction, RestGetPipelineAction, RestGetRepositoriesAction, RestGetScriptContextAction, RestGetScriptLanguageAction, RestGetSettingsAction, RestGetSnapshotsAction, RestGetSourceAction, RestGetStoredScriptAction, RestGetTaskAction, RestHealthAction, RestImportDanglingIndexAction, RestIndexAction, RestIndexAction.AutoIdHandler, RestIndexAction.CreateHandler, RestIndexDeleteAliasesAction, RestIndexPutAliasAction, RestIndicesAction, RestIndicesAliasesAction, RestIndicesSegmentsAction, RestIndicesShardStoresAction, RestIndicesStatsAction, RestListDanglingIndicesAction, RestListTasksAction, RestMainAction, RestMasterAction, RestMultiGetAction, RestMultiSearchAction, RestMultiTermVectorsAction, RestNodeAttrsAction, RestNodesAction, RestNodesHotThreadsAction, RestNodesInfoAction, RestNodesStatsAction, RestNodesUsageAction, RestOpenIndexAction, RestOpenPointInTimeAction, RestPendingClusterTasksAction, RestPendingClusterTasksAction, RestPluginsAction, RestPutComponentTemplateAction, RestPutComposableIndexTemplateAction, RestPutIndexTemplateAction, RestPutMappingAction, RestPutPipelineAction, RestPutRepositoryAction, RestPutStoredScriptAction, RestRecoveryAction, RestRefreshAction, RestReloadSecureSettingsAction, RestRemoteClusterInfoAction, RestRepositoriesAction, RestResetFeatureStateAction, RestResizeHandler, RestResizeHandler.RestCloneIndexAction, RestResizeHandler.RestShrinkIndexAction, RestResizeHandler.RestSplitIndexAction, RestResolveIndexAction, RestRestoreSnapshotAction, RestRolloverIndexAction, RestSearchAction, RestSearchScrollAction, RestSegmentsAction, RestShardsAction, RestSimulateIndexTemplateAction, RestSimulatePipelineAction, RestSimulateTemplateAction, RestSnapshotAction, RestSnapshotsStatusAction, RestSnapshottableFeaturesAction, RestSyncedFlushAction, RestTasksAction, RestTemplatesAction, RestTermVectorsAction, RestThreadPoolAction, RestUpdateAction, RestUpdateSettingsAction, RestUpgradeActionDeprecated, RestUpgradeStatusActionDeprecated, RestValidateQueryAction, RestVerifyRepositoryAction
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RestHandler
Handler for REST requests
  • Method Details

    • handleRequest

      void handleRequest(RestRequest request, RestChannel channel, NodeClient client) throws Exception
      Handles a rest request.
      Parameters:
      request - The request to handle
      channel - The channel to write the request response to
      client - A client to use to make internal requests on behalf of the original request
      Throws:
      Exception
    • canTripCircuitBreaker

      default boolean canTripCircuitBreaker()
    • supportsContentStream

      default boolean supportsContentStream()
      Indicates if the RestHandler supports content as a stream. A stream would be multiple objects delineated by XContent.streamSeparator(). If a handler returns true this will affect the types of content that can be sent to this endpoint.
    • allowsUnsafeBuffers

      default boolean allowsUnsafeBuffers()
      Indicates if the RestHandler supports working with pooled buffers. If the request handler will not escape the return RestRequest.content() or any buffers extracted from it then there is no need to make a copies of any pooled buffers in the RestRequest instance before passing a request to this handler. If this instance does not support pooled/unsafe buffers RestRequest.ensureSafeBuffers() should be called on any request before passing it to handleRequest(org.elasticsearch.rest.RestRequest, org.elasticsearch.rest.RestChannel, org.elasticsearch.client.node.NodeClient).
      Returns:
      true iff the handler supports requests that make use of pooled buffers
    • routes

      default List<RestHandler.Route> routes()
      The list of RestHandler.Routes that this RestHandler is responsible for handling.
    • allowSystemIndexAccessByDefault

      default boolean allowSystemIndexAccessByDefault()
      Controls whether requests handled by this class are allowed to to access system indices by default.
      Returns:
      true if requests handled by this class should be allowed to access system indices.