Class DefaultServiceClientProvider

  • All Implemented Interfaces:
    ServiceClientProvider

    @Component
    public class DefaultServiceClientProvider
    extends java.lang.Object
    implements ServiceClientProvider
    Provider that returns a suitable service client capable of making http calls.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T getService​(java.lang.Class<T> type, ServiceEndpoint serviceEndpoint)
      Returns the concrete retrofit service client
      <T> T getService​(java.lang.Class<T> type, ServiceEndpoint serviceEndpoint, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Returns the concrete retrofit service client
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultServiceClientProvider

        public DefaultServiceClientProvider​(java.util.List<ServiceClientFactory> serviceClientFactories,
                                            com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • Method Detail

      • getService

        public <T> T getService​(java.lang.Class<T> type,
                                ServiceEndpoint serviceEndpoint)
        Description copied from interface: ServiceClientProvider
        Returns the concrete retrofit service client
        Specified by:
        getService in interface ServiceClientProvider
        Type Parameters:
        T - type of client , usually a interface with all the remote method definitions.
        Parameters:
        type - retrofit interface type
        serviceEndpoint - endpoint definition
        Returns:
        the retrofit interface implementation
      • getService

        public <T> T getService​(java.lang.Class<T> type,
                                ServiceEndpoint serviceEndpoint,
                                com.fasterxml.jackson.databind.ObjectMapper objectMapper)
        Description copied from interface: ServiceClientProvider
        Returns the concrete retrofit service client
        Specified by:
        getService in interface ServiceClientProvider
        Type Parameters:
        T - type of client , usually a interface with all the remote method definitions.
        Parameters:
        type - retrofit interface type
        serviceEndpoint - endpoint definition
        objectMapper - object mapper for conversion
        Returns:
        the retrofit interface implementation