Package net.morimekta.providence.client
Class HttpClientHandler
- java.lang.Object
-
- net.morimekta.providence.client.HttpClientHandler
-
- All Implemented Interfaces:
net.morimekta.providence.PServiceCallHandler
public class HttpClientHandler extends java.lang.Object implements net.morimekta.providence.PServiceCallHandlerHTTP client handler using the google HTTP client interface.
-
-
Constructor Summary
Constructors Constructor Description HttpClientHandler(java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier)Create a HTTP client with default transport, serialization and no instrumentation.HttpClientHandler(java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier, com.google.api.client.http.HttpRequestFactory factory)Create a HTTP client with default serialization and no instrumentation.HttpClientHandler(java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier, com.google.api.client.http.HttpRequestFactory factory, net.morimekta.providence.serializer.SerializerProvider serializerProvider)Create a HTTP client with no instrumentation.HttpClientHandler(java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier, com.google.api.client.http.HttpRequestFactory factory, net.morimekta.providence.serializer.SerializerProvider serializerProvider, net.morimekta.providence.util.ServiceCallInstrumentation instrumentation)Create a HTTP client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <Request extends net.morimekta.providence.PMessage<Request,RequestField>,Response extends net.morimekta.providence.PMessage<Response,ResponseField>,RequestField extends net.morimekta.providence.descriptor.PField,ResponseField extends net.morimekta.providence.descriptor.PField>
net.morimekta.providence.PServiceCall<Response,ResponseField>handleCall(net.morimekta.providence.PServiceCall<Request,RequestField> call, net.morimekta.providence.descriptor.PService service)
-
-
-
Constructor Detail
-
HttpClientHandler
public HttpClientHandler(@Nonnull java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier)Create a HTTP client with default transport, serialization and no instrumentation.- Parameters:
urlSupplier- The HTTP url supplier.
-
HttpClientHandler
public HttpClientHandler(@Nonnull java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier, @Nonnull com.google.api.client.http.HttpRequestFactory factory)Create a HTTP client with default serialization and no instrumentation.- Parameters:
urlSupplier- The HTTP url supplier.factory- The HTTP request factory.
-
HttpClientHandler
public HttpClientHandler(@Nonnull java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier, @Nonnull com.google.api.client.http.HttpRequestFactory factory, @Nonnull net.morimekta.providence.serializer.SerializerProvider serializerProvider)Create a HTTP client with no instrumentation.- Parameters:
urlSupplier- The HTTP url supplier.factory- The HTTP request factory.serializerProvider- The serializer provider.
-
HttpClientHandler
public HttpClientHandler(@Nonnull java.util.function.Supplier<com.google.api.client.http.GenericUrl> urlSupplier, @Nonnull com.google.api.client.http.HttpRequestFactory factory, @Nonnull net.morimekta.providence.serializer.SerializerProvider serializerProvider, @Nonnull net.morimekta.providence.util.ServiceCallInstrumentation instrumentation)Create a HTTP client.- Parameters:
urlSupplier- The HTTP url supplier.factory- The HTTP request factory.serializerProvider- The serializer provider.instrumentation- The service call instrumentation.
-
-
Method Detail
-
handleCall
public <Request extends net.morimekta.providence.PMessage<Request,RequestField>,Response extends net.morimekta.providence.PMessage<Response,ResponseField>,RequestField extends net.morimekta.providence.descriptor.PField,ResponseField extends net.morimekta.providence.descriptor.PField> net.morimekta.providence.PServiceCall<Response,ResponseField> handleCall(net.morimekta.providence.PServiceCall<Request,RequestField> call, net.morimekta.providence.descriptor.PService service) throws java.io.IOException- Specified by:
handleCallin interfacenet.morimekta.providence.PServiceCallHandler- Throws:
java.io.IOException
-
-