Interface ClickHouseSocketFactory


public interface ClickHouseSocketFactory
Generic factory interface for creating sockets used by the TCP and Apache Http clients.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    create(ClickHouseConfig config, Class<T> clazz)
    Creates a new instance of the provided configuration and class type.
    boolean
    supports(Class<?> clazz)
    Tests whether this factory supports creating instances of the given class type.
  • Method Details

    • create

      <T> T create(ClickHouseConfig config, Class<T> clazz) throws IOException, UnsupportedOperationException
      Creates a new instance of the provided configuration and class type.
      Type Parameters:
      T - type of class to create
      Parameters:
      config - configuration
      clazz - class instance for the type to instantiate
      Returns:
      non-null new instance of the given class
      Throws:
      IOException - when failed to create the instance
      UnsupportedOperationException - when the given class is not supported
    • supports

      boolean supports(Class<?> clazz)
      Tests whether this factory supports creating instances of the given class type. For example, before calling create(ClickHouseConfig, Class), you may want to call this method first to verify the factory can produce the desired type.
      Parameters:
      clazz - non-null class reflecting the type to check support for
      Returns:
      true if the factory supports creating instances of the given type; false otherwise