com.amazonaws.http.AmazonHttpClient.getNonNullResponseHandler()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(63)

本文整理了Java中com.amazonaws.http.AmazonHttpClient.getNonNullResponseHandler()方法的一些代码示例,展示了AmazonHttpClient.getNonNullResponseHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AmazonHttpClient.getNonNullResponseHandler()方法的具体详情如下:
包路径:com.amazonaws.http.AmazonHttpClient
类名称:AmazonHttpClient
方法名:getNonNullResponseHandler

AmazonHttpClient.getNonNullResponseHandler介绍

[英]Ensures the response handler is not null. If it is this method returns a dummy response handler.
[中]确保响应处理程序不为null。如果是,则此方法返回一个虚拟响应处理程序。

代码示例

代码示例来源:origin: aws/aws-sdk-java

/**
 * Executes the request and returns the result.
 *
 * @param request              The AmazonWebServices request to send to the remote server
 * @param responseHandler      A response handler to accept a successful response from the
 *                             remote server
 * @param errorResponseHandler A response handler to accept an unsuccessful response from the
 *                             remote server
 * @param executionContext     Additional information about the context of this web service
 *                             call
 * @deprecated Use {@link #requestExecutionBuilder()} to configure and execute a HTTP request.
 */
@Deprecated
public <T> Response<T> execute(Request<?> request,
                HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
                HttpResponseHandler<AmazonServiceException> errorResponseHandler,
                ExecutionContext executionContext) {
  HttpResponseHandler<T> adaptedRespHandler = new AwsResponseHandlerAdapter<T>(
      getNonNullResponseHandler(responseHandler),
      request,
      executionContext.getAwsRequestMetrics(),
      responseMetadataCache);
  return requestExecutionBuilder()
      .request(request)
      .requestConfig(new AmazonWebServiceRequestAdapter(request.getOriginalRequest()))
      .errorResponseHandler(new AwsErrorResponseHandler(errorResponseHandler, executionContext.getAwsRequestMetrics()))
      .executionContext(executionContext)
      .execute(adaptedRespHandler);
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

/**
 * Executes the request and returns the result.
 *
 * @param request              The AmazonWebServices request to send to the remote server
 * @param responseHandler      A response handler to accept a successful response from the
 *                             remote server
 * @param errorResponseHandler A response handler to accept an unsuccessful response from the
 *                             remote server
 * @param executionContext     Additional information about the context of this web service
 *                             call
 * @deprecated Use {@link #requestExecutionBuilder()} to configure and execute a HTTP request.
 */
@Deprecated
public <T> Response<T> execute(Request<?> request,
                HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
                HttpResponseHandler<AmazonServiceException> errorResponseHandler,
                ExecutionContext executionContext) {
  HttpResponseHandler<T> adaptedRespHandler = new AwsResponseHandlerAdapter<T>(
      getNonNullResponseHandler(responseHandler),
      request,
      executionContext.getAwsRequestMetrics(),
      responseMetadataCache);
  return requestExecutionBuilder()
      .request(request)
      .requestConfig(new AmazonWebServiceRequestAdapter(request.getOriginalRequest()))
      .errorResponseHandler(new AwsErrorResponseHandler(errorResponseHandler, executionContext.getAwsRequestMetrics()))
      .executionContext(executionContext)
      .execute(adaptedRespHandler);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Executes the request and returns the result.
 *
 * @param request              The AmazonWebServices request to send to the remote server
 * @param responseHandler      A response handler to accept a successful response from the
 *                             remote server
 * @param errorResponseHandler A response handler to accept an unsuccessful response from the
 *                             remote server
 * @param executionContext     Additional information about the context of this web service
 *                             call
 * @deprecated Use {@link #requestExecutionBuilder()} to configure and execute a HTTP request.
 */
@Deprecated
public <T> Response<T> execute(Request<?> request,
                HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
                HttpResponseHandler<AmazonServiceException> errorResponseHandler,
                ExecutionContext executionContext) {
  HttpResponseHandler<T> adaptedRespHandler = new AwsResponseHandlerAdapter<T>(
      getNonNullResponseHandler(responseHandler),
      request,
      executionContext.getAwsRequestMetrics(),
      responseMetadataCache);
  return requestExecutionBuilder()
      .request(request)
      .requestConfig(new AmazonWebServiceRequestAdapter(request.getOriginalRequest()))
      .errorResponseHandler(new AwsErrorResponseHandler(errorResponseHandler, executionContext.getAwsRequestMetrics()))
      .executionContext(executionContext)
      .execute(adaptedRespHandler);
}

相关文章