Class ServiceFinder

java.lang.Object
ch.systemsx.cisd.openbis.common.api.client.ServiceFinder

public class ServiceFinder extends Object
Helper to find a remote service exported by Spring's HttpInvoker or any other way for which an implementation of IServiceStubFactory exists. Default is HttpInvokerBasedServiceStubFactory.
  • Field Details

    • SERVER_TIMEOUT_IN_MINUTES

      public static final int SERVER_TIMEOUT_IN_MINUTES
      See Also:
  • Constructor Details

    • ServiceFinder

      public ServiceFinder(String applicationName, String urlServiceSuffix)
      Creates an instance for specified application name and URL service suffix. Uses HttpInvokerBasedServiceStubFactory to create the service stub.
      Parameters:
      applicationName - Name of the Web application.
      urlServiceSuffix - URL Suffix of the service.
    • ServiceFinder

      public ServiceFinder(String applicationName, String urlServiceSuffix, IServiceStubFactory serviceStubCreator)
      Creates an instance for specified application name and URL service suffix.
      Parameters:
      applicationName - Name of the Web application.
      urlServiceSuffix - URL Suffix of the service.
      serviceStubCreator - Factory which creates the service stub
  • Method Details

    • createService

      public <S extends IRpcService> S createService(Class<S> serviceInterface, String serverUrl)
      Creates a remote service implementing specified interface for specified server URL. Following server URLs are accepted:
      • protocol://host:port
      • protocol://host:port/applicationName
      • protocol://host:port/applicationName/applicationName
    • createService

      public <S extends IRpcService> S createService(Class<S> serviceInterface, String serverUrl, long timeoutInMillis)
      Creates a remote service implementing specified interface for specified server URL. Following server URLs are accepted:
      • protocol://host:port
      • protocol://host:port/applicationName
      • protocol://host:port/applicationName/applicationName
    • createService

      public <S> S createService(Class<S> serviceInterface, String serverUrl, IServicePinger<S> servicePinger)
      Creates a remote service implementing specified interface for specified server URL by using specified pinger for checking server connection. Following server URLs are accepted:
      • protocol://host:port
      • protocol://host:port/applicationName
      • protocol://host:port/applicationName/applicationName
    • createService

      public <S> S createService(Class<S> serviceInterface, String serverUrl, IServicePinger<S> servicePinger, long timeoutInMillis)
      Creates a remote service implementing specified interface for specified server URL by using specified pinger for checking server connection. Following server URLs are accepted:
      • protocol://host:port
      • protocol://host:port/applicationName
      • protocol://host:port/applicationName/applicationName
    • createServiceUrl

      public <S> String createServiceUrl(Class<S> serviceInterface, String serverUrl, IServicePinger<S> servicePinger, long timeoutInMillis)