diff --git a/src/main/java/org/kairosdb/client/HttpClient.java b/src/main/java/org/kairosdb/client/HttpClient.java index 720f449..1de12a9 100644 --- a/src/main/java/org/kairosdb/client/HttpClient.java +++ b/src/main/java/org/kairosdb/client/HttpClient.java @@ -106,13 +106,23 @@ public HttpClient(String url) throws MalformedURLException public HttpClient(HttpClientBuilder builder, String url) throws MalformedURLException { checkNotNullOrEmpty(url, "url cannot be null"); - checkNotNull(builder, "builder cannot be null"); + checkNotNull(builder, "builder must not be null"); this.url = url; new URL(url); // validate url client = builder.build(); typeRegistry = new DataPointTypeRegistry(); } + public HttpClient(CloseableHttpClient client, String url) throws MalformedURLException + { + checkNotNullOrEmpty(url, "url cannot be null"); + checkNotNull(client, "client must not be null"); + this.url = url; + new URL(url); // validate url + this.client = client; + typeRegistry = new DataPointTypeRegistry(); + } + public void registerCustomDataType(String groupType, Class dataPointClass) { checkNotNullOrEmpty(groupType, "groupType may not be null or empty");