IHttpProvider<nativeRequestType> Interface

Type Parameters

nativeRequestType

type of a request for the native http client

public interface IHttpProvider<nativeRequestType>

Sends HTTP requests

Method Summary

Modifier and Type Method and Description
abstract Result <Result,BodyType,DeserializeType>send(IHttpRequest request, Class<Result> resultClass, BodyType serializable, IStatefulResponseHandler<Result,DeserializeType> handler)

Sends the HTTP request

abstract java.util.concurrent.CompletableFuture<Result> <Result,BodyType,DeserializeType>sendAsync(IHttpRequest request, Class<Result> resultClass, BodyType serializable, IStatefulResponseHandler<Result,DeserializeType> handler)

Sends the HTTP request

abstract nativeRequestType <Result,BodyType>getHttpRequest(IHttpRequest request, Class<Result> resultClass, BodyType serializable)

Sends the HTTP request

abstract Result <Result,BodyType>send(IHttpRequest request, Class<Result> resultClass, BodyType serializable)

Sends the HTTP request

abstract java.util.concurrent.CompletableFuture<Result> <Result,BodyType>sendAsync(IHttpRequest request, Class<Result> resultClass, BodyType serializable)

Sends the HTTP request asynchronously

abstract ISerializer getSerializer()

Get the serializer for this HTTP provider

Method Details

<Result,BodyType,DeserializeType>send

public abstract Result send(IHttpRequest request, Class resultClass, BodyType serializable, IStatefulResponseHandler handler)

Sends the HTTP request

Parameters:

request - the request description
resultClass - the class of the response from the service
serializable - the object to send to the service in the body of the request
handler - the handler for stateful response

Returns:

the expected result object for the request

Throws:

ClientException - this exception occurs if the request was unable to complete for any reason

<Result,BodyType,DeserializeType>sendAsync

public abstract CompletableFuture sendAsync(IHttpRequest request, Class resultClass, BodyType serializable, IStatefulResponseHandler handler)

Sends the HTTP request

Parameters:

request - the request description
resultClass - the class of the response from the service
serializable - the object to send to the service in the body of the request
handler - the handler for stateful response

Returns:

a future with the result

Throws:

ClientException - this exception occurs if the request was unable to complete for any reason

<Result,BodyType>getHttpRequest

public abstract nativeRequestType getHttpRequest(IHttpRequest request, Class resultClass, BodyType serializable)

Sends the HTTP request

Parameters:

request - the request description
resultClass - the class of the response from the service
serializable - the object to send to the service in the body of the request

Returns:

the result from the request

Throws:

ClientException - an exception occurs if the request was unable to complete for any reason

<Result,BodyType>send

public abstract Result send(IHttpRequest request, Class resultClass, BodyType serializable)

Sends the HTTP request

Parameters:

request - the request description
resultClass - the class of the response from the service
serializable - the object to send to the service in the body of the request

Returns:

the result from the request

Throws:

ClientException - this exception occurs if the request was unable to complete for any reason

<Result,BodyType>sendAsync

public abstract CompletableFuture sendAsync(IHttpRequest request, Class resultClass, BodyType serializable)

Sends the HTTP request asynchronously

Parameters:

request - the request description
resultClass - the class of the response from the service
serializable - the object to send to the service in the body of the request

Returns:

a future with the result

getSerializer

public abstract ISerializer getSerializer()

Get the serializer for this HTTP provider

Returns:

the serializer for this provider

Applies to