public abstract class BaseServiceImpl extends Object implements IBaseService
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<String,ApiInfo> |
apiInfoList |
protected Credentials |
credentials |
protected ISignerV4 |
ISigner |
protected ServiceInfo |
serviceInfo |
| 构造器和说明 |
|---|
BaseServiceImpl(ServiceInfo info,
org.apache.http.HttpHost proxy,
Map<String,ApiInfo> apiInfoList) |
BaseServiceImpl(ServiceInfo info,
Map<String,ApiInfo> apiInfoList) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
destroy()
Free monitor thread
|
String |
getAccessKey()
Gets access key.
|
Map<String,ApiInfo> |
getApiInfoList() |
org.apache.http.client.HttpClient |
getHttpClient() |
ISignerV4 |
getISigner() |
String |
getRegion()
Gets region.
|
String |
getSecretKey()
Gets secret key.
|
ServiceInfo |
getServiceInfo() |
String |
getSessionToken()
Gets session token.
|
String |
getSignUrl(String api,
List<org.apache.http.NameValuePair> params)
Gets sign url.
|
RawResponse |
json(String api,
List<org.apache.http.NameValuePair> params,
String body)
Json raw response.
|
protected RawResponse |
makeRequest(String api,
SignableRequest request) |
RawResponse |
post(String api,
List<org.apache.http.NameValuePair> query,
List<org.apache.http.NameValuePair> form)
Post raw response.
|
org.apache.http.HttpResponse |
postDataWithResponse(String url,
byte[] data,
Map<String,String> headers) |
RawResponse |
postFileMultiPart(String api,
List<org.apache.http.NameValuePair> fromData,
String dataName,
String fileName,
byte[] data) |
protected SignableRequest |
prepareRequest(String api,
List<org.apache.http.NameValuePair> params) |
RawResponse |
proto(String api,
List<org.apache.http.NameValuePair> params,
Map<String,String> header,
byte[] body,
String compressType) |
boolean |
put(String url,
String filePath,
Map<String,String> headers)
Put boolean.
|
boolean |
putData(String url,
byte[] data,
Map<String,String> headers)
Put binary data.
|
boolean |
putData(String url,
InputStream inputStream,
Map<String,String> headers) |
org.apache.http.HttpResponse |
putDataWithResponse(String url,
byte[] data,
Map<String,String> headers) |
org.apache.http.HttpResponse |
putDataWithResponse(String url,
InputStream inputStream,
Map<String,String> headers) |
RawResponse |
query(String api,
List<org.apache.http.NameValuePair> params)
Query raw response.
|
void |
setAccessKey(String accessKey)
Sets access key.
|
void |
setClientNoReuse()
Sets client no reuse.
|
void |
setConnectionTimeout(int connectionTimeout)
Sets connection timeout.
|
void |
setHost(String host)
Sets host.
|
void |
setHttpClient(org.apache.http.client.HttpClient httpClient)
Sets http client.
|
void |
setRegion(String region)
Sets region.
|
void |
setScheme(String scheme)
Sets scheme.
|
void |
setSecretKey(String secretKey)
Sets secret key.
|
void |
setServiceInfo(ServiceInfo serviceInfo)
Sets service info.
|
void |
setSessionToken(String sessionToken)
Sets session token.
|
void |
setSocketTimeout(int socketTimeout)
Sets socket timeout.
|
SecurityToken2 |
signSts2(Policy inlinePolicy,
long expire)
Sign by sts2.
|
protected ServiceInfo serviceInfo
protected ISignerV4 ISigner
protected Credentials credentials
public BaseServiceImpl(ServiceInfo info, org.apache.http.HttpHost proxy, Map<String,ApiInfo> apiInfoList)
public BaseServiceImpl(ServiceInfo info, Map<String,ApiInfo> apiInfoList)
public void destroy()
IBaseServicedestroy 在接口中 IBaseServicepublic String getSignUrl(String api, List<org.apache.http.NameValuePair> params) throws Exception
IBaseServicegetSignUrl 在接口中 IBaseServiceapi - the apiparams - the paramsException - the exceptionpublic RawResponse query(String api, List<org.apache.http.NameValuePair> params)
IBaseServicequery 在接口中 IBaseServiceapi - the apiparams - the paramspublic boolean put(String url, String filePath, Map<String,String> headers)
IBaseServiceput 在接口中 IBaseServiceurl - the urlfilePath - the file pathheaders - the headerspublic boolean putData(String url, byte[] data, Map<String,String> headers)
IBaseServiceputData 在接口中 IBaseServiceurl - target urldata - binary dataheaders - http headerspublic org.apache.http.HttpResponse putDataWithResponse(String url, byte[] data, Map<String,String> headers)
public boolean putData(String url, InputStream inputStream, Map<String,String> headers)
public org.apache.http.HttpResponse postDataWithResponse(String url, byte[] data, Map<String,String> headers)
public org.apache.http.HttpResponse putDataWithResponse(String url, InputStream inputStream, Map<String,String> headers)
public RawResponse json(String api, List<org.apache.http.NameValuePair> params, String body)
IBaseServicejson 在接口中 IBaseServiceapi - the apiparams - the paramsbody - the bodypublic RawResponse post(String api, List<org.apache.http.NameValuePair> query, List<org.apache.http.NameValuePair> form)
IBaseServicepost 在接口中 IBaseServiceapi - the apiquery - the paramsform - the formpublic RawResponse postFileMultiPart(String api, List<org.apache.http.NameValuePair> fromData, String dataName, String fileName, byte[] data)
protected RawResponse makeRequest(String api, SignableRequest request)
protected SignableRequest prepareRequest(String api, List<org.apache.http.NameValuePair> params)
public void setClientNoReuse()
IBaseServicesetClientNoReuse 在接口中 IBaseServicepublic String getAccessKey()
IBaseServicegetAccessKey 在接口中 IBaseServicepublic void setAccessKey(String accessKey)
IBaseServicesetAccessKey 在接口中 IBaseServiceaccessKey - the access keypublic String getSecretKey()
IBaseServicegetSecretKey 在接口中 IBaseServicepublic void setSecretKey(String secretKey)
IBaseServicesetSecretKey 在接口中 IBaseServicesecretKey - the secret keypublic String getSessionToken()
IBaseServicegetSessionToken 在接口中 IBaseServicepublic void setSessionToken(String sessionToken)
IBaseServicesetSessionToken 在接口中 IBaseServicesessionToken - the session tokenpublic void setRegion(String region)
IBaseServicesetRegion 在接口中 IBaseServiceregion - the regionpublic String getRegion()
IBaseServicegetRegion 在接口中 IBaseServicepublic void setHost(String host)
IBaseServicesetHost 在接口中 IBaseServicehost - the hostpublic void setScheme(String scheme)
IBaseServicesetScheme 在接口中 IBaseServicescheme - the schemepublic org.apache.http.client.HttpClient getHttpClient()
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
IBaseServicesetHttpClient 在接口中 IBaseServicehttpClient - the http clientpublic ServiceInfo getServiceInfo()
public void setServiceInfo(ServiceInfo serviceInfo)
IBaseServicesetServiceInfo 在接口中 IBaseServiceserviceInfo - the service infopublic ISignerV4 getISigner()
public void setSocketTimeout(int socketTimeout)
IBaseServicesetSocketTimeout 在接口中 IBaseServicesocketTimeout - the socket timeoutpublic void setConnectionTimeout(int connectionTimeout)
IBaseServicesetConnectionTimeout 在接口中 IBaseServiceconnectionTimeout - the connection timeoutpublic SecurityToken2 signSts2(Policy inlinePolicy, long expire) throws Exception
IBaseServicesignSts2 在接口中 IBaseServiceinlinePolicy - the Policyexpire - expire timeException - the exceptionpublic RawResponse proto(String api, List<org.apache.http.NameValuePair> params, Map<String,String> header, byte[] body, String compressType)
proto 在接口中 IBaseServiceapi - interface path like /PutLogsparams - query paramsheader - some special header for protobufbody - request bodycompressType - default not compress,support lz4Copyright © 2025. All rights reserved.