public abstract class AbstractYopHttpClient extends Object implements YopHttpClient
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
AbstractYopHttpClient.HeaderBuilder |
| 限定符和类型 | 字段和说明 |
|---|---|
protected ClientConfiguration |
clientConfig
Client configuration options, such as proxy settings, max retries, etc.
|
protected static org.slf4j.Logger |
LOGGER |
protected static Set<HttpMethodName> |
PAYLOAD_SUPPORT_METHODS |
| 构造器和说明 |
|---|
AbstractYopHttpClient(ClientConfiguration clientConfig) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected <Input extends BaseRequest> |
buildHttpHeaders(Request<Input> request,
AbstractYopHttpClient.HeaderBuilder headerBuilder) |
protected <Input extends BaseRequest> |
checkForMultiPart(Request<Input> request)
校验文件上传请求
|
protected abstract <Input extends BaseRequest> |
doExecute(Request<Input> request,
YopRequestConfig yopRequestConfig)
执行请求(加密、加签)
|
<Output extends BaseResponse,Input extends BaseRequest> |
execute(Request<Input> request,
YopRequestConfig yopRequestConfig,
ExecutionContext executionContext,
HttpResponseHandler<Output> responseHandler)
execute the http request
|
protected <Input extends BaseRequest,Output extends BaseResponse> |
postExecute(long beginTime,
ExecutionContext executionContext,
Request<Input> request,
Output analyzedResponse,
YopHttpResponse httpResponse,
Exception originEx)
请求后置处理(关闭response)
|
protected <Input extends BaseRequest> |
preExecute(Request<Input> request,
ExecutionContext executionContext)
加密&签名请求
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshutdownprotected static final org.slf4j.Logger LOGGER
protected static final Set<HttpMethodName> PAYLOAD_SUPPORT_METHODS
protected final ClientConfiguration clientConfig
public AbstractYopHttpClient(ClientConfiguration clientConfig)
public <Output extends BaseResponse,Input extends BaseRequest> Output execute(Request<Input> request, YopRequestConfig yopRequestConfig, ExecutionContext executionContext, HttpResponseHandler<Output> responseHandler)
YopHttpClientexecute 在接口中 YopHttpClientrequest - a yop requestyopRequestConfig - request config to override the default client configexecutionContext - contextresponseHandler - the response handler for callbackprotected <Input extends BaseRequest,Output extends BaseResponse> void postExecute(long beginTime, ExecutionContext executionContext, Request<Input> request, Output analyzedResponse, YopHttpResponse httpResponse, Exception originEx)
Input - 请求Output - 响应beginTime - 请求开始时间request - 请求对象analyzedResponse - 响应对象httpResponse - http响应originEx - 服务端异常protected abstract <Input extends BaseRequest> YopHttpResponse doExecute(Request<Input> request, YopRequestConfig yopRequestConfig) throws IOException
Input - request - yopRequestConfig - IOExceptionprotected <Input extends BaseRequest> void preExecute(Request<Input> request, ExecutionContext executionContext) throws ExecutionException, InterruptedException, UnsupportedEncodingException
Input - request - executionContext - ExecutionExceptionInterruptedExceptionUnsupportedEncodingExceptionprotected <Input extends BaseRequest> boolean checkForMultiPart(Request<Input> request) throws com.yeepay.yop.sdk.exception.YopClientException
Input - 请求类request - 请求com.yeepay.yop.sdk.exception.YopClientException - if the request is invalid for multipartprotected <Input extends BaseRequest> void buildHttpHeaders(Request<Input> request, AbstractYopHttpClient.HeaderBuilder headerBuilder)
Copyright © 2024. All rights reserved.