com.amazonaws.Request.setEndpoint()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(19.6k)|赞(0)|评价(0)|浏览(169)

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

Request.setEndpoint介绍

[英]Sets the service endpoint (ex: "https://ec2.amazonaws.com") to which this request should be sent.
[中]设置服务端点(例如:https://ec2.amazonaws.com),该请求应发送到该地址。

代码示例

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

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

/**
 * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
 * ExecutionContext beforehand.
 **/
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,
    ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
  if (discoveredEndpoint != null) {
    request.setEndpoint(discoveredEndpoint);
    request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
  } else if (uriFromEndpointTrait != null) {
    request.setEndpoint(uriFromEndpointTrait);
  } else {
    request.setEndpoint(endpoint);
  }
  request.setTimeOffset(timeOffset);
  HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
  return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}

相关文章