@Deprecated public class DefaultHttpProvider extends java.lang.Object implements IHttpProvider
| Constructor and Description |
|---|
DefaultHttpProvider(ISerializer serializer,
IAuthenticationProvider authenticationProvider,
IExecutors executors,
ILogger logger)
Deprecated.
Creates the DefaultHttpProvider using a DefaultConnectionFactory.
|
DefaultHttpProvider(ISerializer serializer,
IAuthenticationProvider authenticationProvider,
IExecutors executors,
ILogger logger,
IConnectionFactory connectionFactory)
Deprecated.
Creates the DefaultHttpProvider
|
| Modifier and Type | Method and Description |
|---|---|
IAuthenticationProvider |
getAuthenticationProvider()
Deprecated.
|
IConnectionConfig |
getConnectionConfig()
Deprecated.
Get connection config for read and connect timeout in requests
|
IExecutors |
getExecutors()
Deprecated.
|
<Result,BodyType> |
getHttpRequest(IHttpRequest request,
java.lang.Class<Result> resultClass,
BodyType serializable,
IProgressCallback<? super Result> progress)
Deprecated.
Sends the HTTP request
|
ILogger |
getLogger()
Deprecated.
|
ISerializer |
getSerializer()
Deprecated.
Gets the serializer for this HTTP provider
|
<Result,Body> |
send(IHttpRequest request,
java.lang.Class<Result> resultClass,
Body serializable)
Deprecated.
Sends the HTTP request
|
<Result,Body,DeserializeType> |
send(IHttpRequest request,
java.lang.Class<Result> resultClass,
Body serializable,
IStatefulResponseHandler<Result,DeserializeType> handler)
Deprecated.
Sends the HTTP request
|
<Result,Body> |
send(IHttpRequest request,
ICallback<? super Result> callback,
java.lang.Class<Result> resultClass,
Body serializable)
Deprecated.
Sends the HTTP request asynchronously
|
void |
setConnectionConfig(IConnectionConfig connectionConfig)
Deprecated.
Set connection config for read and connect timeout in requests
|
static java.lang.String |
streamToString(java.io.InputStream input)
Deprecated.
Reads in a stream and converts it into a string
|
public DefaultHttpProvider(ISerializer serializer, IAuthenticationProvider authenticationProvider, IExecutors executors, ILogger logger)
serializer - the serializerauthenticationProvider - the authentication providerexecutors - the executorslogger - the logger for diagnostic informationpublic DefaultHttpProvider(ISerializer serializer, IAuthenticationProvider authenticationProvider, IExecutors executors, ILogger logger, IConnectionFactory connectionFactory)
serializer - the serializerauthenticationProvider - the authentication providerexecutors - the executorslogger - the logger for diagnostic informationconnectionFactory - an IConnectionFactory to create outgoing connectionspublic ISerializer getSerializer()
getSerializer in interface IHttpProviderpublic <Result,Body> void send(IHttpRequest request, ICallback<? super Result> callback, java.lang.Class<Result> resultClass, Body serializable)
send in interface IHttpProviderResult - the type of the response objectBody - the type of the object to send to the service in the body of the requestrequest - the request descriptioncallback - the callback to be called after success or failureresultClass - the class of the response from the serviceserializable - the object to send to the service in the body of the requestpublic <Result,Body> Result send(IHttpRequest request, java.lang.Class<Result> resultClass, Body serializable) throws ClientException
send in interface IHttpProviderResult - the type of the response objectBody - the type of the object to send to the service in the body of the requestrequest - the request descriptionresultClass - the class of the response from the serviceserializable - the object to send to the service in the body of the requestClientException - an exception occurs if the request was unable to complete for any reasonpublic <Result,Body,DeserializeType> Result send(IHttpRequest request, java.lang.Class<Result> resultClass, Body serializable, IStatefulResponseHandler<Result,DeserializeType> handler) throws ClientException
send in interface IHttpProviderResult - the type of the response objectBody - the type of the object to send to the service in the body of the requestDeserializeType - the response handler for stateful responserequest - the request descriptionresultClass - the class of the response from the serviceserializable - the object to send to the service in the body of the requesthandler - the handler for stateful responseClientException - this exception occurs if the request was unable to complete for any reasonpublic static java.lang.String streamToString(java.io.InputStream input)
input - the response body streampublic ILogger getLogger()
public IExecutors getExecutors()
public IAuthenticationProvider getAuthenticationProvider()
public IConnectionConfig getConnectionConfig()
getConnectionConfig in interface IHttpProviderpublic void setConnectionConfig(IConnectionConfig connectionConfig)
setConnectionConfig in interface IHttpProviderconnectionConfig - Connection configuration to be used for timeout valuespublic <Result,BodyType> okhttp3.Request getHttpRequest(IHttpRequest request, java.lang.Class<Result> resultClass, BodyType serializable, IProgressCallback<? super Result> progress) throws ClientException
IHttpProvidergetHttpRequest in interface IHttpProviderResult - the type of the response objectBodyType - the type of the object to send to the service in the body of the requestrequest - the request descriptionresultClass - the class of the response from the serviceserializable - the object to send to the service in the body of the requestprogress - the progress callback for the requestClientException - an exception occurs if the request was unable to complete for any reason