Skip to content

Commit

Permalink
Fix for issue #67. Exposed the underlying Apache client in the constr…
Browse files Browse the repository at this point in the history
…uctor.
  • Loading branch information
Jeff Sabin committed Aug 14, 2018
1 parent 0a89f42 commit 7b7fd3f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/org/kairosdb/client/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 7b7fd3f

Please sign in to comment.