|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nativex.advertiser.HttpConnectionManager
public class HttpConnectionManager
Constructor Summary | |
---|---|
HttpConnectionManager()
|
Method Summary | |
---|---|
private BasicHttpResponse |
executePost(ClientConnectionManager mgr,
HttpPost httpPost)
Executed a post request. |
String |
executeServerRequest(String url,
String request)
Method performing HttpClient operations for sending and receiving requests |
private ClientConnectionManager |
getConnectionManager()
Implements ClientConnectionManager instance. |
private KeyStore |
getDefaultKeyStore()
Accesses the default keystore. |
HttpClient |
getHttpClient()
|
private StringBuilder |
getResponseAsString(BasicHttpResponse response)
Converts the response to string. |
private SSLSocketFactory |
getSSLSocketFactory(KeyStore keystore)
Provides the necessary SSL connection factory. |
private HttpPost |
populatePost(String url,
String request)
Creates the post object and populates the headers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpConnectionManager()
Method Detail |
---|
private KeyStore getDefaultKeyStore()
KeyStore
. The keystore.private SSLSocketFactory getSSLSocketFactory(KeyStore keystore)
keystore
- KeyStore
. A keystore to use for the SSL connection factory.
SSLSocketFactory
. The SSL connection factory.private HttpPost populatePost(String url, String request)
private BasicHttpResponse executePost(ClientConnectionManager mgr, HttpPost httpPost) throws ClientProtocolException, IOException
mgr
- ClientConnectionManager
. The connection manager.httpPost
- HttpPost
. The request.
BasicHttpResponse
. The response from the server for the post request.
ClientProtocolException
- The HttpClient
can throw this exception.
IOException
- The HttpClient
can throw this exception.public HttpClient getHttpClient()
private StringBuilder getResponseAsString(BasicHttpResponse response) throws IllegalStateException, IOException
response
- BasicHttpResponse
. The response.
String
. The string representation of the response.
IllegalStateException
- Could be thrown when reading the response InputStream
.
IOException
- Could be thrown when reading the response InputStream
.private ClientConnectionManager getConnectionManager() throws SSLException
ClientConnectionManager
. The connection manager instance.
SSLException
- Thrown if the SSLSocketFactory
could not be instantiated.public String executeServerRequest(String url, String request) throws ClientProtocolException, IOException, SSLException
IOException
- Could be thrown while executing the request.
SSLException
- Could be thrown while initializing the connection manager.
ClientProtocolException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |