Class ClientSideServiceProvider

java.lang.Object
net.bluemind.core.rest.http.ClientSideServiceProvider
All Implemented Interfaces:
net.bluemind.core.rest.IServiceProvider

public class ClientSideServiceProvider extends Object implements net.bluemind.core.rest.IServiceProvider
Calls the BlueMind API over HTTP, from the Java API client jars.

It keeps the API of the ClientSideServiceProvider of the BlueMind servers, on top of JdkClientServiceProvider. Like the server one, it accepts any TLS certificate. The read timeout has no equivalent and is not used.

  • Field Details

    • TIMEOUT_LONG_REQUEST

      public static final int TIMEOUT_LONG_REQUEST
    • TIMEOUT_INFINITE_REQUEST

      public static final int TIMEOUT_INFINITE_REQUEST
      See Also:
  • Method Details

    • getProvider

      public static ClientSideServiceProvider getProvider(String base, String apiKey)
      Returns a provider with 40 seconds timeouts.
      Parameters:
      base - URL of the BlueMind server (eg. https://bluemind.example.com)
      apiKey - API key or session id sent with each call
      Returns:
      the provider
    • getProvider

      public static ClientSideServiceProvider getProvider(String base, String apiKey, int connectTimeoutSeconds, int readTimeoutSeconds, int requestTimeoutSeconds)
      Returns a provider with the given timeouts.
      Parameters:
      base - URL of the BlueMind server (eg. https://bluemind.example.com)
      apiKey - API key or session id sent with each call
      connectTimeoutSeconds - maximum time to open a connection
      readTimeoutSeconds - not used
      requestTimeoutSeconds - maximum time to wait for the response headers of a call, TIMEOUT_INFINITE_REQUEST for no limit
      Returns:
      the provider
    • instance

      public <T> T instance(Class<T> interfaceClass, String... params)
      Specified by:
      instance in interface net.bluemind.core.rest.IServiceProvider
    • instance

      public <T,A> A instance(Class<T> interfaceClass, Class<A> asyncInterface, String... params)
      Returns an asynchronous client of a service.
      Parameters:
      interfaceClass - service interface (eg. IUser)
      asyncInterface - asynchronous variant of the service interface (eg. IUserAsync)
      params - parameters of the root path of the service
      Returns:
      the asynchronous client
    • withRemoteIps

      public ClientSideServiceProvider withRemoteIps(List<String> remotes)
    • setOrigin

      public net.bluemind.core.rest.IServiceProvider setOrigin(String origin)
      Specified by:
      setOrigin in interface net.bluemind.core.rest.IServiceProvider