use of com.qcloud.cos.internal.CIWorkflowServiceRequest in project cos-java-sdk-v5 by tencentyun.
the class COSClient method invoke.
private <X, Y extends CosServiceRequest> X invoke(CosHttpRequest<Y> request, HttpResponseHandler<CosServiceResponse<X>> responseHandler) throws CosClientException, CosServiceException {
COSSigner cosSigner = clientConfig.getCosSigner();
COSCredentials cosCredentials;
CosServiceRequest cosServiceRequest = request.getOriginalRequest();
if (cosServiceRequest != null && cosServiceRequest.getCosCredentials() != null) {
cosCredentials = cosServiceRequest.getCosCredentials();
} else {
cosCredentials = fetchCredential();
}
Date expiredTime = new Date(System.currentTimeMillis() + clientConfig.getSignExpired() * 1000);
boolean isCIWorkflowRequest = cosServiceRequest instanceof CIWorkflowServiceRequest;
cosSigner.setCIWorkflowRequest(isCIWorkflowRequest);
cosSigner.sign(request, cosCredentials, expiredTime);
return this.cosHttpClient.exeute(request, responseHandler);
}
Aggregations