Package io.jans.configapi.core.service
Class ConfigHttpService
- java.lang.Object
-
- io.jans.configapi.core.service.ConfigHttpService
-
- All Implemented Interfaces:
Serializable
@ApplicationScoped public class ConfigHttpService extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.logging.log4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description ConfigHttpService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.conn.routing.HttpRoutePlannerbuildDefaultRoutePlanner(String proxy)org.apache.http.conn.routing.HttpRoutePlannerbuildDefaultRoutePlanner(String hostname, int port, String scheme)StringconstructServerUrl(jakarta.servlet.http.HttpServletRequest request)voidconsume(org.apache.http.HttpResponse httpResponse)StringconvertEntityToString(byte[] responseBytes)StringconvertEntityToString(byte[] responseBytes, String charsetName)StringconvertEntityToString(byte[] responseBytes, Charset charset)StringencodeBase64(String value)StringencodeUrl(String value)io.jans.model.net.HttpServiceResponseexecuteGet(String requestUri, Map<String,String> headers)io.jans.model.net.HttpServiceResponseexecuteGet(String requestUri, Map<String,String> headers, Map<String,String> data)io.jans.model.net.HttpServiceResponseexecuteGet(org.apache.http.client.HttpClient httpClient, String requestUri)io.jans.model.net.HttpServiceResponseexecuteGet(org.apache.http.client.HttpClient httpClient, String requestUri, Map<String,String> headers, Map<String,String> parameters)io.jans.model.net.HttpServiceResponseexecutePost(String uri, String authCode, String postData, org.apache.http.entity.ContentType contentType, String authType)io.jans.model.net.HttpServiceResponseexecutePost(org.apache.http.client.HttpClient httpClient, String uri, String authCode, String postData, org.apache.http.entity.ContentType contentType)io.jans.model.net.HttpServiceResponseexecutePost(org.apache.http.client.HttpClient httpClient, String uri, String authCode, Map<String,String> headers, String postData)io.jans.model.net.HttpServiceResponseexecutePost(org.apache.http.client.HttpClient httpClient, String uri, String authCode, Map<String,String> headers, String postData, org.apache.http.entity.ContentType contentType, String authType)org.apache.http.impl.client.CloseableHttpClientgetHttpsClient()org.apache.http.impl.client.CloseableHttpClientgetHttpsClient(String trustStorePath, String trustStorePassword)org.apache.http.impl.client.CloseableHttpClientgetHttpsClient(String trustStorePath, String trustStorePassword, String keyStorePath, String keyStorePassword)org.apache.http.impl.client.CloseableHttpClientgetHttpsClient(org.apache.http.client.config.RequestConfig requestConfig)org.apache.http.impl.client.CloseableHttpClientgetHttpsClient(org.apache.http.client.config.RequestConfig requestConfig, org.apache.http.conn.routing.HttpRoutePlanner routerPlanner)org.apache.http.impl.client.CloseableHttpClientgetHttpsClient(org.apache.http.conn.routing.HttpRoutePlanner routerPlanner)org.apache.http.impl.client.CloseableHttpClientgetHttpsClientTrustAll()byte[]getResponseContent(org.apache.http.HttpResponse httpResponse)voidinit()booleanisContentTypeXml(org.apache.http.HttpResponse httpResponse)booleanisResponseStastusCodeOk(org.apache.http.HttpResponse httpResponse)booleanisResponseStatusCodeOk(org.apache.http.HttpResponse httpResponse)
-
-
-
Method Detail
-
init
@PostConstruct public void init()
-
getHttpsClientTrustAll
public org.apache.http.impl.client.CloseableHttpClient getHttpsClientTrustAll() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException
-
getHttpsClient
public org.apache.http.impl.client.CloseableHttpClient getHttpsClient()
-
getHttpsClient
public org.apache.http.impl.client.CloseableHttpClient getHttpsClient(org.apache.http.client.config.RequestConfig requestConfig)
-
getHttpsClient
public org.apache.http.impl.client.CloseableHttpClient getHttpsClient(org.apache.http.conn.routing.HttpRoutePlanner routerPlanner)
-
getHttpsClient
public org.apache.http.impl.client.CloseableHttpClient getHttpsClient(org.apache.http.client.config.RequestConfig requestConfig, org.apache.http.conn.routing.HttpRoutePlanner routerPlanner)
-
getHttpsClient
public org.apache.http.impl.client.CloseableHttpClient getHttpsClient(String trustStorePath, String trustStorePassword) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException
-
getHttpsClient
public org.apache.http.impl.client.CloseableHttpClient getHttpsClient(String trustStorePath, String trustStorePassword, String keyStorePath, String keyStorePassword) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException, UnrecoverableKeyException
-
executePost
public io.jans.model.net.HttpServiceResponse executePost(org.apache.http.client.HttpClient httpClient, String uri, String authCode, Map<String,String> headers, String postData, org.apache.http.entity.ContentType contentType, String authType)
-
executePost
public io.jans.model.net.HttpServiceResponse executePost(org.apache.http.client.HttpClient httpClient, String uri, String authCode, Map<String,String> headers, String postData)
-
executePost
public io.jans.model.net.HttpServiceResponse executePost(org.apache.http.client.HttpClient httpClient, String uri, String authCode, String postData, org.apache.http.entity.ContentType contentType)
-
executePost
public io.jans.model.net.HttpServiceResponse executePost(String uri, String authCode, String postData, org.apache.http.entity.ContentType contentType, String authType)
-
executeGet
public io.jans.model.net.HttpServiceResponse executeGet(org.apache.http.client.HttpClient httpClient, String requestUri, Map<String,String> headers, Map<String,String> parameters)
-
executeGet
public io.jans.model.net.HttpServiceResponse executeGet(String requestUri, Map<String,String> headers, Map<String,String> data)
-
executeGet
public io.jans.model.net.HttpServiceResponse executeGet(String requestUri, Map<String,String> headers)
-
executeGet
public io.jans.model.net.HttpServiceResponse executeGet(org.apache.http.client.HttpClient httpClient, String requestUri)
-
getResponseContent
public byte[] getResponseContent(org.apache.http.HttpResponse httpResponse) throws IOException- Throws:
IOException
-
consume
public void consume(org.apache.http.HttpResponse httpResponse) throws IOException- Throws:
IOException
-
convertEntityToString
public String convertEntityToString(byte[] responseBytes)
-
convertEntityToString
public String convertEntityToString(byte[] responseBytes, String charsetName) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
isResponseStastusCodeOk
public boolean isResponseStastusCodeOk(org.apache.http.HttpResponse httpResponse)
-
isResponseStatusCodeOk
public boolean isResponseStatusCodeOk(org.apache.http.HttpResponse httpResponse)
-
isContentTypeXml
public boolean isContentTypeXml(org.apache.http.HttpResponse httpResponse)
-
constructServerUrl
public String constructServerUrl(jakarta.servlet.http.HttpServletRequest request)
-
buildDefaultRoutePlanner
public org.apache.http.conn.routing.HttpRoutePlanner buildDefaultRoutePlanner(String hostname, int port, String scheme)
-
buildDefaultRoutePlanner
public org.apache.http.conn.routing.HttpRoutePlanner buildDefaultRoutePlanner(String proxy)
-
-