Handles an execute response.

@param request the execute request
@return future to be completed with the execute response
486805
public CompletableFuture<ExecuteResponse> execute(ExecuteRequest request) {
    logRequest(request);
    return CompletableFuture.completedFuture(logResponse(ExecuteResponse.error()));
  }
507013
public void execute(final AwsRequest request) {
    service.callFunction(
        Fields.EXECUTE_ACTION_NAME,
        Collections.singletonList(getRequestArgs(request)));
  }
1148066
private HttpResponse executeCurrentRequest(HttpRequest request) throws IOException {
    // enable GZip encoding if necessary
    if (!disableGZipContent && !(request.getContent() instanceof EmptyContent)) {
      request.setEncoding(new GZipEncoding());
    }
    // execute request
    HttpResponse response = executeCurrentRequestWithoutGZip(request);
    return response;
  }
703571
public boolean execute (PathFinderRequest<N> request) {

		request.executionFrames++;

		while (true) {
			if (DEBUG) GdxAI.getLogger().debug(TAG, "------");
			// Should perform search begin?
			if (request.status == PathFinderRequest.SEARCH_NEW) {
				long currentTime = TimeUtils.nanoTime();
				timeToRun -= currentTime - lastTime;
				if (timeToRun <= timeTolerance) return false;
				if (DEBUG) GdxAI.getLogger().debug(TAG, "search begin");
				if (!request.initializeSearch(timeToRun)) return false;
				request.changeStatus(PathFinderRequest.SEARCH_INITIALIZED);
				lastTime = currentTime;
			}

			// Should perform search path?
			if (request.status == PathFinderRequest.SEARCH_INITIALIZED) {
				long currentTime = TimeUtils.nanoTime();
				timeToRun -= currentTime - lastTime;
				if (timeToRun <= timeTolerance) return false;
				if (DEBUG) GdxAI.getLogger().debug(TAG, "search path");
				if (!request.search(pathFinder, timeToRun)) return false;
				request.changeStatus(PathFinderRequest.SEARCH_DONE);
				lastTime = currentTime;
			}

			// Should perform search end?
			if (request.status == PathFinderRequest.SEARCH_DONE) {
				long currentTime = TimeUtils.nanoTime();
				timeToRun -= currentTime - lastTime;
				if (timeToRun <= timeTolerance) return false;
				if (DEBUG) GdxAI.getLogger().debug(TAG, "search end");
				if (!request.finalizeSearch(timeToRun)) return false;
				request.changeStatus(PathFinderRequest.SEARCH_FINALIZED);

				// Search finished, send result to the client
				if (server != null) {
					MessageDispatcher dispatcher = request.dispatcher != null ? request.dispatcher : MessageManager.getInstance();
					dispatcher.dispatchMessage(server, request.client, request.responseMessageCode, request);
				}

				lastTime = currentTime;

				if (request.statusChanged && request.status == PathFinderRequest.SEARCH_NEW) {
					if (DEBUG) GdxAI.getLogger().debug(TAG, "search renew");
					continue;
				}
			}

			return true;
		}
	}
946526
@Override
	public void handleRequest(final Request request) {
		super.handleRequest(request);

		if (isPresent(request)) {
			if (getExpandMode() != ExpandMode.NONE) {
				handleExpansionRequest(request);
			}

			if (getSelectMode() != SelectMode.NONE) {
				handleSelectionRequest(request);
			}

			if (getPaginationMode() != PaginationMode.NONE) {
				handlePaginationRequest(request);
			}

			if (isFilterable()) {
				handleFilterRequest(request);
			}

			if (isSortable()) {
				handleSortRequest(request);
			}
		}
	}
768532
public Task<HttpResponse> execute(@NonNull final HttpRequest request) {
    return dispatcher.dispatchTask(new Callable<HttpResponse>() {
      @Override
      public HttpResponse call() {
        return proxy.execute(request);
      }
    });
  }
593441
@Override
	public void execute(HttpGet httpGet, FutureCallback<HttpResponse> futureCallback) {

		try {
			if (httpGet == null) {
				throw new RuntimeException("Cannot issue GET request with HttpGet object");
			}
			log.info("Executing GET request to " + httpGet.getURI().toString());
			thread = new GetThread(client, httpGet, futureCallback);
			thread.start();
		} catch (Exception e) {
			log.error(e.getMessage());
			futureCallback.failed(e);
		}
	}
