Class ClientFactory

java.lang.Object
org.voltdb.client.ClientFactory

public class ClientFactory extends Object
Factory for constructing instances of the Client or Client2 interfaces.

The choice of Client or Client2 is determined by the class of configuration object used, either ClientConfig or Client2Config.

  • Constructor Details

    • ClientFactory

      public ClientFactory()
  • Method Details

    • createClient

      public static Client createClient()
      Create a Client with no connections and all default options. Authentication will use a blank username and password.
      Returns:
      Newly constructed Client
    • createClient

      public static Client createClient(ClientConfig config)
      Create a "version 1" client, Client.

      Using a ClientConfig object ensures that a client application is isolated from changes to the configuration options. Authentication credentials are provided via the configuration object.

      Parameters:
      config - A ClientConfig object
      Returns:
      A configured Client
    • createClient

      public static Client2 createClient(Client2Config config)
      Create a "version 2" client, Client2.

      This call takes a Client2Config argument, which distinguishes it from createClient(ClientConfig).

      All client options, including authentication information, are provided via the Client2Config object.

      Parameters:
      config - A Client2Config object
      Returns:
      A configured Client2
    • preserveResources

      public static void preserveResources()
      Internally used by the VoltDB server during initialization.

      This method is intended to ensure that the resources needed to create clients are always initialized and won't be released when the active client count goes to zero.