Class JerseyClientFactory

java.lang.Object
io.bdeploy.jersey.JerseyClientFactory

public class JerseyClientFactory extends Object
A factory for Jersey based JAX-RS clients.
  • Method Details

    • get

      public static JerseyClientFactory get(RemoteService svc)
    • invalidateCached

      public static void invalidateCached(RemoteService srv)
    • register

      public void register(com.fasterxml.jackson.databind.Module o)
    • setReporter

      public void setReporter(ActivityReporter reporter)
      Parameters:
      reporter - the ActivityReporter to report lengthy operations to (e.g. up/download).
    • setDefaultReporter

      public static void setDefaultReporter(ActivityReporter activityReporter)
      Parameters:
      activityReporter - the default ActivityReporter used for all new JerseyClientFactorys.
    • getProxyClient

      public <T> T getProxyClient(Class<T> clazz, Object... additionalRegistrations)
      Parameters:
      clazz - the type of resource (service interface).
      Returns:
      A dynamic proxy based client for the given remote service.
    • getBaseTarget

      public jakarta.ws.rs.client.WebTarget getBaseTarget(Object... additionalRegistrations)
      Returns:
      a WebTarget with all required feature, filter and provider registrations for the RemoteService associated with this factory.
    • setProxyUuid

      public static void setProxyUuid(String uuid)
    • getWebSocketClient

      public com.ning.http.client.AsyncHttpClient getWebSocketClient()
      Returns:
      a client that is capable of providing a WebSocket connection to the given service. The caller is responsible for closing the client once done!
    • getObjectChangeWebSocket

      public ObjectChangeClientWebSocket getObjectChangeWebSocket(Consumer<ObjectChangeDto> onChanges)
      Create a ObjectChangeClientWebSocket which allows to subscribe to object changes, and notifies about them.