Package com.clickhouse.client
Interface ClickHouseSocketFactory
public interface ClickHouseSocketFactory
Generic factory interface for creating sockets used by the TCP and Apache
Http clients.
-
Method Summary
Modifier and TypeMethodDescription<T> Tcreate(ClickHouseConfig config, Class<T> clazz) Creates a new instance of the provided configuration and class type.booleanTests 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- configurationclazz- class instance for the type to instantiate- Returns:
- non-null new instance of the given class
- Throws:
IOException- when failed to create the instanceUnsupportedOperationException- when the given class is not supported
-
supports
Tests whether this factory supports creating instances of the given class type. For example, before callingcreate(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
-