Class BaseJSONWebServiceClientImpl
java.lang.Object
com.liferay.portal.json.web.service.client.BaseJSONWebServiceClientImpl
- All Implemented Interfaces:
JSONWebServiceClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHeaders(org.apache.http.HttpMessage httpMessage, List<org.apache.http.NameValuePair> headers) voidvoiddestroy()doDelete(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) doGet(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) <V,T> List<V> doGetToList(Class<T> clazz, String url, String... parametersArray) <V,T> List<V> doGetToList(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) <T> TdoGetToObject(Class<T> clazz, String url, String... parametersArray) doPost(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) doPostAsJSON(String url, Object object) doPostAsJSON(String url, String json) doPostAsJSON(String url, String json, List<org.apache.http.NameValuePair> headers) <T> TdoPostToObject(Class<T> clazz, String url, String... parametersArray) <T> TdoPostToObject(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) doPut(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) <T> TdoPutToObject(Class<T> clazz, String url, String... parametersArray) <T> TdoPutToObject(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters) <T> TdoPutToObject(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) protected Stringexecute(org.apache.http.client.methods.HttpRequestBase httpRequestBase) protected StringgetExceptionMessage(String json) intprotected org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManagerintprotected org.apache.http.config.Registry<org.apache.http.nio.conn.SchemeIOSessionStrategy>protected org.apache.http.nio.conn.ssl.SSLIOSessionStrategyprotected intprotected booleanprotected voidlog(String httpCommand, String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) voidregisterModule(com.fasterxml.jackson.databind.Module module) voidvoidsetClassLoader(ClassLoader classLoader) voidsetContextPath(String contextPath) voidsetHeaders(Map<String, String> headers) voidsetHostName(String hostName) voidsetHostPort(int hostPort) voidsetKeyStore(KeyStore keyStore) voidvoidsetMaxAttempts(int maxAttempts) voidsetOAuthAccessSecret(String oAuthAccessSecret) voidsetOAuthAccessToken(String oAuthAccessToken) voidsetOAuthConsumerKey(String oAuthConsumerKey) voidsetOAuthConsumerSecret(String oAuthConsumerSecret) voidsetPassword(String password) voidsetProtocol(String protocol) voidsetProxyAuthType(String proxyAuthType) voidsetProxyDomain(String proxyDomain) protected voidsetProxyHost(org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpClientBuilder) voidsetProxyHostName(String proxyHostName) voidsetProxyHostPort(int proxyHostPort) voidsetProxyLogin(String proxyLogin) voidsetProxyPassword(String proxyPassword) voidsetProxyWorkstation(String proxyWorkstation) voidsetTrustSelfSignedCertificates(boolean trustSelfSignedCertificates) protected abstract voidsignRequest(org.apache.http.client.methods.HttpRequestBase httpRequestBase) protected StringupdateJSON(String json)
-
Constructor Details
-
BaseJSONWebServiceClientImpl
protected BaseJSONWebServiceClientImpl()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet() throws org.apache.http.nio.reactor.IOReactorException- Throws:
org.apache.http.nio.reactor.IOReactorException
-
destroy
public void destroy()- Specified by:
destroyin interfaceJSONWebServiceClient
-
doDelete
public String doDelete(String url, List<org.apache.http.NameValuePair> parameters) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doDeletein interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doDelete
public String doDelete(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doDeletein interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doDelete
public String doDelete(String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doDeletein interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doGet
public String doGet(String url, List<org.apache.http.NameValuePair> parameters) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doGetin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doGet
public String doGet(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doGetin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doGet
public String doGet(String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doGetin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doGetToList
public <V,T> List<V> doGetToList(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doGetToListin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doGetToList
public <V,T> List<V> doGetToList(Class<T> clazz, String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doGetToListin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doGetToObject
public <T> T doGetToObject(Class<T> clazz, String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doGetToObjectin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doPost
public String doPost(String url, List<org.apache.http.NameValuePair> parameters) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPostin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPost
public String doPost(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPostin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPost
public String doPost(String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPostin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPostAsJSON
public String doPostAsJSON(String url, Object object) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doPostAsJSONin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doPostAsJSON
public String doPostAsJSON(String url, String json) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPostAsJSONin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPostAsJSON
public String doPostAsJSON(String url, String json, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPostAsJSONin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPostToObject
public <T> T doPostToObject(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doPostToObjectin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doPostToObject
public <T> T doPostToObject(Class<T> clazz, String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doPostToObjectin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doPut
public String doPut(String url, List<org.apache.http.NameValuePair> parameters) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPutin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPut
public String doPut(String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPutin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPut
public String doPut(String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceTransportException - Specified by:
doPutin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceTransportException
-
doPutToObject
public <T> T doPutToObject(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doPutToObjectin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doPutToObject
public <T> T doPutToObject(Class<T> clazz, String url, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.NameValuePair> headers) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doPutToObjectin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
doPutToObject
public <T> T doPutToObject(Class<T> clazz, String url, String... parametersArray) throws JSONWebServiceInvocationException, JSONWebServiceSerializeException, JSONWebServiceTransportException - Specified by:
doPutToObjectin interfaceJSONWebServiceClient- Throws:
JSONWebServiceInvocationExceptionJSONWebServiceSerializeExceptionJSONWebServiceTransportException
-
getHeaders
-
getHostName
- Specified by:
getHostNamein interfaceJSONWebServiceClient
-
getHostPort
public int getHostPort()- Specified by:
getHostPortin interfaceJSONWebServiceClient
-
getProtocol
- Specified by:
getProtocolin interfaceJSONWebServiceClient
-
getProxyAuthType
-
getProxyDomain
-
getProxyHostName
-
getProxyHostPort
public int getProxyHostPort() -
getProxyLogin
-
getProxyPassword
-
getProxyWorkstation
-
registerModule
public void registerModule(com.fasterxml.jackson.databind.Module module) - Specified by:
registerModulein interfaceJSONWebServiceClient
-
resetHttpClient
public void resetHttpClient()- Specified by:
resetHttpClientin interfaceJSONWebServiceClient
-
setClassLoader
-
setContextPath
-
setHeaders
-
setHostName
- Specified by:
setHostNamein interfaceJSONWebServiceClient
-
setHostPort
public void setHostPort(int hostPort) - Specified by:
setHostPortin interfaceJSONWebServiceClient
-
setKeyStore
- Specified by:
setKeyStorein interfaceJSONWebServiceClient
-
setLogin
- Specified by:
setLoginin interfaceJSONWebServiceClient
-
setMaxAttempts
public void setMaxAttempts(int maxAttempts) - Specified by:
setMaxAttemptsin interfaceJSONWebServiceClient
-
setOAuthAccessSecret
- Specified by:
setOAuthAccessSecretin interfaceJSONWebServiceClient
-
setOAuthAccessToken
- Specified by:
setOAuthAccessTokenin interfaceJSONWebServiceClient
-
setOAuthConsumerKey
- Specified by:
setOAuthConsumerKeyin interfaceJSONWebServiceClient
-
setOAuthConsumerSecret
- Specified by:
setOAuthConsumerSecretin interfaceJSONWebServiceClient
-
setPassword
- Specified by:
setPasswordin interfaceJSONWebServiceClient
-
setProtocol
- Specified by:
setProtocolin interfaceJSONWebServiceClient
-
setProxyAuthType
-
setProxyDomain
-
setProxyHostName
-
setProxyHostPort
public void setProxyHostPort(int proxyHostPort) -
setProxyLogin
-
setProxyPassword
-
setProxyWorkstation
-
setTrustSelfSignedCertificates
public void setTrustSelfSignedCertificates(boolean trustSelfSignedCertificates) - Specified by:
setTrustSelfSignedCertificatesin interfaceJSONWebServiceClient
-
addHeaders
protected void addHeaders(org.apache.http.HttpMessage httpMessage, List<org.apache.http.NameValuePair> headers) -
execute
protected String execute(org.apache.http.client.methods.HttpRequestBase httpRequestBase) throws JSONWebServiceInvocationException, JSONWebServiceTransportException -
getExceptionMessage
-
getPoolingNHttpClientConnectionManager
protected org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager getPoolingNHttpClientConnectionManager() throws org.apache.http.nio.reactor.IOReactorException- Throws:
org.apache.http.nio.reactor.IOReactorException
-
getSchemeIOSessionStrategyRegistry
protected org.apache.http.config.Registry<org.apache.http.nio.conn.SchemeIOSessionStrategy> getSchemeIOSessionStrategyRegistry() -
getSSLIOSessionStrategy
protected org.apache.http.nio.conn.ssl.SSLIOSessionStrategy getSSLIOSessionStrategy() -
getStatus
-
isNull
-
log
-
setProxyHost
protected void setProxyHost(org.apache.http.impl.nio.client.HttpAsyncClientBuilder httpClientBuilder) -
signRequest
protected abstract void signRequest(org.apache.http.client.methods.HttpRequestBase httpRequestBase) throws JSONWebServiceTransportException.SigningFailure -
updateJSON
-