Interface VariantClient


public interface VariantClient
Variant Java client provides Java native bindings for communicating with Variant CVM Server. Makes no assumptions about the host application other than it is running on a Java VM. Instantiated with the builder pattern:
 protected VariantClient client = VariantClient.build(
   builder ->
    builder.withSessionIdTrackerClass(MySessionIdTracker.class)
 );
 

An implementation of SessionIdTracker must be provided.

Since:
0.5
See Also:
  • Method Details

    • build

      Factory method for obtaining a new instance of VariantClient. Host application should hold on to and reuse the object returned by this method whenever possible. One instance of VariantClient per process is always sufficient.
      Returns:
      Instance of the VariantClient type.
      Since:
      0.10
    • connectTo

      Connection connectTo(String uriString)
      Connect to a experiment schema on a Variant server by its URI. This is the first call a host application makes, after building a new variant client.
      Parameters:
      uriString - The URI to the experiment schema formatted as [http|https:]//host[:port]/schema. If omitted, port 5377 is assumed. For example, to connect to schema example:
         Connection conn = client.connectTo("http://my.server.com:5377/example")
       
      Returns:
      An object of type Connection.
      Throws:
      UnknownSchemaException - if given schema does not exist on the server.
      Since:
      0.7