Package org.gluu.oxauth.service.net
Class HttpService
- java.lang.Object
- 
- org.gluu.oxauth.service.net.HttpService
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 @ApplicationScoped @Named public class HttpService extends java.lang.Object implements java.io.SerializableProvides operations with http requests- Author:
- Yuriy Movchan Date: 02/05/2013
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description HttpService()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringconstructServerUrl(javax.servlet.http.HttpServletRequest request)voidconsume(org.apache.http.HttpResponse httpResponse)java.lang.StringconvertEntityToString(byte[] responseBytes)java.lang.StringconvertEntityToString(byte[] responseBytes, java.lang.String charsetName)java.lang.StringconvertEntityToString(byte[] responseBytes, java.nio.charset.Charset charset)java.lang.StringencodeBase64(java.lang.String value)java.lang.StringencodeUrl(java.lang.String value)HttpServiceResponseexecuteGet(org.apache.http.client.HttpClient httpClient, java.lang.String requestUri)HttpServiceResponseexecuteGet(org.apache.http.client.HttpClient httpClient, java.lang.String requestUri, java.util.Map<java.lang.String,java.lang.String> headers)HttpServiceResponseexecutePost(org.apache.http.client.HttpClient httpClient, java.lang.String uri, java.lang.String authData, java.lang.String postData, org.apache.http.entity.ContentType contentType)HttpServiceResponseexecutePost(org.apache.http.client.HttpClient httpClient, java.lang.String uri, java.lang.String authData, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String postData)HttpServiceResponseexecutePost(org.apache.http.client.HttpClient httpClient, java.lang.String uri, java.lang.String authData, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String postData, org.apache.http.entity.ContentType contentType)org.apache.http.client.HttpClientgetHttpsClient()org.apache.http.client.HttpClientgetHttpsClient(java.lang.String trustStoreType, java.lang.String trustStorePath, java.lang.String trustStorePassword)org.apache.http.client.HttpClientgetHttpsClient(java.lang.String trustStoreType, java.lang.String trustStorePath, java.lang.String trustStorePassword, java.lang.String keyStoreType, java.lang.String keyStorePath, java.lang.String keyStorePassword)org.apache.http.client.HttpClientgetHttpsClientTrustAll()byte[]getResponseContent(org.apache.http.HttpResponse httpResponse)voidinit()booleanisContentTypeXml(org.apache.http.HttpResponse httpResponse)booleanisResponseStastusCodeOk(org.apache.http.HttpResponse httpResponse)
 
- 
- 
- 
Method Detail- 
init@PostConstruct public void init() 
 - 
getHttpsClientTrustAllpublic org.apache.http.client.HttpClient getHttpsClientTrustAll() 
 - 
getHttpsClientpublic org.apache.http.client.HttpClient getHttpsClient() 
 - 
getHttpsClientpublic org.apache.http.client.HttpClient getHttpsClient(java.lang.String trustStoreType, java.lang.String trustStorePath, java.lang.String trustStorePassword)
 - 
getHttpsClientpublic org.apache.http.client.HttpClient getHttpsClient(java.lang.String trustStoreType, java.lang.String trustStorePath, java.lang.String trustStorePassword, java.lang.String keyStoreType, java.lang.String keyStorePath, java.lang.String keyStorePassword)
 - 
executePostpublic HttpServiceResponse executePost(org.apache.http.client.HttpClient httpClient, java.lang.String uri, java.lang.String authData, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String postData, org.apache.http.entity.ContentType contentType) 
 - 
executePostpublic HttpServiceResponse executePost(org.apache.http.client.HttpClient httpClient, java.lang.String uri, java.lang.String authData, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String postData) 
 - 
executePostpublic HttpServiceResponse executePost(org.apache.http.client.HttpClient httpClient, java.lang.String uri, java.lang.String authData, java.lang.String postData, org.apache.http.entity.ContentType contentType) 
 - 
encodeBase64public java.lang.String encodeBase64(java.lang.String value) 
 - 
encodeUrlpublic java.lang.String encodeUrl(java.lang.String value) 
 - 
executeGetpublic HttpServiceResponse executeGet(org.apache.http.client.HttpClient httpClient, java.lang.String requestUri, java.util.Map<java.lang.String,java.lang.String> headers) 
 - 
executeGetpublic HttpServiceResponse executeGet(org.apache.http.client.HttpClient httpClient, java.lang.String requestUri) throws org.apache.http.client.ClientProtocolException, java.io.IOException - Throws:
- org.apache.http.client.ClientProtocolException
- java.io.IOException
 
 - 
getResponseContentpublic byte[] getResponseContent(org.apache.http.HttpResponse httpResponse) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
consumepublic void consume(org.apache.http.HttpResponse httpResponse) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
convertEntityToStringpublic java.lang.String convertEntityToString(byte[] responseBytes) 
 - 
convertEntityToStringpublic java.lang.String convertEntityToString(byte[] responseBytes, java.nio.charset.Charset charset)
 - 
convertEntityToStringpublic java.lang.String convertEntityToString(byte[] responseBytes, java.lang.String charsetName) throws java.io.UnsupportedEncodingException- Throws:
- java.io.UnsupportedEncodingException
 
 - 
isResponseStastusCodeOkpublic boolean isResponseStastusCodeOk(org.apache.http.HttpResponse httpResponse) 
 - 
isContentTypeXmlpublic boolean isContentTypeXml(org.apache.http.HttpResponse httpResponse) 
 - 
constructServerUrlpublic java.lang.String constructServerUrl(javax.servlet.http.HttpServletRequest request) 
 
- 
 
-