651398
private void handleRequest(long requestId, Object request, HandlerHolder handler) {
    @SuppressWarnings("unchecked")
    CompletableFuture<Object> responseFuture = handler.handler.apply(request);
    if (responseFuture != null) {
      responseFuture.whenComplete((response, error) -> {
        ThreadContext context = ThreadContext.currentContext();
        if (context == null) {
          this.context.executor().execute(() -> {
            if (error == null) {
              handleRequestSuccess(requestId, response, this.context);
            } else {
              handleRequestFailure(requestId, error, this.context);
            }
          });
        } else {
          if (error == null) {
            handleRequestSuccess(requestId, response, context);
          } else {
            handleRequestFailure(requestId, error, context);
          }
        }
      });
    }
  }
248113
public CompletableFuture<RestoreResponse> restore(RestoreRequest request) {
    ComposableFuture<RestoreResponse> future = new ComposableFuture<>();
    threadContext.execute(() -> {
      role.restore(request).whenComplete(future);
    });
    return future;
  }
308015
public int delete(Request request)
    {
        DeleteResponse response = executeRequest(request,objectMapper.getTypeFactory().constructType(
                DeleteResponse.class));
        return response.getCount();
    }
554080
public void handleRequest(String request) {
        if (messageListener != null) {
            log.debug("Received Http request");
            messageListener.onInboundMessage(new RawMessage(request), null);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Received Http request:" + NEWLINE + request);
            }
        }
    }
1066341
public Task<Void> execute(@Nonnull final AwsRequest request) {
    return dispatcher.dispatchTask(new Callable<Void>() {
      @Override
      public Void call() {
        proxy.execute(request);
        return null;
      }
    });
  }
12075
@SuppressWarnings("unchecked")
  private void handleRequest(long requestId, Object request) {
    HandlerHolder holder = handlers.get(request.getClass());
    if (holder == null) {
      connection.handleResponseError(requestId, new ConnectException("no handler registered"));
      return;
    }

    Function<Object, CompletableFuture<Object>> handler = (Function<Object, CompletableFuture<Object>>) holder.handler;

    try {
      holder.context.executor().execute(() -> {
        if (open && connection.open) {
          CompletableFuture<Object> responseFuture = handler.apply(request);
          if (responseFuture != null) {
            responseFuture.whenComplete((response, error) -> {
              if (!open || !connection.open) {
                connection.handleResponseError(requestId, new ConnectException("connection closed"));
              } else if (error == null) {
                connection.handleResponseOk(requestId, response);
              } else {
                connection.handleResponseError(requestId, error);
              }
            });
          }
        } else {
          connection.handleResponseError(requestId, new ConnectException("connection closed"));
        }
      });
    } catch (RejectedExecutionException e) {
      connection.handleResponseError(requestId, new ConnectException("connection closed"));
    }
  }
1164808
public CompletableFuture<ConsumeResponse> consume(ConsumeRequest request) {
    logRequest(request);
    return CompletableFuture.completedFuture(logResponse(ConsumeResponse.error()));
  }
331189
private HttpResponse execute( HttpUriRequest request ) throws RestException
    {
        log.debug( ">>>> " + request.getRequestLine() );
        for ( Header header : request.getAllHeaders() )
        {
            log.trace( ">>>> " + header.getName() + ": " + header.getValue() );
        }

        HttpResponse response;
        try
        {
            response = getHttpClient().execute( request );
            log.debug( "<<<< " + response.getStatusLine() );
            for ( Header header : response.getAllHeaders() )
            {
                log.trace( "<<<< " + header.getName() + ": " + header.getValue() );
            }

            if ( response.getStatusLine().getStatusCode() == 204 )
            {
                log.debug( "Consuming quietly the response entity since server returned no content" );
                EntityUtils.consumeQuietly( response.getEntity() );
            }

            checkError( response );
            return response;
        }
        catch ( KeyManagementException | NoSuchAlgorithmException | IOException e )
        {
            throw new RuntimeRestException( e );
        }
        finally
        {
            // https://issues.apache.org/jira/browse/HTTPCLIENT-1523
            DateUtils.clearThreadLocal();
        }
    }
473680
private void finalizeRequest(Request request) {
        // Check, one last time, if the request was finalized. Better fail it with an AssertionError rather than leave it
        // hanging forever.
        if (!request.isDone()) {
            request.fail(new AssertionError("Request finalized but not yet completed."));
        }

        // Unregister the request.
        synchronized (this.lock) {
            this.pendingRequests.remove(request.getOffset());
        }

        log.debug("{}: StorageRead.Finalize {}, Success = {}", this.traceObjectId, request, !request.resultFuture.isCompletedExceptionally());
    }
1276077
private <T> void submitCommand(CommandRequest request, CompletableFuture<T> future) {
    submit(new CommandAttempt<>(sequencer.nextRequest(), request, future));
  }