Class OkHttpClientHandler
- java.lang.Object
-
- net.morimekta.providence.client.okhttp.OkHttpClientHandler
-
- All Implemented Interfaces:
net.morimekta.providence.PServiceCallHandler
public class OkHttpClientHandler extends java.lang.Object implements net.morimekta.providence.PServiceCallHandlerHTTP client handler using the OkHTTP client interface.
-
-
Constructor Summary
Constructors Constructor Description OkHttpClientHandler(java.util.function.Supplier<java.net.URL> urlSupplier)Create a HTTP client with default transport, serialization and no instrumentation.OkHttpClientHandler(java.util.function.Supplier<java.net.URL> urlSupplier, okhttp3.OkHttpClient factory)Create a HTTP client with default serialization and no instrumentation.OkHttpClientHandler(java.util.function.Supplier<java.net.URL> urlSupplier, okhttp3.OkHttpClient factory, net.morimekta.providence.serializer.SerializerProvider serializerProvider)Create a HTTP client with no instrumentation.OkHttpClientHandler(java.util.function.Supplier<java.net.URL> urlSupplier, okhttp3.OkHttpClient factory, net.morimekta.providence.serializer.SerializerProvider serializerProvider, net.morimekta.providence.PServiceCallInstrumentation 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>,Response extends net.morimekta.providence.PMessage<Response>>
net.morimekta.providence.PServiceCall<Response>handleCall(net.morimekta.providence.PServiceCall<Request> call, net.morimekta.providence.descriptor.PService service)
-
-
-
Constructor Detail
-
OkHttpClientHandler
public OkHttpClientHandler(@Nonnull java.util.function.Supplier<java.net.URL> urlSupplier)Create a HTTP client with default transport, serialization and no instrumentation.- Parameters:
urlSupplier- The HTTP url supplier.
-
OkHttpClientHandler
public OkHttpClientHandler(@Nonnull java.util.function.Supplier<java.net.URL> urlSupplier, @Nonnull okhttp3.OkHttpClient factory)Create a HTTP client with default serialization and no instrumentation.- Parameters:
urlSupplier- The HTTP url supplier.factory- The HTTP request factory.
-
OkHttpClientHandler
public OkHttpClientHandler(@Nonnull java.util.function.Supplier<java.net.URL> urlSupplier, @Nonnull okhttp3.OkHttpClient 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.
-
OkHttpClientHandler
public OkHttpClientHandler(@Nonnull java.util.function.Supplier<java.net.URL> urlSupplier, @Nonnull okhttp3.OkHttpClient factory, @Nonnull net.morimekta.providence.serializer.SerializerProvider serializerProvider, @Nonnull net.morimekta.providence.PServiceCallInstrumentation 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>,Response extends net.morimekta.providence.PMessage<Response>> net.morimekta.providence.PServiceCall<Response> handleCall(net.morimekta.providence.PServiceCall<Request> call, net.morimekta.providence.descriptor.PService service) throws java.io.IOException- Specified by:
handleCallin interfacenet.morimekta.providence.PServiceCallHandler- Throws:
java.io.IOException
-
-