public abstract class BaseServiceImpl extends Object implements IBaseService
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,ApiInfo> |
apiInfoList |
protected ServiceInfo |
serviceInfo |
| Constructor and Description |
|---|
BaseServiceImpl(ServiceInfo info,
org.apache.http.HttpHost proxy,
Map<String,ApiInfo> apiInfoList) |
BaseServiceImpl(ServiceInfo info,
Map<String,ApiInfo> apiInfoList) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
RawResponse |
post(String api,
List<org.apache.http.NameValuePair> query,
List<org.apache.http.NameValuePair> form)
Post raw response.
|
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.
|
org.apache.http.HttpResponse |
putDataWithResponse(String url,
byte[] data,
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
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 in interface IBaseServicepublic String getSignUrl(String api, List<org.apache.http.NameValuePair> params) throws Exception
IBaseServicegetSignUrl in interface IBaseServiceapi - the apiparams - the paramsException - the exceptionpublic RawResponse query(String api, List<org.apache.http.NameValuePair> params)
IBaseServicequery in interface IBaseServiceapi - the apiparams - the paramspublic boolean put(String url, String filePath, Map<String,String> headers)
IBaseServiceput in interface IBaseServiceurl - the urlfilePath - the file pathheaders - the headerspublic boolean putData(String url, byte[] data, Map<String,String> headers)
IBaseServiceputData in interface IBaseServiceurl - target urldata - binary dataheaders - http headerspublic org.apache.http.HttpResponse putDataWithResponse(String url, byte[] data, Map<String,String> headers)
public RawResponse json(String api, List<org.apache.http.NameValuePair> params, String body)
IBaseServicejson in interface IBaseServiceapi - the apiparams - the paramsbody - the bodypublic RawResponse post(String api, List<org.apache.http.NameValuePair> query, List<org.apache.http.NameValuePair> form)
IBaseServicepost in interface IBaseServiceapi - the apiquery - the paramsform - the formpublic void setClientNoReuse()
IBaseServicesetClientNoReuse in interface IBaseServicepublic String getAccessKey()
IBaseServicegetAccessKey in interface IBaseServicepublic void setAccessKey(String accessKey)
IBaseServicesetAccessKey in interface IBaseServiceaccessKey - the access keypublic String getSecretKey()
IBaseServicegetSecretKey in interface IBaseServicepublic void setSecretKey(String secretKey)
IBaseServicesetSecretKey in interface IBaseServicesecretKey - the secret keypublic String getSessionToken()
IBaseServicegetSessionToken in interface IBaseServicepublic void setSessionToken(String sessionToken)
IBaseServicesetSessionToken in interface IBaseServicesessionToken - the session tokenpublic void setRegion(String region)
IBaseServicesetRegion in interface IBaseServiceregion - the regionpublic String getRegion()
IBaseServicegetRegion in interface IBaseServicepublic void setHost(String host)
IBaseServicesetHost in interface IBaseServicehost - the hostpublic void setScheme(String scheme)
IBaseServicesetScheme in interface IBaseServicescheme - the schemepublic org.apache.http.client.HttpClient getHttpClient()
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
IBaseServicesetHttpClient in interface IBaseServicehttpClient - the http clientpublic ServiceInfo getServiceInfo()
public void setServiceInfo(ServiceInfo serviceInfo)
IBaseServicesetServiceInfo in interface IBaseServiceserviceInfo - the service infopublic ISignerV4 getISigner()
public void setSocketTimeout(int socketTimeout)
IBaseServicesetSocketTimeout in interface IBaseServicesocketTimeout - the socket timeoutpublic void setConnectionTimeout(int connectionTimeout)
IBaseServicesetConnectionTimeout in interface IBaseServiceconnectionTimeout - the connection timeoutpublic SecurityToken2 signSts2(Policy inlinePolicy, long expire) throws Exception
IBaseServicesignSts2 in interface 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 in interface IBaseServiceapi - interface path like /PutLogsparams - query paramsheader - some special header for protobufbody - request bodycompressType - default not compress,support lz4Copyright © 2023. All rights reserved.