public class HttpComponents42Client extends AbstractClient
AbstractClient, that makes use of
Apache HttpComponents 4.2
for HTTP transfers.JSON_CONTENT_TYPE, LIVE_API, RESPONSE_HEADER_API_CLIENT, RESPONSE_HEADER_CAUSER_ID, RESPONSE_HEADER_REQUEST_REFNUM, RESPONSE_HEADER_RESOURCE_ID, SANDBOX_API, XML_CONTENT_TYPE| Constructor and Description |
|---|
HttpComponents42Client(String apiBaseUrl,
String consumerToken,
String consumerSecret)
Creates an instance of
HttpComponents42Client. |
HttpComponents42Client(String apiBaseUrl,
String consumerToken,
String consumerSecret,
org.apache.http.client.HttpClient httpClient)
Creates an instance of
HttpComponents42Client. |
| Modifier and Type | Method and Description |
|---|---|
protected oauth.signpost.OAuthConsumer |
buildOAuthConsumer(String apiAccessKey,
String apiAccessSecret) |
protected oauth.signpost.OAuthProvider |
buildOAuthProvider(String apiBaseUrl) |
void |
close() |
protected Response |
createResponse(org.apache.http.HttpResponse response)
Retrieves a
Response from a HttpResponse. |
protected Response |
sendJsonRequest(URL url,
RequestMethod method,
String json) |
protected Response |
sendVideoUploadRequest(URL url,
RequestMethod method,
String auth,
InputStream input,
String fileName,
long fileSize) |
protected Response |
sendXmlAttachmentRequest(URL url,
RequestMethod method,
String xml,
InputStream input,
String fileName,
String mimeType) |
protected Response |
sendXmlRequest(URL url,
RequestMethod method,
String xml) |
void |
setDefaultHttpClient()
Use a default
HttpClient for HTTP traffic. |
void |
setDefaultHttpClient(int timeout)
Use a default
HttpClient for HTTP traffic. |
void |
setHttpClient(org.apache.http.client.HttpClient httpClient)
Use a specific
HttpClient for HTTP traffic. |
authorize, authorize, authorizeAfterVerification, authorizeAfterVerification, fetchVerification, fetchVerification, getApiBaseUrl, getAuthConsumer, getAuthProvider, getEncoding, getUrlEncodedValuepublic HttpComponents42Client(String apiBaseUrl, String consumerToken, String consumerSecret)
HttpComponents42Client.apiBaseUrl - base URL of the IS24-Webservice (see AbstractClient.LIVE_API and
AbstractClient.SANDBOX_API)consumerToken - consumer token, that identifies the application at the IS24-WebserviceconsumerSecret - consumer secret, that identifies the application at the IS24-Webservicepublic HttpComponents42Client(String apiBaseUrl, String consumerToken, String consumerSecret, org.apache.http.client.HttpClient httpClient)
HttpComponents42Client.apiBaseUrl - base URL of the IS24-Webservice (see AbstractClient.LIVE_API and
AbstractClient.SANDBOX_API)consumerToken - consumer token, that identifies the application at the IS24-WebserviceconsumerSecret - consumer secret, that identifies the application at the IS24-WebservicehttpClient - HttpClient, that is used for HTTP transfersprotected oauth.signpost.OAuthConsumer buildOAuthConsumer(String apiAccessKey, String apiAccessSecret)
buildOAuthConsumer in class AbstractClientprotected oauth.signpost.OAuthProvider buildOAuthProvider(String apiBaseUrl)
buildOAuthProvider in class AbstractClientpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AbstractClientIOExceptionprotected Response createResponse(org.apache.http.HttpResponse response) throws IOException
Response from a HttpResponse.response - HttpResponse, that was received by the clientResponse of the requestIOException - if the Response can't be obtainedprotected Response sendJsonRequest(URL url, RequestMethod method, String json) throws IOException, oauth.signpost.exception.OAuthException
sendJsonRequest in class AbstractClientIOExceptionoauth.signpost.exception.OAuthExceptionprotected Response sendXmlRequest(URL url, RequestMethod method, String xml) throws IOException, oauth.signpost.exception.OAuthException
sendXmlRequest in class AbstractClientIOExceptionoauth.signpost.exception.OAuthExceptionprotected Response sendXmlAttachmentRequest(URL url, RequestMethod method, String xml, InputStream input, String fileName, String mimeType) throws IOException, oauth.signpost.exception.OAuthException
sendXmlAttachmentRequest in class AbstractClientIOExceptionoauth.signpost.exception.OAuthExceptionprotected Response sendVideoUploadRequest(URL url, RequestMethod method, String auth, InputStream input, String fileName, long fileSize) throws IOException, oauth.signpost.exception.OAuthException
sendVideoUploadRequest in class AbstractClientIOExceptionoauth.signpost.exception.OAuthExceptionpublic void setDefaultHttpClient()
HttpClient for HTTP traffic.public void setDefaultHttpClient(int timeout)
HttpClient for HTTP traffic.timeout - timeout for HTTP communication (in milliseconds)public void setHttpClient(org.apache.http.client.HttpClient httpClient)
HttpClient for HTTP traffic.httpClient - HttpClient, that is used for HTTP communicationCopyright © 2017 OpenEstate. All rights reserved.